[cfe-commits] r140051 - /cfe/trunk/include/clang/Basic/SourceManager.h
Argyrios Kyrtzidis
akyrtzi at gmail.com
Mon Sep 19 13:39:51 PDT 2011
Author: akirtzidis
Date: Mon Sep 19 15:39:51 2011
New Revision: 140051
URL: http://llvm.org/viewvc/llvm-project?rev=140051&view=rev
Log:
For SourceManager::isBeforeInTranslationUnit, when one location
points at the inclusion/expansion point of the other, regard this
as coming before the other.
Modified:
cfe/trunk/include/clang/Basic/SourceManager.h
Modified: cfe/trunk/include/clang/Basic/SourceManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceManager.h?rev=140051&r1=140050&r2=140051&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/SourceManager.h (original)
+++ cfe/trunk/include/clang/Basic/SourceManager.h Mon Sep 19 15:39:51 2011
@@ -434,8 +434,11 @@
// It is common for multiple macro expansions to be "included" from the same
// location (expansion location), in which case use the order of the FileIDs
- // to determine which came first.
- if (LOffset == ROffset && LQueryFID != CommonFID && RQueryFID != CommonFID)
+ // to determine which came first. This will also take care the case where
+ // one of the locations points at the inclusion/expansion point of the other
+ // in which case its FileID will come before the other.
+ if (LOffset == ROffset &&
+ (LQueryFID != CommonFID || RQueryFID != CommonFID))
return IsLQFIDBeforeRQFID;
return LOffset < ROffset;
More information about the cfe-commits
mailing list