diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-05-14 00:34:20 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-05-14 00:34:20 +0000 |
commit | 11ecabf4eb468a4628b58a120bbb8fb2d306ba02 (patch) | |
tree | f6f56c88d3bbc2f68028e453307f3ec7631125e7 /clang/lib/CodeGen | |
parent | 2e7a922a155185f297343d64675dade9c38dc8a4 (diff) | |
download | bcm5719-llvm-11ecabf4eb468a4628b58a120bbb8fb2d306ba02.tar.gz bcm5719-llvm-11ecabf4eb468a4628b58a120bbb8fb2d306ba02.zip |
PR15956: Debug Info: Include the appropriate file location in types created due to using declarations
We might benefit from API refactoring here (why pass in a value that's
derived from another parameter?) but this is the immediate issue.
llvm-svn: 181747
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 583b23980e7..f6ad8f2cc59 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -2178,8 +2178,10 @@ llvm::DIDescriptor CGDebugInfo::getDeclarationOrDefinition(const Decl *D) { // we would otherwise do to get a type for a pointee. (forward declarations in // limited debug info, full definitions (if the type definition is available) // in unlimited debug info) - if (const TypeDecl *RD = dyn_cast<TypeDecl>(D)) - return CreatePointeeType(QualType(RD->getTypeForDecl(), 0), llvm::DIFile()); + if (const TypeDecl *TD = dyn_cast<TypeDecl>(D)) { + llvm::DIFile DefUnit = getOrCreateFile(TD->getLocation()); + return CreatePointeeType(CGM.getContext().getTypeDeclType(TD), DefUnit); + } // Otherwise fall back to a fairly rudimentary cache of existing declarations. // This doesn't handle providing declarations (for functions or variables) for // entities without definitions in this TU, nor when the definition proceeds |