Even if a constant's evaluated value is used, emit debug info for the constant variable.
llvm-svn: 110660
This commit is contained in:
@@ -1284,3 +1284,17 @@ llvm::Value *CodeGenFunction::getEHCleanupDestSlot() {
|
||||
CreateTempAlloca(Builder.getInt32Ty(), "eh.cleanup.dest.slot");
|
||||
return EHCleanupDest;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user