From fb4cd4082c854d3904caefb10032ca666279960f Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Tue, 11 Oct 2011 23:00:45 +0000 Subject: Reorder this to make it easier to add more changes for a location set. llvm-svn: 141730 --- clang/lib/CodeGen/CGDebugInfo.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp') diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 313c02dc6fd..962a59861f3 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/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. -- cgit v1.2.3