aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-01-29 22:29:31 +0000
committerDevang Patel <dpatel@apple.com>2010-01-29 22:29:31 +0000
commitd528905966546edaabbf90d88c8d754faf961d8a (patch)
tree30704a4f1dfb9dea594bf485d03183be327c5821 /lib/CodeGen/CGDebugInfo.cpp
parent4a5290e773e70ec2c3b4353a3a4aa7d1a3e3cd66 (diff)
Use appropriate context for typedefs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94849 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index ac3d5bd3b4..b0f2c0fa42 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -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;
}