diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-11-16 20:33:31 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-11-16 20:33:31 +0000 |
commit | 1468ac71124bc689d95e07a048505a21e8980269 (patch) | |
tree | 9ae45eb90ba3ecb932fddf5bb41fae49d2927bcd /lib/CodeGen/CGDebugInfo.cpp | |
parent | ffffb03de0f6d7e162f461c03d954df50277a476 (diff) |
Fix valgrind uninitialized error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88952 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 0cd8f1bcd8..7aa720144c 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1123,11 +1123,13 @@ void CGDebugInfo::EmitDeclare(const VarDecl *Decl, unsigned Tag, 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 @@ void CGDebugInfo::EmitDeclare(const VarDecl *Decl, unsigned Tag, 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()); } |