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 /include | |
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 'include')
-rw-r--r-- | include/llvm/IR/GlobalValue.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/IR/GlobalValue.h b/include/llvm/IR/GlobalValue.h index 260302a..1dc99cf 100644 --- a/include/llvm/IR/GlobalValue.h +++ b/include/llvm/IR/GlobalValue.h @@ -239,6 +239,15 @@ public: /// create a GlobalValue) from the GlobalValue Src to this one. virtual void copyAttributesFrom(const GlobalValue *Src); + /// 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 Name) { + if (!Name.empty() && Name[0] == '\1') + return Name.substr(1); + return Name; + } + /// @name Materialization /// Materialization is used to construct functions only as they're needed. This /// is useful to reduce memory usage in LLVM or parsing work done by the |