summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-08-10 07:24:25 +0000
committerDevang Patel <dpatel@apple.com>2010-08-10 07:24:25 +0000
commite03edfd3e7d883bb671fb3cd5ca94ffb470e5cfa (patch)
tree099dae5eb9cf57beea7ced4b01dc9d2be27dbf67 /clang/lib/CodeGen/CGDebugInfo.cpp
parentb219746c80be195e914d6f620427217818476ba8 (diff)
downloadbcm5719-llvm-e03edfd3e7d883bb671fb3cd5ca94ffb470e5cfa.tar.gz
bcm5719-llvm-e03edfd3e7d883bb671fb3cd5ca94ffb470e5cfa.zip
Even if a constant's evaluated value is used, emit debug info for the constant variable.
llvm-svn: 110660
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index c54196cc27e..5ec68c0ff00 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1801,6 +1801,17 @@ void CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable *Var,
true/*definition*/, Var);
}
+void CGDebugInfo::EmitGlobalVariable(llvm::Constant *C, const ValueDecl *VD,
+ CGBuilderTy &Builder) {
+ // Create the descriptor for the variable.
+ llvm::DIFile Unit = getOrCreateFile(VD->getLocation());
+ llvm::StringRef Name = VD->getName();
+ DebugFactory.CreateGlobalVariable(Unit, Name, Name, Name, Unit,
+ getLineNumber(VD->getLocation()),
+ getOrCreateType(VD->getType(), Unit),
+ true, true, C);
+}
+
/// getOrCreateNamesSpace - Return namespace descriptor for the given
/// namespace decl.
llvm::DINameSpace
OpenPOWER on IntegriCloud