diff options
author | Julie Hockett <juliehockett@google.com> | 2018-05-09 18:27:33 +0000 |
---|---|---|
committer | Julie Hockett <juliehockett@google.com> | 2018-05-09 18:27:33 +0000 |
commit | 6a37651bb30339e60ea617d510b4703bcd2e89e8 (patch) | |
tree | 6caba31415c8f39d5fb2995e9900a988e48fca41 /include/clang | |
parent | 930a12f648006628481eeaf06d83c7168869d06c (diff) |
[clang] Adding CharacteristicKind to PPCallbacks::InclusionDirective
Adding a SrcMgr::CharacteristicKind parameter to the InclusionDirective
in PPCallbacks, and updating calls to that function. This will be useful
in https://reviews.llvm.org/D43778 to determine which includes are system
headers.
Differential Revision: https://reviews.llvm.org/D46614
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331904 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Lex/PPCallbacks.h | 14 | ||||
-rw-r--r-- | include/clang/Lex/PreprocessingRecord.h | 4 |
2 files changed, 12 insertions, 6 deletions
diff --git a/include/clang/Lex/PPCallbacks.h b/include/clang/Lex/PPCallbacks.h index 1814821cdc..eb85bda840 100644 --- a/include/clang/Lex/PPCallbacks.h +++ b/include/clang/Lex/PPCallbacks.h @@ -117,6 +117,10 @@ public: /// \param Imported The module, whenever an inclusion directive was /// automatically turned into a module import or null otherwise. /// + /// \param FileType The characteristic kind, indicates whether a file or + /// directory holds normal user code, system code, or system code which is + /// implicitly 'extern "C"' in C++ mode. + /// virtual void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName, @@ -125,7 +129,8 @@ public: const FileEntry *File, StringRef SearchPath, StringRef RelativePath, - const Module *Imported) { + const Module *Imported, + SrcMgr::CharacteristicKind FileType) { } /// Callback invoked whenever there was an explicit module-import @@ -367,13 +372,14 @@ public: StringRef FileName, bool IsAngled, CharSourceRange FilenameRange, const FileEntry *File, StringRef SearchPath, StringRef RelativePath, - const Module *Imported) override { + const Module *Imported, + SrcMgr::CharacteristicKind FileType) override { First->InclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, FilenameRange, File, SearchPath, RelativePath, - Imported); + Imported, FileType); Second->InclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, FilenameRange, File, SearchPath, RelativePath, - Imported); + Imported, FileType); } void moduleImport(SourceLocation ImportLoc, ModuleIdPath Path, diff --git a/include/clang/Lex/PreprocessingRecord.h b/include/clang/Lex/PreprocessingRecord.h index d9233c5d8d..54e28a52f5 100644 --- a/include/clang/Lex/PreprocessingRecord.h +++ b/include/clang/Lex/PreprocessingRecord.h @@ -532,8 +532,8 @@ class Token; StringRef FileName, bool IsAngled, CharSourceRange FilenameRange, const FileEntry *File, StringRef SearchPath, - StringRef RelativePath, - const Module *Imported) override; + StringRef RelativePath, const Module *Imported, + SrcMgr::CharacteristicKind FileType) override; void Ifdef(SourceLocation Loc, const Token &MacroNameTok, const MacroDefinition &MD) override; void Ifndef(SourceLocation Loc, const Token &MacroNameTok, |