diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-12-19 22:51:13 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-12-19 22:51:13 +0000 |
commit | 95041a2029a069386ee67439f6d0fb524a9d184f (patch) | |
tree | fc90277b24345b3b96aa34852ac44656e513e361 /Lex/Preprocessor.cpp | |
parent | 7dcc968f17a6ff9088c9651dddccc8d4025a1271 (diff) |
Interned MainFileID within SourceManager. Since SourceManager is referenced by
both Preprocessor and ASTContext, we no longer need to explicitly pass
MainFileID around in function calls that also pass either Preprocessor or
ASTContext. This resulted in some nice cleanups in the ASTConsumers and the
driver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45228 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Lex/Preprocessor.cpp')
-rw-r--r-- | Lex/Preprocessor.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lex/Preprocessor.cpp b/Lex/Preprocessor.cpp index fb4628be71..a7880fa7fc 100644 --- a/Lex/Preprocessor.cpp +++ b/Lex/Preprocessor.cpp @@ -431,7 +431,10 @@ static void InitializePredefinedMacros(Preprocessor &PP, /// EnterMainSourceFile - Enter the specified FileID as the main source file, /// which implicitly adds the builting defines etc. -void Preprocessor::EnterMainSourceFile(unsigned MainFileID) { +void Preprocessor::EnterMainSourceFile() { + + unsigned MainFileID = SourceMgr.getMainFileID(); + // Enter the main file source buffer. EnterSourceFile(MainFileID, 0); |