aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-08-10 17:53:33 +0000
committerDevang Patel <dpatel@apple.com>2010-08-10 17:53:33 +0000
commit25c2c8fb9309050612009a6571e2660e75531348 (patch)
treed57ba46aeba697acab9e6927ab31a081c4e19a1d /lib/CodeGen/CodeGenFunction.cpp
parent9d5600a8349cdda4e4971ebbbf7aa15a9da8bba7 (diff)
Simplify code and add comments, in code that generate debug info for constant integer globals, based on Chris's feedback.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110694 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index f992aa72e2..f883bec4ff 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -1286,15 +1286,8 @@ llvm::Value *CodeGenFunction::getEHCleanupDestSlot() {
}
void CodeGenFunction::EmitDeclRefExprDbgValue(const DeclRefExpr *E,
- const APValue &AV) {
- CGDebugInfo *Dbg = getDebugInfo();
- if (!Dbg) return;
-
- llvm::Constant *C = NULL;
- if (AV.isInt())
- C = llvm::ConstantInt::get(getLLVMContext(), AV.getInt());
- else if (AV.isFloat())
- C = llvm::ConstantFP::get(getLLVMContext(), AV.getFloat());
- if (C)
- Dbg->EmitGlobalVariable(C, E->getDecl(), Builder);
+ llvm::ConstantInt *Init) {
+ assert (Init && "Invalid DeclRefExpr initializer!");
+ if (CGDebugInfo *Dbg = getDebugInfo())
+ Dbg->EmitGlobalVariable(E->getDecl(), Init, Builder);
}