efriedma-quic wrote: You might want to look at convertUsersOfConstantsToInstructions, which addresses similar use-cases. (You might be able to use it directly? If not, you can at least reference the implementation.)
Recursively rewriting expression trees should work, and result in well-defined Instructions. We used to have constants with weird constraints, but those are gone in current LLVM. For "normal" code, you should only run into ConstantExpr and subclasses of ConstantAggregate. There are a few other kinds of constant expressions that could show up with specific flags or unusual constructs (ConstantPtrAuth, NoCFIValue, DSOLocalEquivalent, BlockAddress). https://github.com/llvm/llvm-project/pull/138972 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits