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/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index b595ad7..fc412a6 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1470,11 +1470,7 @@
     default:
       InitializerElementNotConstant(Init);
       return true;
-    case UnaryOperator::SizeOf:
-    case UnaryOperator::AlignOf:
     case UnaryOperator::OffsetOf:
-      // sizeof(E) is a constantexpr if and only if E is not evaluted.
-      // See C99 6.5.3.4p2 and 6.6p3.
       if (Exp->getSubExpr()->getType()->isConstantSizeType())
         return false;
       InitializerElementNotConstant(Init);
@@ -1487,14 +1483,14 @@
       return CheckArithmeticConstantExpression(Exp->getSubExpr());
     }
   }
-  case Expr::SizeOfAlignOfTypeExprClass: {
-    const SizeOfAlignOfTypeExpr *Exp = cast<SizeOfAlignOfTypeExpr>(Init);
+  case Expr::SizeOfAlignOfExprClass: {
+    const SizeOfAlignOfExpr *Exp = cast<SizeOfAlignOfExpr>(Init);
     // Special check for void types, which are allowed as an extension
-    if (Exp->getArgumentType()->isVoidType())
+    if (Exp->getTypeOfArgument()->isVoidType())
       return false;
     // alignof always evaluates to a constant.
     // FIXME: is sizeof(int[3.0]) a constant expression?
-    if (Exp->isSizeOf() && !Exp->getArgumentType()->isConstantSizeType()) {
+    if (Exp->isSizeOf() && !Exp->getTypeOfArgument()->isConstantSizeType()) {
       InitializerElementNotConstant(Init);
       return true;
     }