diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-11-17 05:52:41 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-11-17 05:52:41 +0000 |
commit | 049d3a06ea9f8fc03582488a2b7f24512565a335 (patch) | |
tree | 0969d15cfb854c722a9e87b50ddba573dc7c9d1f /lib/Frontend | |
parent | 9298cfc7475c48fa42b168c37f628663d65ddde7 (diff) |
Simplify PreprocessorOptions, it doesn't need abstracted field access.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89047 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend')
-rw-r--r-- | lib/Frontend/CompilerInstance.cpp | 4 | ||||
-rw-r--r-- | lib/Frontend/FrontendAction.cpp | 4 | ||||
-rw-r--r-- | lib/Frontend/InitPreprocessor.cpp | 26 |
3 files changed, 16 insertions, 18 deletions
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp index 42352dfe51..0365761c84 100644 --- a/lib/Frontend/CompilerInstance.cpp +++ b/lib/Frontend/CompilerInstance.cpp @@ -167,8 +167,8 @@ CompilerInstance::createPreprocessor(Diagnostic &Diags, FileManager &FileMgr) { // Create a PTH manager if we are using some form of a token cache. PTHManager *PTHMgr = 0; - if (!PPOpts.getTokenCache().empty()) - PTHMgr = PTHManager::Create(PPOpts.getTokenCache(), Diags); + if (!PPOpts.TokenCache.empty()) + PTHMgr = PTHManager::Create(PPOpts.TokenCache, Diags); // FIXME: Don't fail like this. if (Diags.hasErrorOccurred()) diff --git a/lib/Frontend/FrontendAction.cpp b/lib/Frontend/FrontendAction.cpp index 2629b446f0..ff63a0dab5 100644 --- a/lib/Frontend/FrontendAction.cpp +++ b/lib/Frontend/FrontendAction.cpp @@ -90,10 +90,10 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, goto failure; /// Use PCH? - if (!CI.getPreprocessorOpts().getImplicitPCHInclude().empty()) { + if (!CI.getPreprocessorOpts().ImplicitPCHInclude.empty()) { assert(hasPCHSupport() && "This action does not have PCH support!"); CI.createPCHExternalASTSource( - CI.getPreprocessorOpts().getImplicitPCHInclude()); + CI.getPreprocessorOpts().ImplicitPCHInclude); if (!CI.getASTContext().getExternalSource()) goto failure; } diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp index 9648620ea0..4ee286dd26 100644 --- a/lib/Frontend/InitPreprocessor.cpp +++ b/lib/Frontend/InitPreprocessor.cpp @@ -477,7 +477,7 @@ void clang::InitializePreprocessor(Preprocessor &PP, LineDirective, LineDirective+strlen(LineDirective)); // Install things like __POWERPC__, __GNUC__, etc into the macro table. - if (InitOpts.getUsePredefines()) + if (InitOpts.UsePredefines) InitializePredefinedMacros(PP.getTargetInfo(), PP.getLangOptions(), PredefineBuffer); @@ -488,27 +488,25 @@ void clang::InitializePreprocessor(Preprocessor &PP, LineDirective, LineDirective+strlen(LineDirective)); // Process #define's and #undef's in the order they are given. - for (PreprocessorOptions::macro_iterator I = InitOpts.macro_begin(), - E = InitOpts.macro_end(); I != E; ++I) { - if (I->second) // isUndef - UndefineBuiltinMacro(PredefineBuffer, I->first.c_str()); + for (unsigned i = 0, e = InitOpts.Macros.size(); i != e; ++i) { + if (InitOpts.Macros[i].second) // isUndef + UndefineBuiltinMacro(PredefineBuffer, InitOpts.Macros[i].first.c_str()); else - DefineBuiltinMacro(PredefineBuffer, I->first.c_str()); + DefineBuiltinMacro(PredefineBuffer, InitOpts.Macros[i].first.c_str()); } // If -imacros are specified, include them now. These are processed before // any -include directives. - for (PreprocessorOptions::imacro_iterator I = InitOpts.imacro_begin(), - E = InitOpts.imacro_end(); I != E; ++I) - AddImplicitIncludeMacros(PredefineBuffer, *I); + for (unsigned i = 0, e = InitOpts.MacroIncludes.size(); i != e; ++i) + AddImplicitIncludeMacros(PredefineBuffer, InitOpts.MacroIncludes[i]); // Process -include directives. - for (PreprocessorOptions::include_iterator I = InitOpts.include_begin(), - E = InitOpts.include_end(); I != E; ++I) { - if (*I == InitOpts.getImplicitPTHInclude()) - AddImplicitIncludePTH(PredefineBuffer, PP, *I); + for (unsigned i = 0, e = InitOpts.Includes.size(); i != e; ++i) { + const std::string &Path = InitOpts.Includes[i]; + if (Path == InitOpts.ImplicitPTHInclude) + AddImplicitIncludePTH(PredefineBuffer, PP, Path); else - AddImplicitInclude(PredefineBuffer, *I); + AddImplicitInclude(PredefineBuffer, Path); } // Null terminate PredefinedBuffer and add it. |