[cfe-commits] r166240 - /cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
Eric Christopher
echristo at gmail.com
Thu Oct 18 15:08:02 PDT 2012
Author: echristo
Date: Thu Oct 18 17:08:02 2012
New Revision: 166240
URL: http://llvm.org/viewvc/llvm-project?rev=166240&view=rev
Log:
Fix up comment and invert order. Most simple check first.
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=166240&r1=166239&r2=166240&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Oct 18 17:08:02 2012
@@ -254,13 +254,15 @@
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;
More information about the cfe-commits
mailing list