aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/SourceManager.h
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-09-19 20:40:05 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-09-19 20:40:05 +0000
commitaa6edaeb35e02a07bd4840c0159900754f083ce5 (patch)
tree5048a611a5c6575c825574cb74a4a1e98230c3ac /include/clang/Basic/SourceManager.h
parent1f6d22550161fffbe82ea9a8a143b2c1247f5f3c (diff)
Introduce isLoadedSourceLocation() and isLocalSourceLocation() methods in SourceManager.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140055 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r--include/clang/Basic/SourceManager.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index 9dc1945852..2bd07c6d5f 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -1223,6 +1223,16 @@ public:
std::pair<int, unsigned>
AllocateLoadedSLocEntries(unsigned NumSLocEntries, unsigned TotalSize);
+ /// \brief Returns true if \arg Loc came from a PCH/Module.
+ bool isLoadedSourceLocation(SourceLocation Loc) const {
+ return Loc.getOffset() >= CurrentLoadedOffset;
+ }
+
+ /// \brief Returns true if \arg Loc did not come from a PCH/Module.
+ bool isLocalSourceLocation(SourceLocation Loc) const {
+ return Loc.getOffset() < NextLocalOffset;
+ }
+
private:
const llvm::MemoryBuffer *getFakeBufferForRecovery() const;