[cfe-commits] r38946 - in /cfe/cfe/trunk/include/clang/Parse: Action.h Parser.h
sabre at cs.uiuc.edu
sabre at cs.uiuc.edu
Wed Jul 11 09:26:06 PDT 2007
Author: sabre
Date: Wed Jul 11 11:26:06 2007
New Revision: 38946
URL: http://llvm.org/viewvc/llvm-project?rev=38946&view=rev
Log:
Move the ExprResult struct from the Parser to the Actions.
Modified:
cfe/cfe/trunk/include/clang/Parse/Action.h
cfe/cfe/trunk/include/clang/Parse/Parser.h
Modified: cfe/cfe/trunk/include/clang/Parse/Action.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Parse/Action.h?rev=38946&r1=38945&r2=38946&view=diff
==============================================================================
--- cfe/cfe/trunk/include/clang/Parse/Action.h (original)
+++ cfe/cfe/trunk/include/clang/Parse/Action.h Wed Jul 11 11:26:06 2007
@@ -49,6 +49,22 @@
typedef void ExprTy;
typedef void DeclTy;
+ /// ExprResult - This structure is used while parsing/acting on expressions.
+ /// It encapsulates both the expression object returned by the action, plus
+ /// a sense of whether or not it is valid.
+ struct ExprResult {
+ ExprTy *Val;
+ bool isInvalid;
+
+ ExprResult(bool Invalid = false) : Val(0), isInvalid(Invalid) {}
+
+ const ExprResult &operator=(ExprTy *RHS) {
+ Val = RHS;
+ isInvalid = false;
+ return *this;
+ }
+ };
+
//===--------------------------------------------------------------------===//
// Symbol Table Tracking Callbacks.
//===--------------------------------------------------------------------===//
Modified: cfe/cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Parse/Parser.h?rev=38946&r1=38945&r2=38946&view=diff
==============================================================================
--- cfe/cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/cfe/trunk/include/clang/Parse/Parser.h Wed Jul 11 11:26:06 2007
@@ -220,18 +220,7 @@
//===--------------------------------------------------------------------===//
// C99 6.5: Expressions.
- struct ExprResult {
- ExprTy *Val;
- bool isInvalid;
-
- ExprResult(bool Invalid = false) : Val(0), isInvalid(Invalid) {}
-
- const ExprResult &operator=(ExprTy *RHS) {
- Val = RHS;
- isInvalid = false;
- return *this;
- }
- };
+ typedef Action::ExprResult ExprResult;
ExprResult ParseExpression();
ExprResult ParseConstantExpression();
More information about the cfe-commits
mailing list