/// getNameWithPrefix - Return the name of the appropriate prefix
/// and the specified global variable's name. If the global variable doesn't
/// have a name, this fills in a unique name for the global.
- std::string getNameWithPrefix(const GlobalValue *GV,bool isImplicitlyPrivate);
+ std::string getNameWithPrefix(const GlobalValue *GV,
+ bool isImplicitlyPrivate = false);
private:
/// makeNameProper - We don't want identifier names with ., space, or
I != E; ++I) {
// Don't mangle asm names.
if (!I->hasName() || I->getName()[0] != 1)
- I->setName(Mang.getMangledName(I));
+ I->setName(Mang.getNameWithPrefix(I));
}
for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) {
// Don't mangle asm names or intrinsics.
if ((!I->hasName() || I->getName()[0] != 1) &&
I->getIntrinsicID() == 0)
- I->setName(Mang.getMangledName(I));
+ I->setName(Mang.getNameWithPrefix(I));
}
}
for (Module::iterator f = mergedModule->begin(),
e = mergedModule->end(); f != e; ++f) {
if ( !f->isDeclaration()
- && _mustPreserveSymbols.count(mangler.getMangledName(f)) )
+ && _mustPreserveSymbols.count(mangler.getNameWithPrefix(f)) )
mustPreserveList.push_back(::strdup(f->getNameStr().c_str()));
}
for (Module::global_iterator v = mergedModule->global_begin(),
return;
// string is owned by _defines
- const char* symbolName = ::strdup(mangler.getMangledName(def).c_str());
+ const char* symbolName = ::strdup(mangler.getNameWithPrefix(def).c_str());
// set alignment part log2() can have rounding errors
uint32_t align = def->getAlignment();
if (isa<GlobalAlias>(decl))
return;
- std::string name = mangler.getMangledName(decl);
+ std::string name = mangler.getNameWithPrefix(decl);
// we already have the symbol
if (_undefines.find(name) != _undefines.end())