From 4e64d31bc5f3acbb9dd104dd4ae7ef492d4fe031 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 21 Nov 2018 20:44:18 +0000 Subject: Re-Reinstate 347294 with a fix for the failures. Don't try to emit a scalar expression for a non-scalar argument to __builtin_constant_p(). Third time's a charm! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347417 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaInit.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/Sema/SemaInit.cpp') diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 3184be8038..1294606008 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -8050,8 +8050,9 @@ ExprResult InitializationSequence::Perform(Sema &S, break; } - llvm::APSInt Result; - Init->EvaluateAsInt(Result, S.Context); + Expr::EvalResult EVResult; + Init->EvaluateAsInt(EVResult, S.Context); + llvm::APSInt Result = EVResult.Val.getInt(); const uint64_t SamplerValue = Result.getLimitedValue(); // 32-bit value of sampler's initializer is interpreted as // bit-field with the following structure: -- cgit v1.2.1