Fix up comment and invert order. Most simple check first.

llvm-svn: 166240
This commit is contained in:
Eric Christopher 2012-10-18 22:08:02 +00:00
parent c7a4a2aa33
commit 56b8a200e1
1 changed files with 6 additions and 4 deletions

View File

@ -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;