summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-10-14 22:22:17 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-10-14 22:22:17 +0000
commit8e707bb47635643e8c5e713728c8f9780651252c (patch)
tree8462e0ad7e50dc966df554d62eb386bc34788d7c /clang/lib/CodeGen/CGDebugInfo.cpp
parent147cd2f6e5128f4ad07a862458cfe6c1e31ce8e2 (diff)
downloadbcm5719-llvm-8e707bb47635643e8c5e713728c8f9780651252c.tar.gz
bcm5719-llvm-8e707bb47635643e8c5e713728c8f9780651252c.zip
DebugInfo: Lazily built static member variable declarations should use the canonical declaration for line/file information.
When lazily constructing static member variable declarations (when the vtable optimization fires and the definition of the type is omitted (or built later, lazily), but the out of line definition of the static member is provided and must be described in debug info) ensure we use the canonical declaration when computing the file, line, etc for that declaration (rather than the definition, which is also a declaration, but not the canonical one). llvm-svn: 219736
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 025bdfaed0e..512db76a841 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -895,6 +895,7 @@ CGDebugInfo::CreateRecordStaticField(const VarDecl *Var,
const RecordDecl* RD) {
// Create the descriptor for the static variable, with or without
// constant initializers.
+ Var = Var->getCanonicalDecl();
llvm::DIFile VUnit = getOrCreateFile(Var->getLocation());
llvm::DIType VTy = getOrCreateType(Var->getType(), VUnit);
OpenPOWER on IntegriCloud