From 938963f076418aa61b570e5317240f66642af2df Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 4 Nov 2009 21:13:15 +0000 Subject: [PATCH] InitializePreprocessor cannot fail. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86048 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Frontend/InitPreprocessor.h | 4 ++-- lib/Frontend/InitPreprocessor.cpp | 5 +---- tools/clang-cc/clang-cc.cpp | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/include/clang/Frontend/InitPreprocessor.h b/include/clang/Frontend/InitPreprocessor.h index bf27b19aa3..415acea79a 100644 --- a/include/clang/Frontend/InitPreprocessor.h +++ b/include/clang/Frontend/InitPreprocessor.h @@ -69,9 +69,9 @@ public: }; /// InitializePreprocessor - Initialize the preprocessor getting it and the -/// environment ready to process a single file. This returns true on error. +/// environment ready to process a single file. /// -bool InitializePreprocessor(Preprocessor &PP, +void InitializePreprocessor(Preprocessor &PP, const PreprocessorInitOptions& InitOptions); } // end namespace clang diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp index 3a54d1dca7..7139e55f0b 100644 --- a/lib/Frontend/InitPreprocessor.cpp +++ b/lib/Frontend/InitPreprocessor.cpp @@ -442,7 +442,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI, /// InitializePreprocessor - Initialize the preprocessor getting it and the /// environment ready to process a single file. This returns true on error. /// -bool clang::InitializePreprocessor(Preprocessor &PP, +void clang::InitializePreprocessor(Preprocessor &PP, const PreprocessorInitOptions &InitOpts) { std::vector PredefineBuffer; @@ -488,7 +488,4 @@ bool clang::InitializePreprocessor(Preprocessor &PP, // Null terminate PredefinedBuffer and add it. PredefineBuffer.push_back(0); PP.setPredefines(&PredefineBuffer[0]); - - // Once we've read this, we're done. - return false; } diff --git a/tools/clang-cc/clang-cc.cpp b/tools/clang-cc/clang-cc.cpp index 66aa19a5d3..95f6370401 100644 --- a/tools/clang-cc/clang-cc.cpp +++ b/tools/clang-cc/clang-cc.cpp @@ -1251,8 +1251,7 @@ public: PreprocessorInitOptions InitOpts; InitializePreprocessorInitOptions(InitOpts); - if (InitializePreprocessor(*PP, InitOpts)) - return 0; + InitializePreprocessor(*PP, InitOpts); return PP.take(); } -- 2.40.0