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

Justin Bogner mail at justinbogner.com
Mon Feb 9 14:27:48 PST 2015


Chris Bieneman <beanz at apple.com> writes:
> Hi resistor,
>
> This change leverages the cross-compiling functionality in the build
> system to build a release tablegen executable for use during the
> build.
>
> http://reviews.llvm.org/D7349
>
> Files:
>   CMakeLists.txt
>
> Index: CMakeLists.txt
> ===================================================================
> --- CMakeLists.txt
> +++ CMakeLists.txt
> @@ -330,6 +330,11 @@
>    set(DISABLE_LLVM_DYLIB_ATEXIT 1)
>  endif()
>  
> +option(LLVM_OPTIMIZED_TABLEGEN "Force TableGen to be built with optimization" OFF)
> +if(LLVM_OPTIMIZED_TABLEGEN AND LLVM_ENABLE_ASSERTIONS)
> +  set(CMAKE_CROSSCOMPILING ON)
> +endif()
> +

Using CMAKE_CROSSCOMPILING for this is a bit confusing. I think it'd be
clearer to make a new variable, LLVM_USE_HOST_TOOLS (or so), and replace
our current uses of CMAKE_CROSSCOMPILING with it. Then we'd have
something like this:

  if(CMAKE_CROSSCOMPILING OR (LLVM_OPTIMIZED_TABLEGEN AND LLVM_ENABLE_ASSERTIONS))
   set(LLVM_USE_HOST_TOOLS ON)
  endif()

I think this makes the intent a little clearer. WDYT?

Regardless, this LGTM as long as it works for MSVC and Xcode and the like,
with or without my suggestion.



More information about the llvm-commits mailing list