[llvm] [InlineAsm] wrap ConstraintCode in enum class NFC (PR #66003)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 13 02:05:05 PDT 2023


================
@@ -17395,13 +17395,13 @@ RISCVTargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
   return Res;
 }
 
-unsigned
+InlineAsm::ConstraintCode
 RISCVTargetLowering::getInlineAsmMemConstraint(StringRef ConstraintCode) const {
   // Currently only support length 1 constraints.
   if (ConstraintCode.size() == 1) {
     switch (ConstraintCode[0]) {
     case 'A':
-      return InlineAsm::Constraint_A;
+      return InlineAsm::ConstraintCode::A;
----------------
RKSimon wrote:

Yes - if somebody wants to replace switches with if-else then that should be in a followup patch. But even then, my preference would be to consistently keep to the switch pattern.

https://github.com/llvm/llvm-project/pull/66003


More information about the llvm-commits mailing list