]> granicus.if.org Git - clang/commitdiff
Use appropriate context for typedefs.
authorDevang Patel <dpatel@apple.com>
Fri, 29 Jan 2010 22:29:31 +0000 (22:29 +0000)
committerDevang Patel <dpatel@apple.com>
Fri, 29 Jan 2010 22:29:31 +0000 (22:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94849 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index ac3d5bd3b4671daec5db243c8f86f601fb424707..b0f2c0fa4298eabc5bd7ddbefd08359f1a980fc9 100644 (file)
@@ -414,17 +414,15 @@ llvm::DIType CGDebugInfo::CreateType(const TypedefType *Ty,
 
   // We don't set size information, but do specify where the typedef was
   // declared.
-  SourceLocation DefLoc = Ty->getDecl()->getLocation();
-  llvm::DICompileUnit DefUnit = getOrCreateCompileUnit(DefLoc);
-
   SourceManager &SM = CGM.getContext().getSourceManager();
-  PresumedLoc PLoc = SM.getPresumedLoc(DefLoc);
+  PresumedLoc PLoc = SM.getPresumedLoc(Ty->getDecl()->getLocation());
   unsigned Line = PLoc.isInvalid() ? 0 : PLoc.getLine();
 
   llvm::DIType DbgTy = 
-    DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_typedef, Unit,
-                                   Ty->getDecl()->getName(),
-                                   DefUnit, Line, 0, 0, 0, 0, Src);
+    DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_typedef, 
+                                   getContextDescriptor(Ty->getDecl(), Unit), 
+                                   Ty->getDecl()->getName(), Unit,
+                                   Line, 0, 0, 0, 0, Src);
   return DbgTy;
 }