From 56b8a200e13db4d0377fb7ce88704d4eafa8067a Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Thu, 18 Oct 2012 22:08:02 +0000 Subject: Fix up comment and invert order. Most simple check first. llvm-svn: 166240 --- clang/lib/CodeGen/CGDebugInfo.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp') 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; -- cgit v1.2.3