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
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 94f1bde..6ba0bac 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -1430,9 +1430,6 @@
// 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<Decl>(RD->getDeclContext()));
llvm::DIType RetTy = getOrCreateRecordFwdDecl(RD, FDContext);
@@ -1999,6 +1996,10 @@
// 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<llvm::Value*>(TC)));