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

Bill Wendling via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 11 22:19:24 PDT 2023


================
@@ -2521,13 +2521,13 @@ AVRTargetLowering::getConstraintType(StringRef Constraint) const {
   return TargetLowering::getConstraintType(Constraint);
 }
 
-unsigned
+InlineAsm::ConstraintCode
 AVRTargetLowering::getInlineAsmMemConstraint(StringRef ConstraintCode) const {
   // Not sure if this is actually the right thing to do, but we got to do
   // *something* [agnat]
   switch (ConstraintCode[0]) {
----------------
bwendling wrote:

I know this is just a simple refactoring in this case, but could you turn this into an if-then statement instead? The switch seems unnecessary.

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


More information about the llvm-commits mailing list