[LLVMdev] [llvm-commits] [polly] r138203 - /polly/trunk/lib/Support/GICHelper.cpp

David Blaikie dblaikie at gmail.com
Sat Aug 20 10:15:28 PDT 2011


> -  std::string string(isl_printer_get_str(p));
> +  char *char_str = isl_printer_get_str(p);
> +  std::string string(char_str);
> +  free(char_str);

This got me wondering: If this were compiled with exceptions it
wouldn't be safe (std::string's ctor could throw & then the free
wouldn't be called), but I know LLVM doesn't use exceptions in its
codebase.

Are exceptions actually disabled in the build? (I assume so)
How are memory allocation failures handled?
How do the standard library types function in the absence of
exceptions? (I've seen Howard Hinnant checking in changes to libc++ to
support cases where exceptions are disabled & I was wondering what
sort of semantics he (& libstdc++ too) provide when exceptions are
disabled).

- David




More information about the llvm-dev mailing list