[cfe-commits] r88952 - /cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Eli Friedman eli.friedman at gmail.com
Mon Nov 16 12:33:31 PST 2009


Author: efriedma
Date: Mon Nov 16 14:33:31 2009
New Revision: 88952

URL: http://llvm.org/viewvc/llvm-project?rev=88952&view=rev
Log:
Fix valgrind uninitialized error.


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

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=88952&r1=88951&r2=88952&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Nov 16 14:33:31 2009
@@ -1123,11 +1123,13 @@
   SourceManager &SM = M->getContext().getSourceManager();
   PresumedLoc PLoc = SM.getPresumedLoc(Decl->getLocation());
   unsigned Line = 0;
-  if (!PLoc.isInvalid())
+  unsigned Column = 0;
+  if (!PLoc.isInvalid()) {
     Line = PLoc.getLine();
-  else
+    Column = PLoc.getColumn();
+  } else {
     Unit = llvm::DICompileUnit();
-
+  }
 
   // Create the descriptor for the variable.
   llvm::DIVariable D =
@@ -1141,7 +1143,7 @@
   llvm::DIScope DS(RegionStack.back());
   llvm::DILocation DO(NULL);
   llvm::DILocation DL = 
-    DebugFactory.CreateLocation(Line, PLoc.getColumn(), DS, DO);
+    DebugFactory.CreateLocation(Line, Column, DS, DO);
   Builder.SetDebugLocation(Call, DL.getNode());
 }
 





More information about the cfe-commits mailing list