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
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp
index df55bf7..467eef0 100644
--- a/lib/Parse/ParseExpr.cpp
+++ b/lib/Parse/ParseExpr.cpp
@@ -764,9 +764,10 @@
// 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 @@
// 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;
}