[PATCH] Add new LLVM_OPTIMIZED_TABLEGEN build setting which configures, builds and uses a release tablegen build when LLVM is configured with assertions enabled.

Chris Bieneman beanz at apple.com
Mon Feb 9 14:52:27 PST 2015


Owen proposed a similar approach internally, but I don’t think that is the right approach.

For one, setting -DNDEBUG on parts (but not all) of the code isn’t safe. We have headers in libSupport that change ifdef on NDEBUG, and that could cause subtle bugs.

Also I don’t like the idea of bleeding the non-debug code into what you might be debugging. It would kinda suck to be debugging something and suddenly lose your debug granularity because you stepped into optimized code.

One of the big appeals to me about using the cross-compiling support for this is it means that your output from a debug build remains the same (barring debug tablegen behaving wildly different from a release one).

-Chris

> On Feb 9, 2015, at 2:28 PM, Reid Kleckner <rnk at google.com> wrote:
> 
> This is the first time I looked at our cross-compling support, and I'd really rather just add -O2 -DNDEBUG to lib/Support, lib/TableGen, and utils/TableGen and call it good. Shelling back out to 'cmake --build' in another config is... pretty hacky.
> 
> 
> http://reviews.llvm.org/D7349
> 
> EMAIL PREFERENCES
>  http://reviews.llvm.org/settings/panel/emailpreferences/
> 
> 





More information about the llvm-commits mailing list