]> granicus.if.org Git - clang/commitdiff
Reorder this to make it easier to add more changes for a location set.
authorEric Christopher <echristo@apple.com>
Tue, 11 Oct 2011 23:00:45 +0000 (23:00 +0000)
committerEric Christopher <echristo@apple.com>
Tue, 11 Oct 2011 23:00:45 +0000 (23:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141730 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index 313c02dc6fdcc3addbdb115a8750a03d2769f2b5..962a59861f3c1b7bf8984ec317cfd49827f3e9c1 100644 (file)
@@ -50,8 +50,10 @@ CGDebugInfo::~CGDebugInfo() {
 }
 
 void CGDebugInfo::setLocation(SourceLocation Loc) {
-  if (Loc.isValid())
-    CurLoc = CGM.getContext().getSourceManager().getExpansionLoc(Loc);
+  // If the new location isn't valid return.
+  if (!Loc.isValid()) return;
+
+  CurLoc = CGM.getContext().getSourceManager().getExpansionLoc(Loc);
 }
 
 /// getContextDescriptor - Get context info for the decl.