From c6a202e8593da2db6c7330085536436ddc3fa263 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 4 Dec 2015 02:42:28 +0000 Subject: 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 --- tools/lto/lto.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tools/lto') 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 Context) - : LTOCodeGenerator(std::move(Context)) { + : LTOCodeGenerator(*Context), OwnedContext(std::move(Context)) { setDiagnosticHandler(handleLibLTODiagnostic, nullptr); } std::unique_ptr NativeObjectFile; + std::unique_ptr OwnedContext; }; } -- cgit v1.2.3