diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-13 07:30:49 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-13 07:30:49 +0000 |
commit | 25d8ed3773e9955b8b12ffa831e72a11af060ca5 (patch) | |
tree | 53acc8190202645da8f4d3185766eb5e2cc6761e /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | |
parent | 2b630fe82229b1ac8346a8ffb69c693804fc298b (diff) | |
download | bcm5719-llvm-25d8ed3773e9955b8b12ffa831e72a11af060ca5.tar.gz bcm5719-llvm-25d8ed3773e9955b8b12ffa831e72a11af060ca5.zip |
remove uses of deprecated functions, this generates slightly
different BlockAddress labels, but nothing semantically important.
Add a FIXME that BlockAddress codegen is broken if the LLVM BB has
an empty name (e.g. strip was run).
llvm-svn: 93303
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 64f49c46922..eb732372c45 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -1677,14 +1677,15 @@ MCSymbol *AsmPrinter::GetBlockAddressSymbol(const Function *F, // This code must use the function name itself, and not the function number, // since it must be possible to generate the label name from within other // functions. - std::string FuncName = Mang->getMangledName(F); + SmallString<60> FnName; + Mang->getNameWithPrefix(FnName, F, false); + // FIXME: THIS IS BROKEN IF THE LLVM BASIC BLOCK DOESN'T HAVE A NAME! SmallString<60> NameResult; - raw_svector_ostream(NameResult) << MAI->getPrivateGlobalPrefix() << "BA" - << FuncName.size() << '_' << FuncName << '_'; - Mang->getNameWithPrefix(NameResult, BB->getName()); - if (Suffix[0]) - NameResult += Suffix; + Mang->getNameWithPrefix(NameResult, + StringRef("BA") + Twine((unsigned)FnName.size()) + + "_" + FnName.str() + "_" + BB->getName() + Suffix, + Mangler::Private); return OutContext.GetOrCreateSymbol(NameResult.str()); } |