r182698 - Make isBeforeInTranslationUnit consistent in the face of failures to get a valid FileID (V2).

Argyrios Kyrtzidis akyrtzi at gmail.com
Fri May 24 18:03:03 PDT 2013


Author: akirtzidis
Date: Fri May 24 20:03:03 2013
New Revision: 182698

URL: http://llvm.org/viewvc/llvm-project?rev=182698&view=rev
Log:
Make isBeforeInTranslationUnit consistent in the face of failures to get a valid FileID (V2).

Modified:
    cfe/trunk/lib/Basic/SourceManager.cpp

Modified: cfe/trunk/lib/Basic/SourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceManager.cpp?rev=182698&r1=182697&r2=182698&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/SourceManager.cpp (original)
+++ cfe/trunk/lib/Basic/SourceManager.cpp Fri May 24 20:03:03 2013
@@ -2043,7 +2043,7 @@ bool SourceManager::isBeforeInTranslatio
   // is a serialized one referring to a file that was removed after we loaded
   // the PCH.
   if (LOffs.first.isInvalid() || ROffs.first.isInvalid())
-    return LOffs.first.isInvalid();
+    return LOffs.first.isInvalid() && !ROffs.first.isInvalid();
 
   // If the source locations are in the same file, just compare offsets.
   if (LOffs.first == ROffs.first)





More information about the cfe-commits mailing list