From 235010a6d0b88ab109084bda2d7c51bd2ce891f3 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. llvm-svn: 192214 --- llvm/include/llvm/DebugInfo.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/llvm/include/llvm/DebugInfo.h b/llvm/include/llvm/DebugInfo.h index 506b84c49bf5..49b81e3944f5 100644 --- a/llvm/include/llvm/DebugInfo.h +++ b/llvm/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.