diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-03-23 05:09:10 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-03-23 05:09:10 +0000 |
commit | dbd8209b33e6c9f151e4913a9c095d64a95439c4 (patch) | |
tree | cc208cfa59d9fb8a90daf856f96ab3d83c9184b8 /include/clang | |
parent | d9e0c0fc47d5881a609ec34372d554e3652db66c (diff) |
PPCallbacks: Add hook for reaching the end of the main file, and fix DependencyFile to not do work in its destructor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99257 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Lex/PPCallbacks.h | 11 | ||||
-rw-r--r-- | include/clang/Lex/Preprocessor.h | 4 |
2 files changed, 15 insertions, 0 deletions
diff --git a/include/clang/Lex/PPCallbacks.h b/include/clang/Lex/PPCallbacks.h index dd24fb7d7b..e891e94d4c 100644 --- a/include/clang/Lex/PPCallbacks.h +++ b/include/clang/Lex/PPCallbacks.h @@ -44,6 +44,12 @@ public: SrcMgr::CharacteristicKind FileType) { } + + /// EndOfMainFile - This callback is invoked when the end of the main file is + /// reach, no subsequent callbacks will be made. + virtual void EndOfMainFile() { + } + /// Ident - This callback is invoked when a #ident or #sccs directive is read. /// virtual void Ident(SourceLocation Loc, const std::string &str) { @@ -90,6 +96,11 @@ public: Second->FileChanged(Loc, Reason, FileType); } + virtual void EndOfMainFile() { + First->EndOfMainFile(); + Second->EndOfMainFile(); + } + virtual void Ident(SourceLocation Loc, const std::string &str) { First->Ident(Loc, str); Second->Ident(Loc, str); diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index 23c118d1fc..312a760e01 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -368,6 +368,10 @@ public: /// which implicitly adds the builtin defines etc. bool EnterMainSourceFile(); + /// EndSourceFile - Inform the preprocessor callbacks that processing is + /// complete. + void EndSourceFile(); + /// EnterSourceFile - Add a source file to the top of the include stack and /// start lexing tokens from it instead of the current buffer. Return true /// and fill in ErrorStr with the error information on failure. |