[cfe-commits] r129652 - in /cfe/trunk: lib/CodeGen/CGCleanup.cpp lib/CodeGen/CGStmt.cpp lib/CodeGen/CodeGenFunction.h test/CodeGen/switch-dce.c
Chris Lattner
clattner at apple.com
Tue Apr 19 13:58:34 PDT 2011
On Apr 19, 2011, at 1:29 PM, John McCall wrote:
>> + // If the body of the case is just a 'break', try to not emit an empty block.
>> + if (isa<BreakStmt>(S.getSubStmt())) {
>> + JumpDest Block = BreakContinueStack.back().BreakBlock;
>> +
>> + // Only do this optimization if there are no cleanups that need emitting.
>> + if (isObviouslyBranchWithoutCleanups(Block)) {
>> + llvm::APSInt CaseVal = S.getLHS()->EvaluateAsInt(getContext());
>
> This is common between these two code paths and would be nice to hoist.
Ok, r129808
-Chris
More information about the cfe-commits
mailing list