summaryrefslogtreecommitdiffstats
path: root/llvm/tools/gold/gold-plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/gold/gold-plugin.cpp')
-rw-r--r--llvm/tools/gold/gold-plugin.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp
index 016dca52382..08ff45d45eb 100644
--- a/llvm/tools/gold/gold-plugin.cpp
+++ b/llvm/tools/gold/gold-plugin.cpp
@@ -900,9 +900,6 @@ static ld_plugin_status allSymbolsReadHook(raw_fd_ostream *ApiFile) {
if (Modules.empty())
return LDPS_OK;
- LLVMContext Context;
- Context.setDiagnosticHandler(diagnosticHandlerForContext, nullptr, true);
-
// If we are doing ThinLTO compilation, simply build the combined
// function index/summary and emit it. We don't need to parse the modules
// and link them in this case.
@@ -937,6 +934,9 @@ static ld_plugin_status allSymbolsReadHook(raw_fd_ostream *ApiFile) {
exit(0);
}
+ LLVMContext Context;
+ Context.setDiagnosticHandler(diagnosticHandlerForContext, nullptr, true);
+
std::unique_ptr<Module> Combined(new Module("ld-temp.o", Context));
Linker L(*Combined, diagnosticHandler);
OpenPOWER on IntegriCloud