diff options
author | Manman Ren <manman.ren@gmail.com> | 2013-10-08 18:42:03 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2013-10-08 18:42:03 +0000 |
commit | d88ccb6480b65d7560bfc840b689fbc8f36501bf (patch) | |
tree | b11fcb90a928689bea1023d18a06a6755bfb950a /include | |
parent | 3e6a3becd5099bc922d166b1147995a03b3aeca8 (diff) | |
download | external_llvm-d88ccb6480b65d7560bfc840b689fbc8f36501bf.zip external_llvm-d88ccb6480b65d7560bfc840b689fbc8f36501bf.tar.gz external_llvm-d88ccb6480b65d7560bfc840b689fbc8f36501bf.tar.bz2 |
Move DIRef::getName out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192214 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/DebugInfo.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/include/llvm/DebugInfo.h b/include/llvm/DebugInfo.h index 506b84c..49b81e3 100644 --- a/include/llvm/DebugInfo.h +++ b/include/llvm/DebugInfo.h @@ -230,16 +230,7 @@ template <typename T> class DIRef { public: T resolve(const DITypeIdentifierMap &Map) const; - StringRef getName() const { - if (!Val) - return StringRef(); - - if (const MDNode *MD = dyn_cast<MDNode>(Val)) - return T(MD).getName(); - - const MDString *MS = cast<MDString>(Val); - return MS->getString(); - } + StringRef getName() const; operator Value *() const { return const_cast<Value *>(Val); } }; @@ -260,6 +251,18 @@ T DIRef<T>::resolve(const DITypeIdentifierMap &Map) const { return T(Iter->second); } +template <typename T> +StringRef DIRef<T>::getName() const { + if (!Val) + return StringRef(); + + if (const MDNode *MD = dyn_cast<MDNode>(Val)) + return T(MD).getName(); + + const MDString *MS = cast<MDString>(Val); + return MS->getString(); +} + /// Specialize getFieldAs to handle fields that are references to DIScopes. template <> DIScopeRef DIDescriptor::getFieldAs<DIScopeRef>(unsigned Elt) const; /// Specialize DIRef constructor for DIScopeRef. |