[PATCH] D25265: [C API] Add test for D25259 and new LLVMIsExact function.

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 5 16:40:49 PDT 2016


mehdi_amini added a comment.

In https://reviews.llvm.org/D25265#562311, @mjacob wrote:

> In https://reviews.llvm.org/D25265#562294, @mehdi_amini wrote:
>
> > In https://reviews.llvm.org/D25265#562258, @mjacob wrote:
> >
> > > - It adds a new C API function (`LLVMIsExact`) which I don't really care about other than for writing this test.
> > > - It's asymmetric (e.g. missing something like `LLVMSetIsExact`). @deadalnix pointed this out as well.
> >
> >
> > The general question I'd have would be: isn't the ability to round-trip something that is "useful" in general with the C API?
> >  If yes then it seems that the test helped identified the missing `LLVMIsExact`, and it is legit.
> >  Otherwise yeah it isn't great to add API just for being able to fit the testing infrastructure and fit other APIs.
>
>
> Yes, being able to roundtrip is useful. The obvious roundtrip would be through `LLVMIsExact` and `LLVMSetIsExact`. `LLVMSetIsExact` and `LLVMBuildExactUDiv` is less obvious and is what I meant with "asymmetric".


I understood the "asymmetric issue", unfortunately that's something that comes up at the C++ API level as well, so it is not really a C API issue here.

> Sure, if the point was to add `LLVMIsExact` and `LLVMSetIsExact`, the echo test would probably be the perfect place to test this.

My point was rather: the fact that the test is about round-trip pointed a "hole" in the API with the lack of "setIsExact".


https://reviews.llvm.org/D25265





More information about the llvm-commits mailing list