Use createRecordFwdDecl here since that's what we're doing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149051 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 6a775cc..2ddfd31 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -1147,15 +1147,8 @@
// If this is just a forward declaration, construct an appropriately
// marked node and just return it.
- if (!RD->getDefinition()) {
- llvm::DIType FwdDecl =
- DBuilder.createStructType(RDContext, RDName,
- DefUnit, Line, 0, 0,
- llvm::DIDescriptor::FlagFwdDecl,
- llvm::DIArray());
-
- return FwdDecl;
- }
+ if (!RD->getDefinition())
+ return createRecordFwdDecl(RD, RDContext);
llvm::DIType FwdDecl = DBuilder.createTemporaryType(DefUnit);