diff options
| author | Devang Patel <dpatel@apple.com> | 2010-01-29 22:29:31 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2010-01-29 22:29:31 +0000 |
| commit | bb4820dc8e079c7276b3cfed5664fe57720e14cf (patch) | |
| tree | 2cbb0a71afd3ec6dcf69f89caf797702ed69c250 | |
| parent | 2bf486eb14380025cdb3c5435399f571af81507f (diff) | |
| download | bcm5719-llvm-bb4820dc8e079c7276b3cfed5664fe57720e14cf.tar.gz bcm5719-llvm-bb4820dc8e079c7276b3cfed5664fe57720e14cf.zip | |
Use appropriate context for typedefs.
llvm-svn: 94849
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index ac3d5bd3b46..b0f2c0fa429 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/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; } |

