[cfe-commits] r86048 - in /cfe/trunk: include/clang/Frontend/InitPreprocessor.h lib/Frontend/InitPreprocessor.cpp tools/clang-cc/clang-cc.cpp

Daniel Dunbar daniel at zuster.org
Wed Nov 4 13:13:15 PST 2009


Author: ddunbar
Date: Wed Nov  4 15:13:15 2009
New Revision: 86048

URL: http://llvm.org/viewvc/llvm-project?rev=86048&view=rev
Log:
InitializePreprocessor cannot fail.

Modified:
    cfe/trunk/include/clang/Frontend/InitPreprocessor.h
    cfe/trunk/lib/Frontend/InitPreprocessor.cpp
    cfe/trunk/tools/clang-cc/clang-cc.cpp

Modified: cfe/trunk/include/clang/Frontend/InitPreprocessor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/InitPreprocessor.h?rev=86048&r1=86047&r2=86048&view=diff

==============================================================================
--- cfe/trunk/include/clang/Frontend/InitPreprocessor.h (original)
+++ cfe/trunk/include/clang/Frontend/InitPreprocessor.h Wed Nov  4 15:13:15 2009
@@ -69,9 +69,9 @@
 };
 
 /// 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

Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=86048&r1=86047&r2=86048&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp (original)
+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp Wed Nov  4 15:13:15 2009
@@ -442,7 +442,7 @@
 /// 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<char> PredefineBuffer;
 
@@ -488,7 +488,4 @@
   // Null terminate PredefinedBuffer and add it.
   PredefineBuffer.push_back(0);
   PP.setPredefines(&PredefineBuffer[0]);
-
-  // Once we've read this, we're done.
-  return false;
 }

Modified: cfe/trunk/tools/clang-cc/clang-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/clang-cc.cpp?rev=86048&r1=86047&r2=86048&view=diff

==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Wed Nov  4 15:13:15 2009
@@ -1251,8 +1251,7 @@
 
     PreprocessorInitOptions InitOpts;
     InitializePreprocessorInitOptions(InitOpts);
-    if (InitializePreprocessor(*PP, InitOpts))
-      return 0;
+    InitializePreprocessor(*PP, InitOpts);
 
     return PP.take();
   }





More information about the cfe-commits mailing list