From c5cd1a712eb98852ae73f027414d06be85dafff6 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Thu, 15 Aug 2013 20:17:25 +0000 Subject: [PATCH] DebugInfo: Revert change to the return type of createRecordFwdDecl It still does only return DICompositeType, but I've no need to make that change right now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188482 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGDebugInfo.cpp | 8 +++----- lib/CodeGen/CGDebugInfo.h | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 81354b86ca..5ac4a5dccb 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -602,11 +602,9 @@ llvm::DIType CGDebugInfo::CreateType(const PointerType *Ty, } // Creates a forward declaration for a RecordDecl in the given context. -llvm::DICompositeType -CGDebugInfo::getOrCreateRecordFwdDecl(const RecordDecl *RD, - llvm::DIDescriptor Ctx) { - llvm::DICompositeType T(getTypeOrNull(CGM.getContext().getRecordType(RD))); - if (T) +llvm::DIType CGDebugInfo::getOrCreateRecordFwdDecl(const RecordDecl *RD, + llvm::DIDescriptor Ctx) { + if (llvm::DIType T = getTypeOrNull(CGM.getContext().getRecordType(RD))) return T; llvm::DIFile DefUnit = getOrCreateFile(RD->getLocation()); unsigned Line = getLineNumber(RD->getLocation()); diff --git a/lib/CodeGen/CGDebugInfo.h b/lib/CodeGen/CGDebugInfo.h index 3a0d07f2a8..74b8e95999 100644 --- a/lib/CodeGen/CGDebugInfo.h +++ b/lib/CodeGen/CGDebugInfo.h @@ -306,8 +306,7 @@ private: llvm::DIScope getCurrentContextDescriptor(const Decl *Decl); /// \brief Create a forward decl for a RecordType in a given context. - llvm::DICompositeType getOrCreateRecordFwdDecl(const RecordDecl *, - llvm::DIDescriptor); + llvm::DIType getOrCreateRecordFwdDecl(const RecordDecl *, llvm::DIDescriptor); /// createContextChain - Create a set of decls for the context chain. llvm::DIDescriptor createContextChain(const Decl *Decl); -- 2.40.0