[cfe-commits] r116060 - /cfe/trunk/lib/CodeGen/CGExprScalar.cpp

Devang Patel dpatel at apple.com
Fri Oct 8 10:02:40 PDT 2010


Author: dpatel
Date: Fri Oct  8 12:02:40 2010
New Revision: 116060

URL: http://llvm.org/viewvc/llvm-project?rev=116060&view=rev
Log:
Do not repeat debug info for file variable constants.
This is tested by file-statics.exp in gdb testsuite.

Modified:
    cfe/trunk/lib/CodeGen/CGExprScalar.cpp

Modified: cfe/trunk/lib/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprScalar.cpp?rev=116060&r1=116059&r2=116060&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Fri Oct  8 12:02:40 2010
@@ -165,7 +165,11 @@
       assert(!Result.HasSideEffects && "Constant declref with side-effect?!");
       llvm::ConstantInt *CI 
         = llvm::ConstantInt::get(VMContext, Result.Val.getInt());
-      CGF.EmitDeclRefExprDbgValue(E, CI);
+      if (VarDecl *VD = dyn_cast<VarDecl>((E->getDecl()))) {
+        if (!VD->isFileVarDecl()) {
+          CGF.EmitDeclRefExprDbgValue(E, CI);
+        }
+      }
       return CI;
     }
     return EmitLoadOfLValue(E);





More information about the cfe-commits mailing list