diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2008-11-11 17:56:53 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2008-11-11 17:56:53 +0000 |
commit | 0518999d3adcc289997bd974dce90cc97f5c1c44 (patch) | |
tree | b37c751f8fee36d162d7bf009aaa64d22e64910c /lib/Parse/ParseExpr.cpp | |
parent | 8f5aab696173cc6e9c9963635d91dc2e83d54442 (diff) |
Introduce a single AST node SizeOfAlignOfExpr for all sizeof and alignof expressions, both of values and types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59057 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExpr.cpp')
-rw-r--r-- | lib/Parse/ParseExpr.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index df55bf79fc..467eef03b6 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -764,9 +764,10 @@ Parser::ExprResult Parser::ParseSizeofAlignofExpression() { // If ParseParenExpression parsed a '(typename)' sequence only, the this is // sizeof/alignof a type. Otherwise, it is sizeof/alignof an expression. if (ExprType == CastExpr) - return Actions.ActOnSizeOfAlignOfTypeExpr(OpTok.getLocation(), - OpTok.is(tok::kw_sizeof), - LParenLoc, CastTy, RParenLoc); + return Actions.ActOnSizeOfAlignOfExpr(OpTok.getLocation(), + OpTok.is(tok::kw_sizeof), + /*isType=*/true, CastTy, + SourceRange(LParenLoc, RParenLoc)); // If this is a parenthesized expression, it is the start of a // unary-expression, but doesn't include any postfix pieces. Parse these @@ -776,8 +777,10 @@ Parser::ExprResult Parser::ParseSizeofAlignofExpression() { // If we get here, the operand to the sizeof/alignof was an expresion. if (!Operand.isInvalid) - Operand = Actions.ActOnUnaryOp(OpTok.getLocation(), OpTok.getKind(), - Operand.Val); + Operand = Actions.ActOnSizeOfAlignOfExpr(OpTok.getLocation(), + OpTok.is(tok::kw_sizeof), + /*isType=*/false, Operand.Val, + SourceRange()); return Operand; } |