forked from maximesong/program-analysis
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
55 lines (46 loc) · 1.4 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Program Analysis based on LLVM and Clang
# Setup Build Environment
1. build llvm and clang
- currently, the project is only tested under llvm-3.3 and clang-3.3, you'd better stick to that release version
- Download 'Release Version' of llvm and clang(not svn or git version)
- build llvm and clang under the instruction here "http://clang.llvm.org/get_started.html"
- invoke `make install` in the build directory to add clang headers and executables to the system
2. setup the build envrionment for our project
- move the build directory of llvm to project's root directory, and rename it to "llvm-build"
After that, your directory should look like this.
|-- include
| `-- analyzer.h
|-- llvm-build
| |-- bindings
| |-- docs
| |-- examples
| |-- include
| |-- lib
| |-- Makefile
| |-- projects
| |-- Release+Asserts
| |-- runtime
| |-- test
| |-- tools
| |-- unittests
| `-- utils
|-- Makefile
|-- README
|-- samples
| |-- build
| |-- CMakeLists.txt
| |-- compile_commands.json
| |-- main.cpp
| |-- Makefile
| `-- sample
`-- src
|-- analyzer.cpp
`-- main.cpp
Make sure that there's a "Release+Asserts" directory under "llvm-build" which contains header files and libraries.
- invoke `make` (clang++ is needed to compile the source code)
- done
# Try the demo
invoke `./pa samples/main.cpp`
# Run the server
invoke `make runserver`
then open url 'http://localhost:8000'