From 181aaee16501f1ffabda0775b2d5f2d7a3595ccc Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 4 Nov 2009 21:13:15 +0000 Subject: [PATCH] InitializePreprocessor cannot fail. llvm-svn: 86048 --- clang/include/clang/Frontend/InitPreprocessor.h | 4 ++-- clang/lib/Frontend/InitPreprocessor.cpp | 5 +---- clang/tools/clang-cc/clang-cc.cpp | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/clang/include/clang/Frontend/InitPreprocessor.h b/clang/include/clang/Frontend/InitPreprocessor.h index bf27b19aa3d7..415acea79a26 100644 --- a/clang/include/clang/Frontend/InitPreprocessor.h +++ b/clang/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/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp index 3a54d1dca780..7139e55f0b60 100644 --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/clang/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/clang/tools/clang-cc/clang-cc.cpp b/clang/tools/clang-cc/clang-cc.cpp index 66aa19a5d314..95f637040141 100644 --- a/clang/tools/clang-cc/clang-cc.cpp +++ b/clang/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(); }