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 | 2f8cc26be403262703ba00658d45e5adf7bdb514 (patch) | |
tree | 5873f357587809096cd295c7e87dda382e1d6131 /lib/CodeGen | |
parent | dfbcb8c38bb1637289801f37bb22cb7065891611 (diff) | |
download | external_llvm-2f8cc26be403262703ba00658d45e5adf7bdb514.zip external_llvm-2f8cc26be403262703ba00658d45e5adf7bdb514.tar.gz external_llvm-2f8cc26be403262703ba00658d45e5adf7bdb514.tar.bz2 |
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).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93303 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 64f49c4..eb73237 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/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()); } |