Displaying 20 results from an estimated 33 matches for "llvm_enable_assert".
Did you mean:
llvm_enable_asserts
2020 Apr 09
7
[RFC] Usage of NDEBUG as a guard for non-assert debug code
Hi all,
During discussions about assertions in the Flang project, we noticed that there are a lot of cases in LLVM that #ifndef NDEBUG is used as a guard for non-assert code that we want enabled in debug builds.
This works fine on its own, however it affects the behaviour of LLVM_ENABLE_ASSERTIONS; since NDEBUG controls whether assertions are enabled or not, a lot of debug code gets enabled in addition to asserts if you specify this flag. This goes contrary to the name of the flag I believe also its intention. Specifically in Flang we have a case where someone wants to ship a build with...
2020 Apr 09
2
[RFC] Usage of NDEBUG as a guard for non-assert debug code
...uristic of whether or not a build is a debug build, especially since no
> other options are provided. I appreciate your desire, but I think it’d be
> unfortunate if the build system grew yet another flag to control debugness.
>
>
>
> As far as I can tell, as it currently works, LLVM_ENABLE_ASSERTIONS
> just makes sure that NDEBUG is not defined, even in release builds. So if I
> do -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=TRUE, I’ll get an
> optimized build with no debug symbols but with asserts enabled, which in my
> mind isn’t a terribly useful thing to have.
>...
2009 Jun 03
2
[LLVMdev] CMake build maturity
...lf a
>> "Release-Asserts build" while all asserts are thrown away, hmmm :)
>
> Yeah, that's "Release-Asserts" as in "Release minus asserts".
>
> This has caused confusion before...
Committed a change for the cmake build that implements the option
LLVM_ENABLE_ASSERTS. Defaults to ON if and only if CMAKE_BUILD_TYPE is
Release.
--
Óscar
2009 Jun 04
0
[LLVMdev] CMake build maturity
Hi,
> Committed a change for the cmake build that implements the option
> LLVM_ENABLE_ASSERTS. Defaults to ON if and only if CMAKE_BUILD_TYPE is
> Release.
Thanks! I think it might be nice to make this a bit more consistent
with Makefile.config. I'd suggest...
- use LLVM_DISABLE_ASSERTIONS instead of LLVM_ENABLE_ASSERTS
- have it default to OFF (so assertions are enabled) always
-...
2009 Jun 04
2
[LLVMdev] CMake build maturity
Jay Foad <jay.foad at gmail.com> writes:
>> Committed a change for the cmake build that implements the option
>> LLVM_ENABLE_ASSERTS. Defaults to ON if and only if CMAKE_BUILD_TYPE is
>> Release.
>
> Thanks! I think it might be nice to make this a bit more consistent
> with Makefile.config. I'd suggest...
>
> - use LLVM_DISABLE_ASSERTIONS instead of LLVM_ENABLE_ASSERTS
Okay.
> - have it default to...
2015 Jul 21
2
[LLVMdev] Problem with InsertPointGuard ABI?
...> > without
> > > NDEBUG.
> >
> > FWIW, `llvm-config --assertion-mode` will tell you whether or not
> your
> > LLVM was built with or without NDEBUG.
> >
> > That's not true in all cases. In case CMAKE_BUILD_TYPE=Release,
> > LLVM_ENABLE_ASSERTIONS=Off and CMAKE_CXX_FLAGS_RELEASE="" llvm-config
> reports
> > asserts as off but NDEBUG flag is not set.
>
> Um, okay, but why would you set CMAKE_CXX_FLAGS_RELEASE=""? That doesn't
> make any sense...
>
I agree, it make no sense. But homebrew actual...
2015 Jul 21
2
[LLVMdev] Problem with InsertPointGuard ABI?
...there is not reliable way of checking if LLVM has been built with or
> without
> > NDEBUG.
>
> FWIW, `llvm-config --assertion-mode` will tell you whether or not your
> LLVM was built with or without NDEBUG.
>
That's not true in all cases. In case CMAKE_BUILD_TYPE=Release,
LLVM_ENABLE_ASSERTIONS=Off and CMAKE_CXX_FLAGS_RELEASE="" llvm-config
reports asserts as off but NDEBUG flag is not set.
>
> > Can I do anything more about it? Contributions related to
> > LLVM_ENABLE_ABI_BREAKING_CHECKS needed?
> >
> > - Paweł
> >
> > _____________...
2017 Oct 04
3
Question: Should we consider valid a variable defined #ifndef NDEBUG scope and used in assert?
...ike this:
#ifndef NDEBUG
// Define some variable.
#endif
assert(/*use this variable, i.e., outside of the ifndef NDEBUG scope*/);
This happens in include/llvm/IR/ValueHandle.h for the variable Poisoned line 494
This works because when we build LLVM with assert we explicitly disable NDEBUG:
if( LLVM_ENABLE_ASSERTIONS )
[…]
# On non-Debug builds cmake automatically defines NDEBUG, so we
# explicitly undefine it:
if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
add_definitions( -UNDEBUG )
If we use this header in a different project and thus, with potentially different rules for ma...
2014 Apr 10
2
[LLVMdev] CMake configuration: Detecting zlib.h header in windows.
...t variables to point to zlib
headers and libraries. Cmake version is 2.8.12.2
cmake -G "Visual Studio 12" -D LLVM_TARGETS_TO_BUILD:STRING=%TARG% -D
TARGET_TRIPLE:STRING=%TRIPLE% -D
LLVM_DEFAULT_TARGET_TRIPLE:STRING=%TRIPLE% -D
LLVM_TARGET_ARCH:STRING=%TRIPLE% -D LLVM_ENABLE_PIC:BOOL=ON -D
LLVM_ENABLE_ASSERTIONS:BOOL=ON -D
CMAKE_INSTALL_PREFIX=%win_top_install_dir% -D CMAKE_BUILD_TYPE=%BLDMODE%
-DLLVM_APPEND_VC_REV:BOOL=ON -D LLVM_VENDOR_NAME:STRING=%NAME% -D
LLVM_VENDOR_VERSION:STRING=%VER% %win_top_src_dir%/llvm
As far as I know, cmake tries to compile a simple file with "#include
<zlib.h&g...
2009 Jun 04
0
[LLVMdev] CMake build maturity
>> Thanks! I think it might be nice to make this a bit more consistent
>> with Makefile.config. I'd suggest...
>>
>> - use LLVM_DISABLE_ASSERTIONS instead of LLVM_ENABLE_ASSERTS
>
> Okay.
I meant ...DISABLE... instead of ...ENABLE...!
>> I don't think -UNDEBUG has any effect, because NDEBUG won't have been
>> defined in the first place
>
> Right. For Release builds, cmake automatically defines NDEBUG.
OK, I didn't know that!
Thanks,...
2020 Apr 10
2
[RFC] Usage of NDEBUG as a guard for non-assert debug code
...hat might break in some
>configuration such as IndVarSimplify. I understand NDEBUG as `remove
>all the code only useful for developers`, independent of whether we
>also want debug symbols.
>
>I'd find it more useful to discuss what should NOT be covered under
>the blanket term LLVM_ENABLE_ASSERTIONS. Example from the past are
>LLVM_ENABLE_STATS and LLVM_ENABLE_DUMP that once was also using
>NDEBUG.
+1 for bring up this topic.
The code base sometimes uses #ifdef NDEBUG to guard the definitions of
some struct/class members and functions.
This means there are inherent ABI incompati...
2012 Jul 07
0
[LLVMdev] Crash using the JIT on x86 but work on x64
...nd Clang for
> compiling it. My code work perfectly, as expected on x64, but crash on x86. I’m
> on Windows 7 x64 and LLVM + Clang was compiled using Visual Studio 2010 (tested
> in both Release and Debug build). Project was make using CMake.
did you build LLVM with assertions enabled? -DLLVM_ENABLE_ASSERTIONS=true. (I
don't recall if cmake Debug build enables assertions by default).
Ciao, Duncan.
2017 Oct 04
2
Question: Should we consider valid a variable defined #ifndef NDEBUG scope and used in assert?
...e variable.
> #endif
>
> assert(/*use this variable, i.e., outside of the ifndef NDEBUG scope*/);
>
> This happens in include/llvm/IR/ValueHandle.h for the variable Poisoned line 494
>
> This works because when we build LLVM with assert we explicitly disable NDEBUG:
> if( LLVM_ENABLE_ASSERTIONS )
> […]
> # On non-Debug builds cmake automatically defines NDEBUG, so we
> # explicitly undefine it:
> if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
> add_definitions( -UNDEBUG )
>
> If we use this header in a different project and thus, with...
2014 Sep 02
2
[LLVMdev] migrating from autoconf to cmake+ninja
...PM, Mueller-Roemer, Johannes Sebastian
<Johannes.Sebastian.Mueller-Roemer at igd.fraunhofer.de> wrote:
> prefix = CMAKE_INSTALL_PREFIX
> enabled-shared = BUILD_SHARED_LIBS
> targets = LLVM_TARGETS_TO_BUILD (defaults to all, or use a semicolon separated list)
> disable-assertions = LLVM_ENABLE_ASSERTIONS (obviously inverted ;)
>
> I don't believe the others have direct equivalents, however debug/optimized is chosen via CMAKE_BUILD_TYPE
Thank you. I found
http://llvm.org/docs/CMake.html#options-and-variables and gonna
try out cmake -G ninja.
> -----Original Message-----
> From:...
2012 Jul 07
2
[LLVMdev] Crash using the JIT on x86 but work on x64
Hi, so yes assertions are enabled by default in Debug from what i could see
in the CMakeLists.txt
if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
option(LLVM_ENABLE_ASSERTIONS "Enable assertions" OFF)
else()
option(LLVM_ENABLE_ASSERTIONS "Enable assertions" ON)
endif()
Without assertions enabled, when i'm running the program without the
debugger, it simply freeze until i close it, but not crash at all.
Here is the call stack for the x86 D...
2014 Aug 27
2
[LLVMdev] migrating from autoconf to cmake+ninja
I want to start using cmake+ninja instead of autoconf for configuring
and building llvm from svn, but I have no idea how to map my existing
list of autoconf flags to cmake.
Here's how I run ./configure right now in the top directory:
PREFIX=_some_prefix_dir_ \
../llvm/configure \
--prefix=$PREFIX \
--libdir=$PREFIX/lib/llvm \
--sysconfdir=$PREFIX/etc \
--enable-shared \
2014 Jul 18
2
[LLVMdev] Fixing LLVM's CMake interface before LLVM3.5 release
>> I am happy to start writing a patch for the documentation
>
> Thanks. Please Cc me for review.
Will do.
>> # LLVM_BUILD_* values available only from LLVM build tree.
>
> Those were created to simplify building Clang locally against a
> LLVM build tree. Clang needs the LLVM source and build trees too,
> so this gives it that information. No information is
2017 Oct 14
2
darwin bootstrap failure
...; If this isn't your case, could you send me the actual commands you ran?
>
> In the meantime, you can add -DLLVM_FOURCE_ENABLE_DUMP=ON to your cmake
> invocation which should guarantee LLVM_ENABLE_DUMP is defined.
>
> hth...
> don
>
>
Don,
Did you try a build with
-DLLVM_ENABLE_ASSERTIONS:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=Release?
Jack
On Sat, Oct 14, 2017 at 9:36 AM, Jack Howarth <howarth.mailing.lists at gmail.
> com> wrote:
>
>>
>>
>> On Sat, Oct 14, 2017 at 11:38 AM, Don Hinton <hintonda at gmail.com> wrote:
>>
>>>...
2009 Jun 01
0
[LLVMdev] CMake build maturity
Paul Melis wrote:
> Just checked: yup, there's plenty of assert()'s in the headers, so
> -D_DEBUG will keep those alive.
>
> Interestingly, when configuring with --enable-optimized and
> --disable-assertions the resulting compilation calls itself a
> "Release-Asserts build" while all asserts are thrown away, hmmm :)
Yeah, that's "Release-Asserts"
2009 Jun 04
1
[LLVMdev] CMake build maturity
Jay Foad <jay.foad at gmail.com> writes:
>>> Thanks! I think it might be nice to make this a bit more consistent
>>> with Makefile.config. I'd suggest...
>>>
>>> - use LLVM_DISABLE_ASSERTIONS instead of LLVM_ENABLE_ASSERTS
>>
>> Okay.
>
> I meant ...DISABLE... instead of ...ENABLE...!
The `configure' script accepts --enable-x and --disable-x. CMake uses
-DX=ON and -DX=OFF. For consistency, I chose to follow the naming scheme
LLVM_ENABLE_X for all the switches supported by the cmake build.
[sn...