summaryrefslogtreecommitdiff
path: root/tools/lto
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-12-04 02:42:28 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-12-04 02:42:28 +0000
commitc6a202e8593da2db6c7330085536436ddc3fa263 (patch)
tree52ceafc863e616d6efccecab872604cf44ea4852 /tools/lto
parent6d3f26eb9adb329347b7af61958b32cf30761768 (diff)
Move a call to getGlobalContext out of lib/LTO.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254696 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lto')
-rw-r--r--tools/lto/lto.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp
index ee389da2499..6058fb1197e 100644
--- a/tools/lto/lto.cpp
+++ b/tools/lto/lto.cpp
@@ -95,13 +95,14 @@ static void handleLibLTODiagnostic(lto_codegen_diagnostic_severity_t Severity,
// libLTO API semantics, which require that the code generator owns the object
// file.
struct LibLTOCodeGenerator : LTOCodeGenerator {
- LibLTOCodeGenerator() {
+ LibLTOCodeGenerator() : LTOCodeGenerator(getGlobalContext()) {
setDiagnosticHandler(handleLibLTODiagnostic, nullptr); }
LibLTOCodeGenerator(std::unique_ptr<LLVMContext> Context)
- : LTOCodeGenerator(std::move(Context)) {
+ : LTOCodeGenerator(*Context), OwnedContext(std::move(Context)) {
setDiagnosticHandler(handleLibLTODiagnostic, nullptr); }
std::unique_ptr<MemoryBuffer> NativeObjectFile;
+ std::unique_ptr<LLVMContext> OwnedContext;
};
}