[llvm-commits] [llvm] r104419 - in /llvm/trunk: include/llvm/CodeGen/ISDOpcodes.h include/llvm/Intrinsics.td lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp lib/Target/ARM/ARMBaseInstrInfo.cpp lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h lib/Target/ARM/ARMInstrInfo.td lib/Target/ARM/ARMInstrThumb.td

Jim Grosbach grosbach at apple.com
Thu May 27 08:05:59 PDT 2010


On May 27, 2010, at 1:04 AM, John McCall wrote:

> On May 21, 2010, at 6:06 PM, Jim Grosbach wrote:
>> Modified: llvm/trunk/include/llvm/Intrinsics.td
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Intrinsics.td?rev=104419&r1=104418&r2=104419&view=diff
>> ==============================================================================
>> --- llvm/trunk/include/llvm/Intrinsics.td (original)
>> +++ llvm/trunk/include/llvm/Intrinsics.td Fri May 21 20:06:18 2010
>> @@ -306,11 +306,13 @@
>> def int_eh_dwarf_cfa  : Intrinsic<[llvm_ptr_ty], [llvm_i32_ty]>;
>> 
>> let Properties = [IntrNoMem] in {
>> -  def int_eh_sjlj_setjmp  : Intrinsic<[llvm_i32_ty],  [llvm_ptr_ty]>;
>> -  def int_eh_sjlj_longjmp : Intrinsic<[], [llvm_ptr_ty]>;
>> +  def int_eh_sjlj_setjmp  : Intrinsic<[llvm_i32_ty], [llvm_ptr_ty]>,
>> +                                       GCCBuiltin<"__builtin_setjmp">;
>>  def int_eh_sjlj_lsda    : Intrinsic<[llvm_ptr_ty]>;
>>  def int_eh_sjlj_callsite: Intrinsic<[], [llvm_i32_ty]>;
>> }
>> +def int_eh_sjlj_longjmp : Intrinsic<[], [llvm_ptr_ty], [IntrWriteArgMem]>,
>> +                                     GCCBuiltin<"__builtin_longjmp">;
>> 
>> //===---------------- Generic Variable Attribute Intrinsics----------------===//
>> //
>> 
> 
> Hey, Jim.  This breaks the assumption that Intrinsic::getIntrinsicForGCCBuiltin()
> will return a function whose type is "reasonably similar" to the GCC builtin.
> __builtin_longjmp() has the same signature as longjmp, i.e. it takes two arguments.
> 
> Clang actually relies on this assumption (<rdar://problem/8033657>), although
> apparently we don't test IR gen for __builtin_longjmp in our test suite.
> 


Woops. Quite right. FWIW, there's code to handle code-gen for builtin_setjmp and builtin_longjmp in clang that's currently int an "#if 0" block. It works for arm/darwin with these intrinsics enabled.

eh.sjlj.setjmp has the same signature, but requires some additional front-end logic, so I'll remove the GCCBuiltin tag there, also.

Fixed in r104833.

Thanks for having a look!

-j



More information about the llvm-commits mailing list