Simplify code and add comments, in code that generate debug info for constant integer globals, based on Chris's feedback.

llvm-svn: 110694
This commit is contained in:
Devang Patel
2010-08-10 17:53:33 +00:00
parent ce25f33e2a
commit dc866e119c
5 changed files with 15 additions and 18 deletions

View File

@@ -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);
}