Overload IntExprEvaluator::Success() with a function that takes a CharUnits
parameter to tidy up the places where the expression is a size.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127454 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index c8f4703..f421671 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -953,6 +953,11 @@
     return true;
   }
 
+  bool Success(CharUnits Size, const Expr *E) {
+    return Success(Size.getQuantity(), E);
+  }
+
+
   bool Error(SourceLocation L, diag::kind D, const Expr *E) {
     // Take the first error.
     if (Info.EvalResult.Diag == 0) {
@@ -1213,7 +1218,7 @@
     Size -= Offset;
   else
     Size = CharUnits::Zero();
-  return Success(Size.getQuantity(), E);
+  return Success(Size, E);
 }
 
 bool IntExprEvaluator::VisitCallExpr(CallExpr *E) {
@@ -1602,9 +1607,9 @@
   // Handle alignof separately.
   if (!E->isSizeOf()) {
     if (E->isArgumentType())
-      return Success(GetAlignOfType(E->getArgumentType()).getQuantity(), E);
+      return Success(GetAlignOfType(E->getArgumentType()), E);
     else
-      return Success(GetAlignOfExpr(E->getArgumentExpr()).getQuantity(), E);
+      return Success(GetAlignOfExpr(E->getArgumentExpr()), E);
   }
 
   QualType SrcTy = E->getTypeOfArgument();
@@ -1625,7 +1630,7 @@
     return false;
 
   // Get information about the size.
-  return Success(Info.Ctx.getTypeSizeInChars(SrcTy).getQuantity(), E);
+  return Success(Info.Ctx.getTypeSizeInChars(SrcTy), E);
 }
 
 bool IntExprEvaluator::VisitOffsetOfExpr(const OffsetOfExpr *E) {
@@ -1694,7 +1699,7 @@
     }
     }
   }
-  return Success(Result.getQuantity(), E);
+  return Success(Result, E);
 }
 
 bool IntExprEvaluator::VisitUnaryOperator(const UnaryOperator *E) {