summaryrefslogtreecommitdiffstats
path: root/llvm/tools/lto/lto.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-04-16 22:25:36 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-04-16 22:25:36 +0000
commit247e636dc77aa16fafaad0ddbeac2107a4e138d6 (patch)
treeed412ed76871ca7afb45e2fa3a042b2c60bfa3a4 /llvm/tools/lto/lto.cpp
parent694ab4e966b5d348616081ee834cc5d7a071e13d (diff)
downloadbcm5719-llvm-247e636dc77aa16fafaad0ddbeac2107a4e138d6.tar.gz
bcm5719-llvm-247e636dc77aa16fafaad0ddbeac2107a4e138d6.zip
LTO: Use a common LibLTOCodeGenerator::init, NFC
llvm-svn: 266538
Diffstat (limited to 'llvm/tools/lto/lto.cpp')
-rw-r--r--llvm/tools/lto/lto.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/tools/lto/lto.cpp b/llvm/tools/lto/lto.cpp
index 5a179728e7c..7829dd06d0e 100644
--- a/llvm/tools/lto/lto.cpp
+++ b/llvm/tools/lto/lto.cpp
@@ -119,16 +119,18 @@ 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() : LTOCodeGenerator(*LTOContext) {
- setDiagnosticHandler(handleLibLTODiagnostic, nullptr); }
+ LibLTOCodeGenerator() : LTOCodeGenerator(*LTOContext) { init(); }
LibLTOCodeGenerator(std::unique_ptr<LLVMContext> Context)
: LTOCodeGenerator(*Context), OwnedContext(std::move(Context)) {
- setDiagnosticHandler(handleLibLTODiagnostic, nullptr); }
+ init();
+ }
// Reset the module first in case MergedModule is created in OwnedContext.
// Module must be destructed before its context gets destructed.
~LibLTOCodeGenerator() { resetMergedModule(); }
+ void init() { setDiagnosticHandler(handleLibLTODiagnostic, nullptr); }
+
std::unique_ptr<MemoryBuffer> NativeObjectFile;
std::unique_ptr<LLVMContext> OwnedContext;
};
OpenPOWER on IntegriCloud