DebugInfo: Revert change to the return type of createRecordFwdDecl
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 15 Aug 2013 20:17:25 +0000 (20:17 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 15 Aug 2013 20:17:25 +0000 (20:17 +0000)
It still does only return DICompositeType, but I've no need to make that
change right now.

llvm-svn: 188482

clang/lib/CodeGen/CGDebugInfo.cpp
clang/lib/CodeGen/CGDebugInfo.h

index 81354b86cab5dd18e22519ed265656e69bae6f99..5ac4a5dccbf1b862cb86efb75377c7d2919cf3b9 100644 (file)
@@ -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());
index 3a0d07f2a8c4ce88c02136b2930d6e12f0878070..74b8e95999305e8f4a01d6b38aa5c1d89d032931 100644 (file)
@@ -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);