summaryrefslogtreecommitdiff
path: root/tools/lto/LTOCodeGenerator.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2012-05-03 16:50:55 +0000
committerDimitry Andric <dim@FreeBSD.org>2012-05-03 16:50:55 +0000
commitb61ab53cb789e568acbb2952fbead20ab853a696 (patch)
tree8575c732129e272992ac5d7b4c2519238fff4735 /tools/lto/LTOCodeGenerator.cpp
parent63faed5b8e4f2755f127fcb8aa440480c0649327 (diff)
Diffstat (limited to 'tools/lto/LTOCodeGenerator.cpp')
-rw-r--r--tools/lto/LTOCodeGenerator.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp
index 77c06a655b18e..6382a3f219e6e 100644
--- a/tools/lto/LTOCodeGenerator.cpp
+++ b/tools/lto/LTOCodeGenerator.cpp
@@ -64,7 +64,7 @@ LTOCodeGenerator::LTOCodeGenerator()
: _context(getGlobalContext()),
_linker("LinkTimeOptimizer", "ld-temp.o", _context), _target(NULL),
_emitDwarfDebugInfo(false), _scopeRestrictionsDone(false),
- _runInternalizePass(false), _codeModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC),
+ _codeModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC),
_nativeObjectFile(NULL) {
InitializeAllTargets();
InitializeAllTargetMCs();
@@ -355,8 +355,10 @@ bool LTOCodeGenerator::generateObjectFile(raw_ostream &out,
// Add an appropriate TargetData instance for this module...
passes.add(new TargetData(*_target->getTargetData()));
- PassManagerBuilder().populateLTOPassManager(passes,
- _runInternalizePass,
+ // Enabling internalize here would use its AllButMain variant. It
+ // keeps only main if it exists and does nothing for libraries. Instead
+ // we create the pass ourselves with the symbol list provided by the linker.
+ PassManagerBuilder().populateLTOPassManager(passes, /*Internalize=*/false,
!DisableInline,
DisableGVNLoadPRE);