[cfe-commits] r153550 - in /cfe/trunk: include/clang/Driver/CC1Options.td include/clang/Driver/Options.td include/clang/Frontend/CodeGenOptions.h lib/CodeGen/CGExpr.cpp lib/Driver/Tools.cpp lib/Frontend/CompilerInvocation.cpp test/CodeGenCXX/pr12251.cpp

Chris Lattner clattner at apple.com
Tue Mar 27 17:03:31 PDT 2012


On Mar 27, 2012, at 4:58 PM, Chandler Carruth wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=153550&view=rev
> Log:
> Move the emission of strict enum range metadata behind a flag (the same
> flag as GCC uses: -fstrict-enums). There is a *lot* of code making
> unwarranted assumptions about the underlying type of enums, and it
> doesn't seem entirely reasonable to eagerly break all of it.
> 
> Much more importantly, the current state of affairs is *very* good at
> optimizing based upon this information, which causes failures that are
> very distant from the actual enum. Before we push for enabling this by
> default, I think we need to implement -fcatch-undefined-behavior support
> for instrumenting and trappig whenever we store or load a value outside
> of the range. That way we can track down the misbehaving code very
> quickly.

This is sad, but I agree that this is the right thing to do.  Thanks Chandler,

-Chris
> 




More information about the cfe-commits mailing list