diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:04:05 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:04:05 +0000 |
| commit | 676fbe8105eeb6ff4bb2ed261cb212fcfdbe7b63 (patch) | |
| tree | 02a1ac369cb734d0abfa5000dd86e5b7797e6a74 /examples | |
| parent | c7e70c433efc6953dc3888b9fbf9f3512d7da2b0 (diff) | |
Vendor import of clang trunk r351319 (just before the release_80 branchvendor/clang/clang-trunk-r351319
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/AnnotateFunctions/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/PrintFunctionNames/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/analyzer-plugin/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/analyzer-plugin/MainCallChecker.cpp | 6 | ||||
| -rw-r--r-- | examples/clang-interpreter/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | examples/clang-interpreter/Test.cxx | 2 | ||||
| -rw-r--r-- | examples/clang-interpreter/main.cpp | 8 |
7 files changed, 13 insertions, 10 deletions
diff --git a/examples/AnnotateFunctions/CMakeLists.txt b/examples/AnnotateFunctions/CMakeLists.txt index 5684abf2380d..44b6317e72af 100644 --- a/examples/AnnotateFunctions/CMakeLists.txt +++ b/examples/AnnotateFunctions/CMakeLists.txt @@ -1,4 +1,4 @@ -add_llvm_loadable_module(AnnotateFunctions AnnotateFunctions.cpp PLUGIN_TOOL clang) +add_llvm_library(AnnotateFunctions MODULE AnnotateFunctions.cpp PLUGIN_TOOL clang) if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN)) target_link_libraries(AnnotateFunctions PRIVATE diff --git a/examples/PrintFunctionNames/CMakeLists.txt b/examples/PrintFunctionNames/CMakeLists.txt index e582b2c45a86..68c6f76dff05 100644 --- a/examples/PrintFunctionNames/CMakeLists.txt +++ b/examples/PrintFunctionNames/CMakeLists.txt @@ -9,7 +9,7 @@ if( NOT MSVC ) # MSVC mangles symbols differently, and endif() endif() -add_llvm_loadable_module(PrintFunctionNames PrintFunctionNames.cpp PLUGIN_TOOL clang) +add_llvm_library(PrintFunctionNames MODULE PrintFunctionNames.cpp PLUGIN_TOOL clang) if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN)) target_link_libraries(PrintFunctionNames PRIVATE diff --git a/examples/analyzer-plugin/CMakeLists.txt b/examples/analyzer-plugin/CMakeLists.txt index 0d5b2754cafe..7c7b2aec1988 100644 --- a/examples/analyzer-plugin/CMakeLists.txt +++ b/examples/analyzer-plugin/CMakeLists.txt @@ -1,5 +1,5 @@ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/SampleAnalyzerPlugin.exports) -add_llvm_loadable_module(SampleAnalyzerPlugin MainCallChecker.cpp PLUGIN_TOOL clang) +add_llvm_library(SampleAnalyzerPlugin MODULE MainCallChecker.cpp PLUGIN_TOOL clang) if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN)) target_link_libraries(SampleAnalyzerPlugin PRIVATE diff --git a/examples/analyzer-plugin/MainCallChecker.cpp b/examples/analyzer-plugin/MainCallChecker.cpp index 74fe663e981f..77316d696de3 100644 --- a/examples/analyzer-plugin/MainCallChecker.cpp +++ b/examples/analyzer-plugin/MainCallChecker.cpp @@ -1,6 +1,6 @@ #include "clang/StaticAnalyzer/Core/Checker.h" #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h" -#include "clang/StaticAnalyzer/Core/CheckerRegistry.h" +#include "clang/StaticAnalyzer/Frontend/CheckerRegistry.h" #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h" using namespace clang; @@ -45,7 +45,9 @@ void MainCallChecker::checkPreStmt(const CallExpr *CE, CheckerContext &C) const // Register plugin! extern "C" void clang_registerCheckers (CheckerRegistry ®istry) { - registry.addChecker<MainCallChecker>("example.MainCallChecker", "Disallows calls to functions called main"); + registry.addChecker<MainCallChecker>( + "example.MainCallChecker", "Disallows calls to functions called main", + ""); } extern "C" diff --git a/examples/clang-interpreter/CMakeLists.txt b/examples/clang-interpreter/CMakeLists.txt index 7b9657ec1abf..b69a82e0541b 100644 --- a/examples/clang-interpreter/CMakeLists.txt +++ b/examples/clang-interpreter/CMakeLists.txt @@ -25,6 +25,7 @@ target_link_libraries(clang-interpreter clangCodeGen clangDriver clangFrontend + clangSerialization ) export_executable_symbols(clang-interpreter) diff --git a/examples/clang-interpreter/Test.cxx b/examples/clang-interpreter/Test.cxx index d2cbb0baac5c..d39249214dc5 100644 --- a/examples/clang-interpreter/Test.cxx +++ b/examples/clang-interpreter/Test.cxx @@ -21,7 +21,7 @@ static void ThrowerAnError(const char* Name) { int main(int argc, const char** argv) { for (int I = 0; I < argc; ++I) printf("arg[%d]='%s'\n", I, argv[I]); - + try { ThrowerAnError("In JIT"); } catch (const std::exception& E) { diff --git a/examples/clang-interpreter/main.cpp b/examples/clang-interpreter/main.cpp index 3f87be29a979..1c83b1d3e75f 100644 --- a/examples/clang-interpreter/main.cpp +++ b/examples/clang-interpreter/main.cpp @@ -54,8 +54,8 @@ private: std::shared_ptr<SymbolResolver> Resolver; std::unique_ptr<TargetMachine> TM; const DataLayout DL; - RTDyldObjectLinkingLayer ObjectLayer; - IRCompileLayer<decltype(ObjectLayer), SimpleCompiler> CompileLayer; + LegacyRTDyldObjectLinkingLayer ObjectLayer; + LegacyIRCompileLayer<decltype(ObjectLayer), SimpleCompiler> CompileLayer; public: SimpleJIT() @@ -75,7 +75,7 @@ public: TM(EngineBuilder().selectTarget()), DL(TM->createDataLayout()), ObjectLayer(ES, [this](VModuleKey) { - return RTDyldObjectLinkingLayer::Resources{ + return LegacyRTDyldObjectLinkingLayer::Resources{ std::make_shared<SectionMemoryManager>(), Resolver}; }), CompileLayer(ObjectLayer, SimpleCompiler(*TM)) { @@ -164,7 +164,7 @@ int main(int argc, const char **argv) { } // Initialize a compiler invocation object from the clang (-cc1) arguments. - const driver::ArgStringList &CCArgs = Cmd.getArguments(); + const llvm::opt::ArgStringList &CCArgs = Cmd.getArguments(); std::unique_ptr<CompilerInvocation> CI(new CompilerInvocation); CompilerInvocation::CreateFromArgs(*CI, const_cast<const char **>(CCArgs.data()), |
