From d88ccb6480b65d7560bfc840b689fbc8f36501bf Mon Sep 17 00:00:00 2001 From: Manman Ren Date: Tue, 8 Oct 2013 18:42:03 +0000 Subject: [PATCH] Move DIRef::getName out of line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192214 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/DebugInfo.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/include/llvm/DebugInfo.h b/include/llvm/DebugInfo.h index 506b84c49bf..49b81e3944f 100644 --- a/include/llvm/DebugInfo.h +++ b/include/llvm/DebugInfo.h @@ -230,16 +230,7 @@ template class DIRef { public: T resolve(const DITypeIdentifierMap &Map) const; - StringRef getName() const { - if (!Val) - return StringRef(); - - if (const MDNode *MD = dyn_cast(Val)) - return T(MD).getName(); - - const MDString *MS = cast(Val); - return MS->getString(); - } + StringRef getName() const; operator Value *() const { return const_cast(Val); } }; @@ -260,6 +251,18 @@ T DIRef::resolve(const DITypeIdentifierMap &Map) const { return T(Iter->second); } +template +StringRef DIRef::getName() const { + if (!Val) + return StringRef(); + + if (const MDNode *MD = dyn_cast(Val)) + return T(MD).getName(); + + const MDString *MS = cast(Val); + return MS->getString(); +} + /// Specialize getFieldAs to handle fields that are references to DIScopes. template <> DIScopeRef DIDescriptor::getFieldAs(unsigned Elt) const; /// Specialize DIRef constructor for DIScopeRef. -- 2.34.1