diff options
author | Devang Patel <dpatel@apple.com> | 2010-08-10 07:24:25 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-08-10 07:24:25 +0000 |
commit | 8d308384a220c7dc81755c47cdcbdd87dac25d5b (patch) | |
tree | 375ad9e9469e9377ce793ec7b2fd4f893fe36bf6 /lib/CodeGen/CGDebugInfo.cpp | |
parent | bf87f2c1c6e2d8cb50902a6d79e8b170c19570d2 (diff) |
Even if a constant's evaluated value is used, emit debug info for the constant variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110660 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index c54196cc27..5ec68c0ff0 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/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 |