r200545 - Connect -fno-exceptions to -arm-disable-ehabi

Reid Kleckner rnk at google.com
Fri Jan 31 09:53:16 PST 2014


On Fri, Jan 31, 2014 at 6:13 AM, Renato Golin <renato.golin at linaro.org>wrote:

> Author: rengolin
> Date: Fri Jan 31 08:13:20 2014
> New Revision: 200545
>
> URL: http://llvm.org/viewvc/llvm-project?rev=200545&view=rev
> Log:
> Connect -fno-exceptions to -arm-disable-ehabi
>
> Added:
>     cfe/trunk/test/Driver/arm-no-exception.c
> Modified:
>     cfe/trunk/lib/Driver/Tools.cpp
>
> Modified: cfe/trunk/lib/Driver/Tools.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=200545&r1=200544&r2=200545&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Driver/Tools.cpp (original)
> +++ cfe/trunk/lib/Driver/Tools.cpp Fri Jan 31 08:13:20 2014
> @@ -830,6 +830,12 @@ void Clang::AddARMTargetArgs(const ArgLi
>        CmdArgs.push_back("-backend-option");
>        CmdArgs.push_back("-arm-reserve-r9");
>      }
> +
> +    // Exception handling
> +    if (Args.hasArg(options::OPT_fno_exceptions)) {
> +      CmdArgs.push_back("-backend-option");
> +      CmdArgs.push_back("-arm-disable-ehabi");
> +    }
>

I think you want 'Args.hasFlag(options::OPT_fno_exceptions,
options::OPT_fexceptions, false)' in order to make sure that 'clang
-fno-exceptions -fexceptions' produces unwind tables.

I also seem to recall that there are major problems with -backend-option if
you want to run Clang on multiple TUs in the same process.  It causes us to
call llvm::cl::ParseCommandLineOptions twice, which isn't allowed, and bad
things happen.  It doesn't have to be fixed now, but long term it needs to
go away if anyone wants to, say, run a Clang tool over code that normally
uses -fno-exceptions on ARM.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140131/ff85a28d/attachment.html>


More information about the cfe-commits mailing list