Simplify an API
llvm-svn: 38541
diff --git a/clang/Lex/PPExpressions.cpp b/clang/Lex/PPExpressions.cpp
index 237b1f4..3eeb3d9 100644
--- a/clang/Lex/PPExpressions.cpp
+++ b/clang/Lex/PPExpressions.cpp
@@ -30,21 +30,18 @@
 ///
 /// MinPrec is the minimum precedence that this range of the expression is
 /// allowed to include.
-void Preprocessor::EvaluateDirectiveExpression(bool &Result) {
+bool Preprocessor::EvaluateDirectiveExpression() {
   // Peek ahead one token.
   LexerToken Tok;
   Lex(Tok);
 
-  // In error cases, bail out with false value.
-  Result = false;
-  
   int ResVal = 0;
   if (EvaluateValue(ResVal, Tok) ||
       EvaluateDirectiveSubExpr(ResVal, 1, Tok)) {
     // Skip the rest of the macro line.
     if (Tok.getKind() != tok::eom)
       DiscardUntilEndOfDirective();
-    return;
+    return false;
   }
   
   // If we aren't at the tok::eom token, something bad happened, like an extra
@@ -54,7 +51,7 @@
     DiscardUntilEndOfDirective();
   }
   
-  Result = ResVal != 0;
+  return ResVal != 0;
 }
 
 /// EvaluateValue - Evaluate the token PeekTok (and any others needed) and
diff --git a/clang/Lex/Preprocessor.cpp b/clang/Lex/Preprocessor.cpp
index 7f3a0c6..17a2b0d 100644
--- a/clang/Lex/Preprocessor.cpp
+++ b/clang/Lex/Preprocessor.cpp
@@ -621,7 +621,7 @@
           // looked up, etc, inside the #elif expression.
           assert(SkippingContents && "We have to be skipping here!");
           SkippingContents = false;
-          EvaluateDirectiveExpression(ShouldEnter);
+          ShouldEnter = EvaluateDirectiveExpression();
           SkippingContents = true;
         }
         
@@ -1011,8 +1011,7 @@
   ++NumIf;
   const char *Start = CurLexer->BufferPtr;
 
-  bool ConditionalTrue = false;
-  EvaluateDirectiveExpression(ConditionalTrue);
+  bool ConditionalTrue = EvaluateDirectiveExpression();
   
   // Should we include the stuff contained by this directive?
   if (ConditionalTrue) {
diff --git a/clang/include/clang/Lex/Preprocessor.h b/clang/include/clang/Lex/Preprocessor.h
index 694b70a..6dde0a4 100644
--- a/clang/include/clang/Lex/Preprocessor.h
+++ b/clang/include/clang/Lex/Preprocessor.h
@@ -332,12 +332,10 @@
   /// EvaluateDirectiveExpression - Evaluate an integer constant expression that
   /// may occur after a #if or #elif directive.  Sets Result to the result of
   /// the expression.
-  void EvaluateDirectiveExpression(bool &Result);
-  /// EvaluateValue - Used to implement EvaluateDirectiveExpression,
-  /// see PPExpressions.cpp.
+  bool EvaluateDirectiveExpression();
+  /// EvaluateValue/EvaluateDirectiveSubExpr - Used to implement
+  /// EvaluateDirectiveExpression, see PPExpressions.cpp.
   bool EvaluateValue(int &Result, LexerToken &PeekTok);
-  /// EvaluateDirectiveSubExpr - Used to implement EvaluateDirectiveExpression,
-  /// see PPExpressions.cpp.
   bool EvaluateDirectiveSubExpr(int &LHS, unsigned MinPrec,
                                 LexerToken &PeekTok);