summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-08-05 20:10:38 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-08-05 20:10:38 +0000
commitf9e52cf01563975a1d6e7a09a6f044ec3fbaf5cf (patch)
treee8235cd36ff905d21f3007a5d8f9c5cab898937c /llvm/lib
parentc03b6e78809b120f482604b3047c3888879ee29e (diff)
downloadbcm5719-llvm-f9e52cf01563975a1d6e7a09a6f044ec3fbaf5cf.tar.gz
bcm5719-llvm-f9e52cf01563975a1d6e7a09a6f044ec3fbaf5cf.zip
Don't internalize all but main by default.
This is mostly a cleanup, but it changes a fairly old behavior. Every "real" LTO user was already disabling the silly internalize pass and creating the internalize pass itself. The difference with this patch is for "opt -std-link-opts" and the C api. Now to get a usable behavior out of opt one doesn't need the funny looking command line: opt -internalize -disable-internalize -internalize-public-api-list=foo,bar -std-link-opts llvm-svn: 214919
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/LTO/LTOCodeGenerator.cpp6
-rw-r--r--llvm/lib/Transforms/IPO/PassManagerBuilder.cpp9
2 files changed, 3 insertions, 12 deletions
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index fe179cf1ac6..a51b1c9df8b 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -475,10 +475,8 @@ bool LTOCodeGenerator::generateObjectFile(raw_ostream &out,
// 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.
if (!DisableOpt)
- PassManagerBuilder().populateLTOPassManager(passes,
- /*Internalize=*/false,
- !DisableInline,
- DisableGVNLoadPRE);
+ PassManagerBuilder().populateLTOPassManager(passes, !DisableInline,
+ DisableGVNLoadPRE);
// Make sure everything is still good.
passes.add(createVerifierPass());
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
index 98477b5d71f..3d846b01d3a 100644
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -284,18 +284,11 @@ void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) {
}
void PassManagerBuilder::populateLTOPassManager(PassManagerBase &PM,
- bool Internalize,
bool RunInliner,
bool DisableGVNLoadPRE) {
// Provide AliasAnalysis services for optimizations.
addInitialAliasAnalysisPasses(PM);
- // Now that composite has been compiled, scan through the module, looking
- // for a main function. If main is defined, mark all other functions
- // internal.
- if (Internalize)
- PM.add(createInternalizePass("main"));
-
// Propagate constants at call sites into the functions they call. This
// opens opportunities for globalopt (and inlining) by substituting function
// pointers passed as arguments to direct uses of functions.
@@ -461,5 +454,5 @@ void LLVMPassManagerBuilderPopulateLTOPassManager(LLVMPassManagerBuilderRef PMB,
LLVMBool RunInliner) {
PassManagerBuilder *Builder = unwrap(PMB);
PassManagerBase *LPM = unwrap(PM);
- Builder->populateLTOPassManager(*LPM, Internalize != 0, RunInliner != 0);
+ Builder->populateLTOPassManager(*LPM, RunInliner != 0, false);
}
OpenPOWER on IntegriCloud