summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2014-01-21 18:20:52 +0000
committerAdrian Prantl <aprantl@apple.com>2014-01-21 18:20:52 +0000
commit5f7dfbf84a9b8c55b1f372b8d41adb7d8e8ebff9 (patch)
tree7559b877bdaa9e24014ddcb616db2834ce3608bf /lib/CodeGen/CGDebugInfo.cpp
parent1b35da0f2f19184147eb892cc860f996879180bd (diff)
downloadclang-5f7dfbf84a9b8c55b1f372b8d41adb7d8e8ebff9.tar.gz
clang-5f7dfbf84a9b8c55b1f372b8d41adb7d8e8ebff9.tar.bz2
clang-5f7dfbf84a9b8c55b1f372b8d41adb7d8e8ebff9.tar.xz
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. rdar://problem/15851206 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199757 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index faf6fbba1a..ff17a03dcc 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/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,