diff options
author | Eric Christopher <echristo@gmail.com> | 2012-10-18 22:08:02 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2012-10-18 22:08:02 +0000 |
commit | 56b8a200e13db4d0377fb7ce88704d4eafa8067a (patch) | |
tree | 95106f27839a2c8524192663a3d05ce6e9071d9e /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | c7a4a2aa3356bc0551bd6685db118240168570c8 (diff) | |
download | bcm5719-llvm-56b8a200e13db4d0377fb7ce88704d4eafa8067a.tar.gz bcm5719-llvm-56b8a200e13db4d0377fb7ce88704d4eafa8067a.zip |
Fix up comment and invert order. Most simple check first.
llvm-svn: 166240
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index e6e7ecf5711..b183cdba27a 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -254,13 +254,15 @@ unsigned CGDebugInfo::getLineNumber(SourceLocation Loc) { return PLoc.isValid()? PLoc.getLine() : 0; } -/// getColumnNumber - Get column number for the location. If location is -/// invalid then use current location. +/// getColumnNumber - Get column number for the location. unsigned CGDebugInfo::getColumnNumber(SourceLocation Loc) { - if (Loc.isInvalid() && CurLoc.isInvalid()) - return 0; + // We may not want column information at all. if (!CGM.getCodeGenOpts().DebugColumnInfo) return 0; + + // If the location is invalid then use the current column. + if (Loc.isInvalid() && CurLoc.isInvalid()) + return 0; SourceManager &SM = CGM.getContext().getSourceManager(); PresumedLoc PLoc = SM.getPresumedLoc(Loc.isValid() ? Loc : CurLoc); return PLoc.isValid()? PLoc.getColumn() : 0; |