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 | cb9eaf59fb07a4f40724be47d04ff75ee039a1c5 (patch) | |
| tree | 5ca7033b47f09b9afa704927677da2964b012a16 /clang/lib/Frontend | |
| parent | de04b3f62c291222044eaabbf9e8adf84b68bcd8 (diff) | |
| download | bcm5719-llvm-cb9eaf59fb07a4f40724be47d04ff75ee039a1c5.tar.gz bcm5719-llvm-cb9eaf59fb07a4f40724be47d04ff75ee039a1c5.zip  | |
PPCallbacks: Add hook for reaching the end of the main file, and fix DependencyFile to not do work in its destructor.
llvm-svn: 99257
Diffstat (limited to 'clang/lib/Frontend')
| -rw-r--r-- | clang/lib/Frontend/DependencyFile.cpp | 9 | ||||
| -rw-r--r-- | clang/lib/Frontend/FrontendAction.cpp | 4 | 
2 files changed, 9 insertions, 4 deletions
diff --git a/clang/lib/Frontend/DependencyFile.cpp b/clang/lib/Frontend/DependencyFile.cpp index de2b056dc7c..14aee3559c9 100644 --- a/clang/lib/Frontend/DependencyFile.cpp +++ b/clang/lib/Frontend/DependencyFile.cpp @@ -48,14 +48,15 @@ public:        IncludeSystemHeaders(Opts.IncludeSystemHeaders),        PhonyTarget(Opts.UsePhonyTargets) {} -  ~DependencyFileCallback() { +  virtual void FileChanged(SourceLocation Loc, FileChangeReason Reason, +                           SrcMgr::CharacteristicKind FileType); + +  virtual void EndOfMainFile() {      OutputDependencyFile();      OS->flush();      delete OS; +    OS = 0;    } - -  virtual void FileChanged(SourceLocation Loc, FileChangeReason Reason, -                           SrcMgr::CharacteristicKind FileType);  };  } diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index 66df7a61917..110612d03b5 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -169,6 +169,10 @@ void FrontendAction::EndSourceFile() {        CI.setASTContext(0);    } +  // Inform the preprocessor we are done. +  if (CI.hasPreprocessor()) +    CI.getPreprocessor().EndSourceFile(); +    if (CI.getFrontendOpts().ShowStats) {      llvm::errs() << "\nSTATISTICS FOR '" << getCurrentFile() << "':\n";      CI.getPreprocessor().PrintStats();  | 

