summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2017-11-03 15:57:27 +0000
committerEric Liu <ioeric@google.com>2017-11-03 15:57:27 +0000
commit152ad0505067afea942699c5ccaaa11ec56e6f43 (patch)
treeab9cba836a17081cdac6517ab79854baa083ff13 /clang/lib
parentd3b9f61c52a11516ea90de49e2db7823668b41c5 (diff)
downloadbcm5719-llvm-152ad0505067afea942699c5ccaaa11ec56e6f43.tar.gz
bcm5719-llvm-152ad0505067afea942699c5ccaaa11ec56e6f43.zip
[Tooling] Fix linking of StandaloneToolExecutorPlugin.
llvm-svn: 317332
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Tooling/Execution.cpp8
-rw-r--r--clang/lib/Tooling/StandaloneExecution.cpp8
2 files changed, 11 insertions, 5 deletions
diff --git a/clang/lib/Tooling/Execution.cpp b/clang/lib/Tooling/Execution.cpp
index 0e3404f91c8..498d683f892 100644
--- a/clang/lib/Tooling/Execution.cpp
+++ b/clang/lib/Tooling/Execution.cpp
@@ -61,7 +61,7 @@ createExecutorFromCommandLineArgsImpl(int &argc, const char **argv,
const char *Overview) {
auto OptionsParser =
CommonOptionsParser::create(argc, argv, Category, llvm::cl::ZeroOrMore,
- /*Overview=*/nullptr);
+ /*Overview=*/Overview);
if (!OptionsParser)
return OptionsParser.takeError();
for (auto I = ToolExecutorPluginRegistry::begin(),
@@ -95,5 +95,11 @@ createExecutorFromCommandLineArgs(int &argc, const char **argv,
Overview);
}
+// This anchor is used to force the linker to link in the generated object file
+// and thus register the StandaloneToolExecutorPlugin.
+extern volatile int StandaloneToolExecutorAnchorSource;
+static int LLVM_ATTRIBUTE_UNUSED StandaloneToolExecutorAnchorDest =
+ StandaloneToolExecutorAnchorSource;
+
} // end namespace tooling
} // end namespace clang
diff --git a/clang/lib/Tooling/StandaloneExecution.cpp b/clang/lib/Tooling/StandaloneExecution.cpp
index e52e4a611f9..eea8e39d134 100644
--- a/clang/lib/Tooling/StandaloneExecution.cpp
+++ b/clang/lib/Tooling/StandaloneExecution.cpp
@@ -79,13 +79,13 @@ public:
}
};
-// This anchor is used to force the linker to link in the generated object file
-// and thus register the plugin.
-volatile int ToolExecutorPluginAnchorSource = 0;
-
static ToolExecutorPluginRegistry::Add<StandaloneToolExecutorPlugin>
X("standalone", "Runs FrontendActions on a set of files provided "
"via positional arguments.");
+// This anchor is used to force the linker to link in the generated object file
+// and thus register the plugin.
+volatile int StandaloneToolExecutorAnchorSource = 0;
+
} // end namespace tooling
} // end namespace clang
OpenPOWER on IntegriCloud