[cfe-commits] r38989 - in /cfe/cfe/trunk: Parse/ParseExpr.cpp include/clang/AST/Expr.h
sabre at cs.uiuc.edu
sabre at cs.uiuc.edu
Wed Jul 11 09:26:33 PDT 2007
Author: sabre
Date: Wed Jul 11 11:26:33 2007
New Revision: 38989
URL: http://llvm.org/viewvc/llvm-project?rev=38989&view=rev
Log:
create an ast node for &&label
Modified:
cfe/cfe/trunk/Parse/ParseExpr.cpp
cfe/cfe/trunk/include/clang/AST/Expr.h
Modified: cfe/cfe/trunk/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/ParseExpr.cpp?rev=38989&r1=38988&r2=38989&view=diff
==============================================================================
--- cfe/cfe/trunk/Parse/ParseExpr.cpp (original)
+++ cfe/cfe/trunk/Parse/ParseExpr.cpp Wed Jul 11 11:26:33 2007
@@ -534,15 +534,18 @@
return ParseSizeofAlignofExpression();
case tok::ampamp: // unary-expression: '&&' identifier
Diag(Tok, diag::ext_gnu_address_of_label);
+ SavedTok = Tok;
ConsumeToken();
- // TODO: Build AST.
- if (Tok.getKind() == tok::identifier) {
- ConsumeToken();
- } else {
+
+ if (Tok.getKind() != tok::identifier) {
Diag(Tok, diag::err_expected_ident);
return ExprResult(true);
}
- return ExprResult(false);
+ // FIXME: Create a label ref for Tok.Ident.
+ Res = Actions.ParseUnaryOp(SavedTok, 0);
+ ConsumeToken();
+
+ return Res;
default:
Diag(Tok, diag::err_expected_expression);
return ExprResult(true);
Modified: cfe/cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/AST/Expr.h?rev=38989&r1=38988&r2=38989&view=diff
==============================================================================
--- cfe/cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/cfe/trunk/include/clang/AST/Expr.h Wed Jul 11 11:26:33 2007
@@ -107,8 +107,9 @@
AddrOf, Deref, // [C99 6.5.3.2] Address and indirection operators.
Plus, Minus, // [C99 6.5.3.3] Unary arithmetic operators.
Not, LNot, // [C99 6.5.3.3] Unary arithmetic operators.
+ SizeOf, AlignOf, // [C99 6.5.3.4] Sizeof (expr, not type) operator.
Real, Imag, // "__real expr"/"__imag expr" Extension.
- SizeOf, AlignOf // [C99 6.5.3.4] Sizeof (expr, not type) operator.
+ AddrLabel // && label Extension.
};
UnaryOperator(Expr *input, Opcode opc)
More information about the cfe-commits
mailing list