项目作者: IT302

项目描述 :
Source Analyzer is a simple clang compiler plugin for source characterizing applications.
高级语言: C++
项目地址: git://github.com/IT302/Source-Analyzer.git
创建时间: 2014-09-23T22:27:24Z
项目社区:https://github.com/IT302/Source-Analyzer

开源协议:MIT License

下载


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
    1. $ export BD=/path/to/build/directory
    2. $ 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