diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-12-19 22:29:55 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-12-19 22:29:55 +0000 |
commit | 76edd0e4ae0592a7225d50d0bad6732ac64dca2a (patch) | |
tree | fb2e1e5d0249c05d9419fabc6e5a51820bdebc4b /include/clang/Basic/SourceManager.h | |
parent | 94a5c3334bba3cc8cd1da85ba1118bc2c080add9 (diff) |
Added storage of the FileID of the the main source file of a translation unit
in SourceManager.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45225 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r-- | include/clang/Basic/SourceManager.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index 325f9ed106..311bea1d3c 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -220,8 +220,11 @@ class SourceManager { unsigned LastLineNoFilePos; unsigned LastLineNoResult; + /// MainFileID - The file ID for the main source file of the translation unit. + unsigned MainFileID; + public: - SourceManager() : LastLineNoFileIDQuery(~0U) {} + SourceManager() : LastLineNoFileIDQuery(~0U), MainFileID(0) {} ~SourceManager() {} void clearIDTables() { @@ -231,6 +234,12 @@ public: LastLineNoContentCache = 0; } + /// getMainFileID - Returns the FileID of the main source file. + unsigned getMainFileID() const { return MainFileID; } + + /// setMainFileID - Set the FileID of the main source file. + void setMainFileID(unsigned ID) { MainFileID = ID; } + /// createFileID - Create a new FileID that represents the specified file /// being #included from the specified IncludePosition. This returns 0 on /// error and translates NULL into standard input. |