[cfe-commits] r94849 - /cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
Devang Patel
dpatel at apple.com
Fri Jan 29 14:29:32 PST 2010
Author: dpatel
Date: Fri Jan 29 16:29:31 2010
New Revision: 94849
URL: http://llvm.org/viewvc/llvm-project?rev=94849&view=rev
Log:
Use appropriate context for typedefs.
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=94849&r1=94848&r2=94849&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Jan 29 16:29:31 2010
@@ -414,17 +414,15 @@
// 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;
}
More information about the cfe-commits
mailing list