diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-06-01 17:51:14 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-06-01 17:51:14 +0000 |
commit | 7c2b4be2a718b994298803dd09e81e49a016ffb2 (patch) | |
tree | b81f65831b3525343f2557fbe31a8f44495c3288 /lib/Transforms | |
parent | 6dd56e60b002e5f3317bcc461be7fb8f6b19bbf5 (diff) | |
download | external_llvm-7c2b4be2a718b994298803dd09e81e49a016ffb2.zip external_llvm-7c2b4be2a718b994298803dd09e81e49a016ffb2.tar.gz external_llvm-7c2b4be2a718b994298803dd09e81e49a016ffb2.tar.bz2 |
Move getRealLinkageName to a common place and remove all the duplicates of it.
Also simplify code a bit while there. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183076 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/IPO/StripSymbols.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/lib/Transforms/IPO/StripSymbols.cpp b/lib/Transforms/IPO/StripSymbols.cpp index 3396f79..754eff6 100644 --- a/lib/Transforms/IPO/StripSymbols.cpp +++ b/lib/Transforms/IPO/StripSymbols.cpp @@ -332,16 +332,6 @@ bool StripDebugDeclare::runOnModule(Module &M) { return true; } -/// getRealLinkageName - If special LLVM prefix that is used to inform the asm -/// printer to not emit usual symbol prefix before the symbol name is used then -/// return linkage name after skipping this special LLVM prefix. -static StringRef getRealLinkageName(StringRef LinkageName) { - char One = '\1'; - if (LinkageName.startswith(StringRef(&One, 1))) - return LinkageName.substr(1); - return LinkageName; -} - bool StripDeadDebugInfo::runOnModule(Module &M) { bool Changed = false; @@ -401,9 +391,8 @@ bool StripDeadDebugInfo::runOnModule(Module &M) { StringRef FName = DISubprogram(*I).getLinkageName(); if (FName.empty()) FName = DISubprogram(*I).getName(); - if (NamedMDNode *LVNMD = - M.getNamedMetadata(Twine("llvm.dbg.lv.", - getRealLinkageName(FName)))) + if (NamedMDNode *LVNMD = M.getNamedMetadata( + "llvm.dbg.lv." + Function::getRealLinkageName(FName))) LVNMD->eraseFromParent(); } } |