Dounia Khaldi via llvm-dev
2018-Aug-06 21:04 UTC
[llvm-dev] llvm_any_ty equivalent in builtins
Hello, I have two intrinsics that take llvm_any_ty as an argument type (RV in one intrinsic and as an LValue in the other). What should be the equivalent builtin definition for this intrinsic? Is dot "." the appropriate one to use? Thanks, Dounia -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180806/7681bc8f/attachment.html>
Friedman, Eli via llvm-dev
2018-Aug-06 22:21 UTC
[llvm-dev] llvm_any_ty equivalent in builtins
On 8/6/2018 2:04 PM, Dounia Khaldi via llvm-dev wrote:> Hello, > > I have two intrinsics that take llvm_any_ty as an argument type (RV in > one intrinsic and as an LValue in the other). > What should be the equivalent builtin definition for this intrinsic? > Is dot "." the appropriate one to use?There isn't any true equivalent to llvm_any_ty in clang, because it usually doesn't really make sense; a function usually has to have a specific type. But you can use the "t" flag in Builtins.def to turn off normal type-checking, implement custom rules in Sema::CheckBuiltinFunctionCall, and implement custom code generation in CGBuiltin. See, for example, __sync_fetch_and_add. -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project