From 7416a3a78f99e02775d0e75dbe37f2fc103d7bae Mon Sep 17 00:00:00 2001 From: Gabor Horvath Date: Thu, 29 Jun 2017 06:53:13 +0000 Subject: Factor out a functionality from isBeforeInTranslationUnit The first user of this API will be the cross translation unit functionality of the Static Analyzer which will be committed in a follow-up patch. Differential Revision: https://reviews.llvm.org/D34506 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306648 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/SourceManager.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/clang/Basic/SourceManager.h') diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index e658af742e..ed3f8dfa86 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -1489,6 +1489,17 @@ public: /// \returns true if LHS source location comes before RHS, false otherwise. bool isBeforeInTranslationUnit(SourceLocation LHS, SourceLocation RHS) const; + /// \brief Determines whether the two decomposed source location is in the + /// same translation unit. As a byproduct, it also calculates the order + /// of the source locations in case they are in the same TU. + /// + /// \returns Pair of bools the first component is true if the two locations + /// are in the same TU. The second bool is true if the first is true + /// and \p LOffs is before \p ROffs. + std::pair + isInTheSameTranslationUnit(std::pair &LOffs, + std::pair &ROffs) const; + /// \brief Determines the order of 2 source locations in the "source location /// address space". bool isBeforeInSLocAddrSpace(SourceLocation LHS, SourceLocation RHS) const { -- cgit v1.2.3