[llvm] r333293 - [Tablegen][SubtargetEmitter] Add a default case to the auto-generated switch in MCSubtargetInfo::resolveVariantSchedClass(). NFC
Aaron Ballman via llvm-commits
llvm-commits at lists.llvm.org
Sun May 27 07:00:57 PDT 2018
On Fri, May 25, 2018 at 2:25 PM, Andrea Di Biagio via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: adibiagio
> Date: Fri May 25 11:25:54 2018
> New Revision: 333293
>
> URL: http://llvm.org/viewvc/llvm-project?rev=333293&view=rev
> Log:
> [Tablegen][SubtargetEmitter] Add a default case to the auto-generated switch in MCSubtargetInfo::resolveVariantSchedClass(). NFC
>
> Modified:
> llvm/trunk/utils/TableGen/SubtargetEmitter.cpp
>
> Modified: llvm/trunk/utils/TableGen/SubtargetEmitter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/SubtargetEmitter.cpp?rev=333293&r1=333292&r2=333293&view=diff
> ==============================================================================
> --- llvm/trunk/utils/TableGen/SubtargetEmitter.cpp (original)
> +++ llvm/trunk/utils/TableGen/SubtargetEmitter.cpp Fri May 25 11:25:54 2018
> @@ -1556,7 +1556,9 @@ void SubtargetEmitter::emitSchedModelHel
> OS << " return " << SC.Index << ";\n";
> OS << " break;\n";
> }
> - OS << " };\n";
> + // Add a default case to avoid generating a potentially empty switch.
> + OS << " default : break;\n"
> + << " };\n";
> }
This is now generating MSVC diagnostics about switch statements
containing no case labels and only a default label. Can you please
reformulate this commit to not generate the switch statement at all?
~Aaron
>
> if (OnlyExpandMCInstPredicates) {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list