aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index a3cd4f4c29..f992aa72e2 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -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);
+}