From 25c2c8fb9309050612009a6571e2660e75531348 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Tue, 10 Aug 2010 17:53:33 +0000 Subject: 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 --- lib/CodeGen/CodeGenFunction.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'lib/CodeGen/CodeGenFunction.cpp') 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); } -- cgit v1.2.3-18-g5258