[llvm] r333293 - [Tablegen][SubtargetEmitter] Add a default case to the auto-generated switch in MCSubtargetInfo::resolveVariantSchedClass(). NFC
Andrea Di Biagio via llvm-commits
llvm-commits at lists.llvm.org
Fri May 25 11:25:54 PDT 2018
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";
}
if (OnlyExpandMCInstPredicates) {
More information about the llvm-commits
mailing list