diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-09-01 20:53:18 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-09-01 20:53:18 +0000 |
commit | aec230d29835285777ecc467e268c83b33a2adde (patch) | |
tree | 71d407d2a7ce65d1cbf4288c0838fdb12e68ad98 /include/clang/Basic/SourceManager.h | |
parent | 3e3cd93b2fd9644e970c389e715c13883faf68b6 (diff) |
[arcmt] Fix test/ARCMT/remove-statements.m regression due to
Objective-C method buffering(rdar://10056942)
Turned out the same issue existed for C++ inline methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138960 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r-- | include/clang/Basic/SourceManager.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index 0299d2237f..af5f76969a 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -1116,6 +1116,19 @@ public: /// \returns true if LHS source location comes before RHS, false otherwise. bool isBeforeInTranslationUnit(SourceLocation LHS, SourceLocation RHS) const; + /// \brief Comparison function class. + class LocBeforeThanCompare : public std::binary_function<SourceLocation, + SourceLocation, bool> { + SourceManager &SM; + + public: + explicit LocBeforeThanCompare(SourceManager &SM) : SM(SM) { } + + bool operator()(SourceLocation LHS, SourceLocation RHS) const { + return SM.isBeforeInTranslationUnit(LHS, RHS); + } + }; + /// \brief Determines the order of 2 source locations in the "source location /// address space". bool isBeforeInSLocAddrSpace(SourceLocation LHS, SourceLocation RHS) const { |