From: Eric Christopher Date: Tue, 11 Oct 2011 23:00:45 +0000 (+0000) Subject: Reorder this to make it easier to add more changes for a location set. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=944542e29c2d796049be1db12160e232fb28aebf;p=clang Reorder this to make it easier to add more changes for a location set. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141730 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 313c02dc6f..962a59861f 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -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.