[PATCH] [Verifier] Assert gc_relocate always return a pointer type

Chen Li meloli87 at gmail.com
Wed May 13 12:07:46 PDT 2015


In http://reviews.llvm.org/D9695#172229, @pgavlin wrote:

> Please add a test case for the first assert as well (i.e. a case where relocate is returning a non-pointer type).


Hi Pat,

After some digging, I found that the first assert is actually unnecessary. 
gc_relocate is defined to return a pointer type in intrinsics.td:

  def int_experimental_gc_relocate : Intrinsic<[llvm_anyptr_ty],
                                  [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty]>;

and verifier would verify it through VerifyIntrinsicType(). I think I will just modify the first assert to check the relocated value must be pointer type.

I will add two more tests. One to assert VerifyIntrinsicType() fails when gc_relocate's return type is not pointer type. Another one to assert relocated value is pointer type.

Does this sound good to you?


http://reviews.llvm.org/D9695

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list