mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 03:24:09 +00:00
Revert r199191, "LTO: add API to set strategy for -internalize"
Please update also Other/link-opts.ll, in next time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199197 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -62,8 +62,7 @@ const char* LTOCodeGenerator::getVersionString() {
|
||||
LTOCodeGenerator::LTOCodeGenerator()
|
||||
: Context(getGlobalContext()), Linker(new Module("ld-temp.o", Context)),
|
||||
TargetMach(NULL), EmitDwarfDebugInfo(false), ScopeRestrictionsDone(false),
|
||||
CodeModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC),
|
||||
InternalizeStrategy(LTO_INTERNALIZE_FULL), NativeObjectFile(NULL) {
|
||||
CodeModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC), NativeObjectFile(NULL) {
|
||||
initializeLTOPasses();
|
||||
}
|
||||
|
||||
@ -165,18 +164,6 @@ void LTOCodeGenerator::setCodePICModel(lto_codegen_model model) {
|
||||
llvm_unreachable("Unknown PIC model!");
|
||||
}
|
||||
|
||||
void
|
||||
LTOCodeGenerator::setInternalizeStrategy(lto_internalize_strategy Strategy) {
|
||||
switch (Strategy) {
|
||||
case LTO_INTERNALIZE_FULL:
|
||||
case LTO_INTERNALIZE_NONE:
|
||||
case LTO_INTERNALIZE_HIDDEN:
|
||||
InternalizeStrategy = Strategy;
|
||||
return;
|
||||
}
|
||||
llvm_unreachable("Unknown internalize strategy!");
|
||||
}
|
||||
|
||||
bool LTOCodeGenerator::writeMergedModules(const char *path,
|
||||
std::string &errMsg) {
|
||||
if (!determineTarget(errMsg))
|
||||
@ -390,7 +377,7 @@ static void accumulateAndSortLibcalls(std::vector<StringRef> &Libcalls,
|
||||
}
|
||||
|
||||
void LTOCodeGenerator::applyScopeRestrictions() {
|
||||
if (ScopeRestrictionsDone || !shouldInternalize())
|
||||
if (ScopeRestrictionsDone)
|
||||
return;
|
||||
Module *mergedModule = Linker.getModule();
|
||||
|
||||
@ -442,8 +429,7 @@ void LTOCodeGenerator::applyScopeRestrictions() {
|
||||
LLVMCompilerUsed->setSection("llvm.metadata");
|
||||
}
|
||||
|
||||
passes.add(
|
||||
createInternalizePass(MustPreserveList, shouldOnlyInternalizeHidden()));
|
||||
passes.add(createInternalizePass(MustPreserveList));
|
||||
|
||||
// apply scope restrictions
|
||||
passes.run(*mergedModule);
|
||||
|
Reference in New Issue
Block a user