summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2012-10-18 22:08:02 +0000
committerEric Christopher <echristo@gmail.com>2012-10-18 22:08:02 +0000
commit56b8a200e13db4d0377fb7ce88704d4eafa8067a (patch)
tree95106f27839a2c8524192663a3d05ce6e9071d9e /clang/lib/CodeGen/CGDebugInfo.cpp
parentc7a4a2aa3356bc0551bd6685db118240168570c8 (diff)
downloadbcm5719-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.cpp10
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;
OpenPOWER on IntegriCloud