Simplify some uses of Value::getName()

llvm-svn: 76786
This commit is contained in:
Daniel Dunbar 2009-07-22 21:10:12 +00:00
parent 4a6554006d
commit 99abb47dd6
3 changed files with 7 additions and 4 deletions

View File

@ -103,8 +103,8 @@ static ExFunc lookupFunction(const Function *F) {
if (FnPtr == 0)
FnPtr = FuncNames["lle_X_"+F->getName()];
if (FnPtr == 0) // Try calling a generic function... if it exists...
FnPtr = (ExFunc)(intptr_t)sys::DynamicLibrary::SearchForAddressOfSymbol(
("lle_X_"+F->getName()).c_str());
FnPtr = (ExFunc)(intptr_t)
sys::DynamicLibrary::SearchForAddressOfSymbol("lle_X_"+F->getName());
if (FnPtr != 0)
ExportedFunctions->insert(std::make_pair(F, FnPtr)); // Cache for later
return FnPtr;

View File

@ -1924,7 +1924,7 @@ bool CWriter::doInitialization(Module &M) {
Out << " __HIDDEN__";
if (I->hasName() && I->getName()[0] == 1)
Out << " LLVM_ASM(\"" << I->getName().c_str()+1 << "\")";
Out << " LLVM_ASM(\"" << I->getName().substr(1) << "\")";
Out << ";\n";
}

View File

@ -430,7 +430,10 @@ namespace {
} else {
name = getTypePrefix(val->getType());
}
name += (val->hasName() ? val->getName() : utostr(uniqueNum++));
if (val->hasName())
name += val->getName();
else
name += utostr(uniqueNum++);
sanitize(name);
NameSet::iterator NI = UsedNames.find(name);
if (NI != UsedNames.end())