From 96b1d4b4eb6b18dd6df7a2c0833332b45840580f Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sat, 19 Feb 2011 21:39:31 +0000 Subject: Revert 125820 and 125819 to fix PR9266. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126050 91177308-0d34-0410-b5e6-96231b3b80d8 --- examples/PrintFunctionNames/CMakeLists.txt | 25 ++++++++++++++++++++++++- examples/clang-interpreter/main.cpp | 2 ++ 2 files changed, 26 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/PrintFunctionNames/CMakeLists.txt b/examples/PrintFunctionNames/CMakeLists.txt index 86793ce7e1..58b4603e9b 100644 --- a/examples/PrintFunctionNames/CMakeLists.txt +++ b/examples/PrintFunctionNames/CMakeLists.txt @@ -1,11 +1,34 @@ set(MODULE TRUE) set( LLVM_USED_LIBS + clangFrontendTool clangFrontend + clangDriver + clangSerialization + clangCodeGen + clangParse + clangSema + clangStaticAnalyzerFrontend + clangStaticAnalyzerCheckers + clangStaticAnalyzerCore + clangAnalysis + clangIndex + clangRewrite clangAST + clangLex + clangBasic ) -set( LLVM_LINK_COMPONENTS support mc) +# Why do we have to link to all this just to print out function names? +set( LLVM_LINK_COMPONENTS + ${LLVM_TARGETS_TO_BUILD} + asmparser + bitreader + bitwriter + codegen + ipo + selectiondag + ) add_clang_library(PrintFunctionNames PrintFunctionNames.cpp) diff --git a/examples/clang-interpreter/main.cpp b/examples/clang-interpreter/main.cpp index a99766f9a3..835a5a90ad 100644 --- a/examples/clang-interpreter/main.cpp +++ b/examples/clang-interpreter/main.cpp @@ -17,6 +17,7 @@ #include "clang/Frontend/FrontendDiagnostic.h" #include "clang/Frontend/TextDiagnosticPrinter.h" +#include "llvm/LLVMContext.h" #include "llvm/Module.h" #include "llvm/Config/config.h" #include "llvm/ADT/OwningPtr.h" @@ -129,6 +130,7 @@ int main(int argc, const char **argv, char * const *envp) { // Create a compiler instance to handle the actual work. CompilerInstance Clang; + Clang.setLLVMContext(new llvm::LLVMContext); Clang.setInvocation(CI.take()); // Create the compilers actual diagnostics engine. -- cgit v1.2.3-18-g5258