[llvm] r228852 - Generalize DIBuilder's createReplaceableForwardDecl() to a more flexible

Adrian Prantl aprantl at apple.com
Wed Feb 11 09:45:05 PST 2015


Author: adrian
Date: Wed Feb 11 11:45:05 2015
New Revision: 228852

URL: http://llvm.org/viewvc/llvm-project?rev=228852&view=rev
Log:
Generalize DIBuilder's createReplaceableForwardDecl() to a more flexible
createReplaceableCompositeType() that allows to create non-forward-declared
temporary nodes.

Paired commit with CFE.

Modified:
    llvm/trunk/include/llvm/IR/DIBuilder.h
    llvm/trunk/lib/IR/DIBuilder.cpp

Modified: llvm/trunk/include/llvm/IR/DIBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DIBuilder.h?rev=228852&r1=228851&r2=228852&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DIBuilder.h (original)
+++ llvm/trunk/include/llvm/IR/DIBuilder.h Wed Feb 11 11:45:05 2015
@@ -440,10 +440,11 @@ namespace llvm {
                                       StringRef UniqueIdentifier = StringRef());
 
     /// \brief Create a temporary forward-declared type.
-    DICompositeType createReplaceableForwardDecl(
+    DICompositeType createReplaceableCompositeType(
         unsigned Tag, StringRef Name, DIDescriptor Scope, DIFile F,
         unsigned Line, unsigned RuntimeLang = 0, uint64_t SizeInBits = 0,
-        uint64_t AlignInBits = 0, StringRef UniqueIdentifier = StringRef());
+        uint64_t AlignInBits = 0, unsigned Flags = DIDescriptor::FlagFwdDecl,
+        StringRef UniqueIdentifier = StringRef());
 
     /// retainType - Retain DIType in a module even if it is not referenced
     /// through debug info anchors.

Modified: llvm/trunk/lib/IR/DIBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=228852&r1=228851&r2=228852&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DIBuilder.cpp (original)
+++ llvm/trunk/lib/IR/DIBuilder.cpp Wed Feb 11 11:45:05 2015
@@ -816,10 +816,10 @@ DIBuilder::createForwardDecl(unsigned Ta
   return RetTy;
 }
 
-DICompositeType DIBuilder::createReplaceableForwardDecl(
+DICompositeType DIBuilder::createReplaceableCompositeType(
     unsigned Tag, StringRef Name, DIDescriptor Scope, DIFile F, unsigned Line,
     unsigned RuntimeLang, uint64_t SizeInBits, uint64_t AlignInBits,
-    StringRef UniqueIdentifier) {
+    unsigned Flags, StringRef UniqueIdentifier) {
   // Create a temporary MDNode.
   Metadata *Elts[] = {
       HeaderBuilder::get(Tag)
@@ -828,7 +828,7 @@ DICompositeType DIBuilder::createReplace
           .concat(SizeInBits)
           .concat(AlignInBits)
           .concat(0) // Offset
-          .concat(DIDescriptor::FlagFwdDecl)
+          .concat(Flags)
           .concat(RuntimeLang)
           .get(VMContext),
       F.getFileNode(), DIScope(getNonCompileUnitScope(Scope)).getRef(), nullptr,





More information about the llvm-commits mailing list