A typedef's context is not the same as type's context. It is the context of typedef...
authorDevang Patel <dpatel@apple.com>
Fri, 3 Jun 2011 17:04:51 +0000 (17:04 +0000)
committerDevang Patel <dpatel@apple.com>
Fri, 3 Jun 2011 17:04:51 +0000 (17:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132556 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 5846dbff041a18d97f51b4de2864bceddae26063..96c6587ef3ea1382e55d304edf92c2c41816d0cb 100644 (file)
@@ -117,8 +117,9 @@ namespace llvm {
     /// @param Name        Typedef name.
     /// @param File        File where this type is defined.
     /// @param LineNo      Line number.
+    /// @param Context     The surrounding context for the typedef.
     DIType createTypedef(DIType Ty, StringRef Name, DIFile File, 
-                         unsigned LineNo);
+                         unsigned LineNo, DIDescriptor Context);
 
     /// createFriend - Create debugging information entry for a 'friend'.
     DIType createFriend(DIType Ty, DIType FriendTy);
index 1375e497ac675be4bf762f7934dfeac7321dceef..ef5d03a0713535b51e714a8b8c1bc22acc5b99e3 100644 (file)
@@ -160,12 +160,12 @@ DIType DIBuilder::createReferenceType(DIType RTy) {
 
 /// createTypedef - Create debugging information entry for a typedef.
 DIType DIBuilder::createTypedef(DIType Ty, StringRef Name, DIFile File,
-                                unsigned LineNo) {
+                                unsigned LineNo, DIDescriptor Context) {
   // typedefs are encoded in DIDerivedType format.
   assert(Ty.Verify() && "Invalid typedef type!");
   Value *Elts[] = {
     GetTagConstant(VMContext, dwarf::DW_TAG_typedef),
-    Ty.getContext(),
+    Context,
     MDString::get(VMContext, Name),
     File,
     ConstantInt::get(Type::getInt32Ty(VMContext), LineNo),