aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/SourceManager.h
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-10-31 07:20:03 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-10-31 07:20:03 +0000
commit718699169a7ccaf623e375031789efeed82f869b (patch)
tree601bcc21dfbb2e871f407e8a1228f536987564f2 /include/clang/Basic/SourceManager.h
parent332cb9be88fd2d1b294a2fbc299c354e93be673c (diff)
Introduce SourceManager::isLocalFileID/isLoadedFileID functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143339 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r--include/clang/Basic/SourceManager.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index 4df9ae7e9a..2298672093 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -1260,6 +1260,17 @@ public:
return Loc.getOffset() < NextLocalOffset;
}
+ /// \brief Returns true if \arg FID came from a PCH/Module.
+ bool isLoadedFileID(FileID FID) const {
+ assert(FID.ID != -1 && "Using FileID sentinel value");
+ return FID.ID < 0;
+ }
+
+ /// \brief Returns true if \arg FID did not come from a PCH/Module.
+ bool isLocalFileID(FileID FID) const {
+ return !isLoadedFileID(FID);
+ }
+
private:
const llvm::MemoryBuffer *getFakeBufferForRecovery() const;