Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 1.16 KB

README.md

File metadata and controls

16 lines (13 loc) · 1.16 KB

###SourceAnalyzer

SourceAnalyzer is a simple clang compiler plugin for source characterizing applications. It walks the AST of an application and classifies nodes into categories such as for statement, if statement, etc. It was used in this work (CHO: A Benchmark Suite for OpenCL-based FPGA Accelerators).

###Building and Running

  • If you don't have clang/LLVM already set them up as recommend here http://clang.llvm.org/get_started.html
  • Copy this folder to tools/clang/examples
  • Add plugin to makefile in tools/clang/Makefile by appending the name of this directory to the line that starts with PARALLEL_DIRS. If you are using cmake update CMakeLists.txt.
  • build/rebuild LLVM or clang.
  • Run the plugin as follows
$ export BD=/path/to/build/directory
$ clang -cc1 -load $BD/lib/libSourceAnalyzer.so   some-input-file.c

SourceAnalyzer was tested with LLVM 3.4 /clang 3.4 and may not compile with other versions of LLVM or clang as APIs may differ. The latest information about clang plugins can be found here