[llvm-dev] llvm_any_ty equivalent in builtins

Friedman, Eli via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 6 15:21:51 PDT 2018


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



More information about the llvm-dev mailing list