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
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index f992aa7..f883bec 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -1286,15 +1286,8 @@
 }
 
 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);
 }