mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 06:25:18 +00:00
Fix some memory leaks and avoid looking in the hash tables twice.
libxul links in 7m0.403s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126085 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -357,7 +357,7 @@ void LTOCodeGenerator::applyScopeRestrictions() {
|
||||
mangler.getNameWithPrefix(Buffer, f, false);
|
||||
if (!f->isDeclaration() &&
|
||||
_mustPreserveSymbols.count(Buffer))
|
||||
mustPreserveList.push_back(::strdup(f->getNameStr().c_str()));
|
||||
mustPreserveList.push_back(f->getName().data());
|
||||
}
|
||||
for (Module::global_iterator v = mergedModule->global_begin(),
|
||||
e = mergedModule->global_end(); v != e; ++v) {
|
||||
@@ -365,7 +365,7 @@ void LTOCodeGenerator::applyScopeRestrictions() {
|
||||
mangler.getNameWithPrefix(Buffer, v, false);
|
||||
if (!v->isDeclaration() &&
|
||||
_mustPreserveSymbols.count(Buffer))
|
||||
mustPreserveList.push_back(::strdup(v->getNameStr().c_str()));
|
||||
mustPreserveList.push_back(v->getName().data());
|
||||
}
|
||||
for (Module::alias_iterator a = mergedModule->alias_begin(),
|
||||
e = mergedModule->alias_end(); a != e; ++a) {
|
||||
@@ -373,7 +373,7 @@ void LTOCodeGenerator::applyScopeRestrictions() {
|
||||
mangler.getNameWithPrefix(Buffer, a, false);
|
||||
if (!a->isDeclaration() &&
|
||||
_mustPreserveSymbols.count(Buffer))
|
||||
mustPreserveList.push_back(::strdup(a->getNameStr().c_str()));
|
||||
mustPreserveList.push_back(a->getName().data());
|
||||
}
|
||||
passes.add(createInternalizePass(mustPreserveList));
|
||||
}
|
||||
@@ -441,6 +441,7 @@ bool LTOCodeGenerator::generateAssemblyCode(raw_ostream& out,
|
||||
codeGenPasses->run(*it);
|
||||
|
||||
codeGenPasses->doFinalization();
|
||||
delete codeGenPasses;
|
||||
|
||||
return false; // success
|
||||
}
|
||||
|
Reference in New Issue
Block a user