[PATCH] D156154: [clang][ConstExprEmitter] handle IntegerLiterals and IntegralCasts

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 24 11:35:10 PDT 2023


efriedma added a comment.

As a practical matter, I'm not sure this helps much; ExprConstant should be reasonably fast for simple integers.  The performance issues only really show for structs/arrays.  But maybe it helps a little to handle a few of the most common integer expressions.



================
Comment at: clang/lib/CodeGen/CGExprConstant.cpp:1128
     case CK_ConstructorConversion:
+    case CK_IntegralCast:
       return Visit(subExpr, destType);
----------------
This doesn't look right; I suspect this will return an integer with the wrong width.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156154/new/

https://reviews.llvm.org/D156154



More information about the cfe-commits mailing list