[llvm-dev] Request to merge r242372 into the 3.7 branch: Fix for C API incompatibility between 3.6 and 3.7.
Tom Stellard via llvm-dev
llvm-dev at lists.llvm.org
Mon Nov 9 09:29:34 PST 2015
On Wed, Oct 28, 2015 at 05:32:17AM +0000, Eric Christopher wrote:
> On Tue, Oct 27, 2015 at 8:15 PM Chris Lattner <sabre at nondot.org> wrote:
>
> >
> > > On Oct 27, 2015, at 8:10 AM, Tom Stellard <tom at stellard.net> wrote:
> > >
> > > Hi Chris,
> > >
> > > I would like to get your opinion on merging r242372
> > > (http://reviews.llvm.org/rL242372) into the 3.7 branch.
> > > The signature of the C API function LLVMBuildLandingPad
> > > changed from the 3.6.0 to 3.7.0 release, so the C API
> > > is currently incompatible between these to releases.
> >
> > This is a narrow enough API that it is probably only used by a few
> > clients. I’d be happy for us to do whatever those clients would like to
> > see with this.
> >
>
> Normally I'd prefer not to change API in a point release, but I think it's
> fine to change it back here to match the previous releases and current
> trunk. Just needs something in the release notes.
>
Adding the correct llvm-dev list this time...
I've just realized that this patch changes the ABI and would make 3.7.0 and 3.7.1
binary incompatible. I think breaking the stable ABI is worse than breaking the C API,
so I would prefer to either drop this patch or come up with a work-around.
One possible work-around would be to keep the LLVMBuildLandingPad signature the
same and then add this to Core.h:
#ifdef DEBUG // Not sure whether we should use this or ifndef NDEBUG
#define LLVMBuildLandingPad(B, Ty, PersFn, Name) \
dbgs() << "Warning: PersnFn parameter ignored. You must explicitly set the " \
"personality function on the parent function with " \
" LLVMSetPersonalityFn(). This behavior changed in LLVM 3.7"; \
LLVMBuildLandingPad(B, Ty, Name)
#else
#define LLVMBuildLandingPad(B, Ty, PersFn, Name)
LLVMBuildLandingPad(B, Ty, Name);
I'm open to other suggestions. What do people think about this?
-Tom
>
>
> >
> > -Chris
> >
> > >
> > > Merging this commit will make the 3.7.1 C API compatible
> > > with 3.6.x and current trunk, but it will make the 3.7.1 C API
> > > incompatible with 3.7.0.
> > >
> > > Not merging this commit will mean the 3.7.x C API will
> > > be incompatible with 3.6.x and current trunk, but
> > > the C API for 3.7.0 and 3.7.1 will be compatible.
> > >
> > > It took me a while to wrap my head around this, let me know if you have
> > > any questions.
> > >
> > > -Tom
> >
> >
More information about the llvm-dev
mailing list