summaryrefslogtreecommitdiffstats
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
commit98b26201ab2899ad773320db3c1e1326dc9c1c0e (patch)
treea2ba5d4de02a9930a210a653c03b12a901d781be
parente54568d657f254a628fb7cf1b127ee0cf955d000 (diff)
downloadbcm5719-llvm-98b26201ab2899ad773320db3c1e1326dc9c1c0e.tar.gz
bcm5719-llvm-98b26201ab2899ad773320db3c1e1326dc9c1c0e.zip
Introduce SourceManager::isLocalFileID/isLoadedFileID functions.
llvm-svn: 143339
-rw-r--r--clang/include/clang/Basic/SourceManager.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/include/clang/Basic/SourceManager.h b/clang/include/clang/Basic/SourceManager.h
index 4df9ae7e9a8..22986720935 100644
--- a/clang/include/clang/Basic/SourceManager.h
+++ b/clang/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;
OpenPOWER on IntegriCloud