llvm-project
7b652195 - [IR] Add ImplicitTrunc argument to ConstantInt::get() (#170865)

Commit
25 days ago
[IR] Add ImplicitTrunc argument to ConstantInt::get() (#170865) Add an ImplicitTrunc argument to ConstantInt::get(), which allows controlling whether implicit truncation of the value is permitted. This argument currently defaults to true, but will be switched to false in the future to guard against signed/unsigned confusion, similar to what has already happened for APInt. The argument gives an opt-out for cases where the truncation is intended. The patch contains one illustrative example where this happens.
Author
Parents
Loading