diff options
author | Devang Patel <dpatel@apple.com> | 2010-08-10 17:53:33 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-08-10 17:53:33 +0000 |
commit | dc866e119c2ac6ab3e6227af64e60bc7dccead42 (patch) | |
tree | 861544a1ffb15a79224ed306ba772bea7b826800 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | ce25f33e2a825c9260c834f029ff206672645d7c (diff) | |
download | bcm5719-llvm-dc866e119c2ac6ab3e6227af64e60bc7dccead42.tar.gz bcm5719-llvm-dc866e119c2ac6ab3e6227af64e60bc7dccead42.zip |
Simplify code and add comments, in code that generate debug info for constant integer globals, based on Chris's feedback.
llvm-svn: 110694
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index f992aa72e2e..f883bec4ff5 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/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); } |