summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2014-01-21 18:42:27 +0000
committerAdrian Prantl <aprantl@apple.com>2014-01-21 18:42:27 +0000
commit3eff225a444c2ebb170b7d39e73e469f0961392b (patch)
treec9906d2322d1d593414c80bda72abe50e2a208b1 /clang/lib/CodeGen
parenta88d7abeb1edc9029f27d35e89ea4eb3dc6f49f0 (diff)
downloadbcm5719-llvm-3eff225a444c2ebb170b7d39e73e469f0961392b.tar.gz
bcm5719-llvm-3eff225a444c2ebb170b7d39e73e469f0961392b.zip
Debug info: use the file a typedef is defined in as its decl_file instead
of the current compilation unit. As a side effect this enables many more LTO uniquing opportunities. This reapplies r199757 with a better testcase. llvm-svn: 199760
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index faf6fbba1a4..ff17a03dccd 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -739,14 +739,16 @@ llvm::DIType CGDebugInfo::CreateType(const TypedefType *Ty, llvm::DIFile Unit) {
return llvm::DIType();
// We don't set size information, but do specify where the typedef was
// declared.
- unsigned Line = getLineNumber(Ty->getDecl()->getLocation());
+ SourceLocation Loc = Ty->getDecl()->getLocation();
+ llvm::DIFile File = getOrCreateFile(Loc);
+ unsigned Line = getLineNumber(Loc);
const TypedefNameDecl *TyDecl = Ty->getDecl();
llvm::DIDescriptor TypedefContext =
getContextDescriptor(cast<Decl>(Ty->getDecl()->getDeclContext()));
return
- DBuilder.createTypedef(Src, TyDecl->getName(), Unit, Line, TypedefContext);
+ DBuilder.createTypedef(Src, TyDecl->getName(), File, Line, TypedefContext);
}
llvm::DIType CGDebugInfo::CreateType(const FunctionType *Ty,
OpenPOWER on IntegriCloud