================
@@ -3924,10 +3924,18 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok,
Scope *UDLScope) {
// to get the integer value from an overly-wide APInt is *extremely*
// expensive, so the naive approach of assuming
// llvm::IntegerType::MAX_INT_BITS is a big performance hit.
- unsigned BitsNeeded =
- Literal.isBitInt ? llvm::APInt::getSufficientBitsNeeded(
- Literal.getLiteralDigits(), Literal.getRadix())
- : Context.getTargetInfo().getIntMaxTWidth();
+ unsigned BitsNeeded = Context.getTargetInfo().getIntMaxTWidth();
+ if (Literal.isBitInt)
+ BitsNeeded = llvm::APInt::getSufficientBitsNeeded(
+ Literal.getLiteralDigits(), Literal.getRadix());
+ if (Literal.MicrosoftInteger) {
+ if (Literal.MicrosoftInteger == 128 &&
----------------
Fznamznon wrote:
Do we really have to check `Literal.MicrosoftInteger` two times?
```suggestion
if (Literal.MicrosoftInteger == 128 &&
```
https://github.com/llvm/llvm-project/pull/130993
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits