diff options
Diffstat (limited to 'examples/PrintFunctionNames')
-rw-r--r-- | examples/PrintFunctionNames/CMakeLists.txt | 22 | ||||
-rw-r--r-- | examples/PrintFunctionNames/Makefile | 12 | ||||
-rw-r--r-- | examples/PrintFunctionNames/PrintFunctionNames.cpp | 15 |
3 files changed, 19 insertions, 30 deletions
diff --git a/examples/PrintFunctionNames/CMakeLists.txt b/examples/PrintFunctionNames/CMakeLists.txt index 49dd22a..5ea75db 100644 --- a/examples/PrintFunctionNames/CMakeLists.txt +++ b/examples/PrintFunctionNames/CMakeLists.txt @@ -1,26 +1,10 @@ -set(SHARED_LIBRARY TRUE) +set(MODULE TRUE) set(LLVM_NO_RTTI 1) -set(LLVM_USED_LIBS - clangIndex - clangFrontend - clangDriver - clangSema - clangAnalysis - clangAST - clangParse - clangLex - clangBasic) - -set( LLVM_LINK_COMPONENTS - bitreader - mc - core - ) - add_clang_library(PrintFunctionNames PrintFunctionNames.cpp) set_target_properties(PrintFunctionNames PROPERTIES - LINKER_LANGUAGE CXX) + LINKER_LANGUAGE CXX + PREFIX "") diff --git a/examples/PrintFunctionNames/Makefile b/examples/PrintFunctionNames/Makefile index 57d3ba9..0ff5189 100644 --- a/examples/PrintFunctionNames/Makefile +++ b/examples/PrintFunctionNames/Makefile @@ -7,21 +7,13 @@ # ##===----------------------------------------------------------------------===## -LEVEL = ../../../.. +CLANG_LEVEL := ../.. LIBRARYNAME = PrintFunctionNames -CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include - -# Include this here so we can get the configuration of the targets that have -# been configured for construction. We have to do this early so we can set up -# LINK_COMPONENTS before including Makefile.rules -include $(LEVEL)/Makefile.config - LINK_LIBS_IN_SHARED = 1 SHARED_LIBRARY = 1 -LINK_COMPONENTS := bitreader mc core USEDLIBS = clangIndex.a clangFrontend.a clangDriver.a clangSema.a \ clangAnalysis.a clangAST.a clangParse.a clangLex.a clangBasic.a -include $(LEVEL)/Makefile.common +include $(CLANG_LEVEL)/Makefile diff --git a/examples/PrintFunctionNames/PrintFunctionNames.cpp b/examples/PrintFunctionNames/PrintFunctionNames.cpp index 5b7b66a..397cf84 100644 --- a/examples/PrintFunctionNames/PrintFunctionNames.cpp +++ b/examples/PrintFunctionNames/PrintFunctionNames.cpp @@ -31,11 +31,24 @@ public: } }; -class PrintFunctionNamesAction : public ASTFrontendAction { +class PrintFunctionNamesAction : public PluginASTAction { protected: ASTConsumer *CreateASTConsumer(CompilerInstance &CI, llvm::StringRef) { return new PrintFunctionsConsumer(); } + + bool ParseArgs(const std::vector<std::string>& args) { + for (unsigned i=0; i<args.size(); ++i) + llvm::errs() << "PrintFunctionNames arg = " << args[i] << "\n"; + if (args.size() && args[0] == "help") + PrintHelp(llvm::errs()); + + return true; + } + void PrintHelp(llvm::raw_ostream& ros) { + ros << "Help for PrintFunctionNames plugin goes here\n"; + } + }; } |