aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/SourceManager.h
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-09-19 20:39:51 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-09-19 20:39:51 +0000
commit4d1cbcf6b9aaae7f82c6e332f46b2ad2d8971bd0 (patch)
tree514acf560064172768f706250fb82660ba196dde /include/clang/Basic/SourceManager.h
parent285cfd8953d4ca4da613a47a0d691f7234068f8c (diff)
For SourceManager::isBeforeInTranslationUnit, when one location
points at the inclusion/expansion point of the other, regard this as coming before the other. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140051 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r--include/clang/Basic/SourceManager.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index 7ddc887edc..fb48430e25 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -434,8 +434,11 @@ public:
// 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;