Skip to content

This repo stores the extracted plugin feature from Clang and demos the feature using standalone examples

License

Notifications You must be signed in to change notification settings

chunhualiao/Clang-Plugin-Extracted

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This work extracts the plugin feature from Clang into a standalone example.
So the same plugin feature can be integrated into any other compilers or tools. 

We have simplified this feature and integrated it into ROSE.
https://en.wikibooks.org/wiki/ROSE_Compiler_Framework/Plugin

#------------------------------
version 1: orginal stripped version from Clang (C++11) 

version 2: simplified version, merging two classes into one (C++11)

version 3: eliminated C++11 to only use C++98

A smallest example to mimic the plugin mechanism in CLANG/LLVM
* merged ASTConsumer and FrontEndAction into a single class for simplicity
* no argument parsing support.

List of files
* main.C   // main entry: specifying plugin .so file and action name
* makefile
* plugin.h   // plugin header file
* plugin.C    // plugin source file
* PrintNames.C // the user-provided plugin implementing preorder traverse of the tree, register the action

#------------------------------
To test a version
 cd version{1|2|3}
 make check

To clean up, type:
  make clean

About

This repo stores the extracted plugin feature from Clang and demos the feature using standalone examples

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages