From 492b1020a7f9e34591843768cdf89af0ad4a7024 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Thu, 15 Aug 2013 21:21:19 +0000 Subject: [PATCH] DebugInfo: Add a FIXME, remove a FIXME. (the removed FIXME no longer applies since we made this debug info optimization not apply to C) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188491 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGDebugInfo.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 94f1bde38d..6ba0bac2f5 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1430,9 +1430,6 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty, bool Declaration) { // safely be replaced by a forward declaration in the source code. if (DebugKind <= CodeGenOptions::LimitedDebugInfo && Declaration && !RD->isCompleteDefinitionRequired() && CGM.getLangOpts().CPlusPlus) { - // FIXME: This implementation is problematic; there are some test - // cases where we violate the above principle, such as - // test/CodeGen/debug-info-records.c . llvm::DIDescriptor FDContext = getContextDescriptor(cast(RD->getDeclContext())); llvm::DIType RetTy = getOrCreateRecordFwdDecl(RD, FDContext); @@ -1999,6 +1996,10 @@ llvm::DIType CGDebugInfo::getOrCreateType(QualType Ty, llvm::DIFile Unit, // And update the type cache. TypeCache[TyPtr] = Res; + // FIXME: this getTypeOrNull call seems silly when we just inserted the type + // into the cache - but getTypeOrNull has a special case for cached interface + // types. We should probably just pull that out as a special case for the + // "else" block below & skip the otherwise needless lookup. llvm::DIType TC = getTypeOrNull(Ty); if (TC && TC.isForwardDecl()) ReplaceMap.push_back(std::make_pair(TyPtr, static_cast(TC))); -- 2.40.0