Check builtin function possible immediate argument

Hi All,

I have builtin functions whose argument could be variable or immediate (constant), and I would like to
check the range of argument if it’s immediate. Sema::SemaBuiltinConstantArgRange [1] more or less
fits my need. But seems it requires the argument must be immediate, it will throw “argument must be
constant” otherwise.

I am wondering if there is other function achieve my goal, or my understanding about SemaBuiltinConstantArgRange
is wrong. Thanks.

[1] https://clang.llvm.org/doxygen/SemaChecking_8cpp_source.html

Regards,
chenwj

Hi,

Does Expr::isIntegerConstantExpr fit your need?

vedant