Add support for runtime languages on our forward declarations.
authorEric Christopher <echristo@apple.com>
Mon, 20 Feb 2012 18:04:14 +0000 (18:04 +0000)
committerEric Christopher <echristo@apple.com>
Mon, 20 Feb 2012 18:04:14 +0000 (18:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150973 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/DIBuilder.h
lib/Analysis/DIBuilder.cpp

index 3785fa8c38f5ad26a2604a0e596c4064fc55d70c..5190f0a8319280262770efd5964b41ded6535fa6 100644 (file)
@@ -343,7 +343,7 @@ namespace llvm {
 
     /// createForwardDecl - Create a temporary forward-declared type.
     DIType createForwardDecl(unsigned Tag, StringRef Name, DIFile F,
-                             unsigned Line);
+                             unsigned Line, unsigned RuntimeLang = 0);
 
     /// retainType - Retain DIType in a module even if it is not referenced 
     /// through debug info anchors.
index 9dd99b62c2f3bbf7263c6d1ba47887d908b80da7..f0bdc48cf3c23a17bdf10b7fa5e9774940a1d575 100644 (file)
@@ -672,7 +672,7 @@ DIType DIBuilder::createTemporaryType(DIFile F) {
 /// createForwardDecl - Create a temporary forward-declared type that
 /// can be RAUW'd if the full type is seen.
 DIType DIBuilder::createForwardDecl(unsigned Tag, StringRef Name, DIFile F,
-                                    unsigned Line) {
+                                    unsigned Line, unsigned RuntimeLang) {
   // Create a temporary MDNode.
   Value *Elts[] = {
     GetTagConstant(VMContext, Tag),
@@ -685,7 +685,10 @@ DIType DIBuilder::createForwardDecl(unsigned Tag, StringRef Name, DIFile F,
     ConstantInt::get(Type::getInt32Ty(VMContext), 0),
     ConstantInt::get(Type::getInt32Ty(VMContext), 0),
     ConstantInt::get(Type::getInt32Ty(VMContext),
-                     DIDescriptor::FlagFwdDecl)
+                     DIDescriptor::FlagFwdDecl),
+    NULL,
+    DIArray(),
+    ConstantInt::get(Type::getInt32Ty(VMContext), RuntimeLang)
   };
   MDNode *Node = MDNode::getTemporary(VMContext, Elts);
   return DIType(Node);