[llvm] [llvm][AArch64] Add missing default cases (PR #89930)

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 24 06:46:21 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-aarch64

Author: Troy Butler (Troy-Butler)

<details>
<summary>Changes</summary>

Addresses issue #<!-- -->89709.

Functions getAUTOpcodeForKey() and getPACOpcodeForKey() contain switch statements without default cases. Resolved by adding a default case.

---
Full diff: https://github.com/llvm/llvm-project/pull/89930.diff


1 Files Affected:

- (modified) llvm/lib/Target/AArch64/AArch64InstrInfo.h (+2) 


``````````diff
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.h b/llvm/lib/Target/AArch64/AArch64InstrInfo.h
index 9a2914891675c5..fe4943ab43cc8f 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.h
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.h
@@ -724,6 +724,7 @@ static inline unsigned getAUTOpcodeForKey(AArch64PACKey::ID K, bool Zero) {
   case IB: return Zero ? AArch64::AUTIZB : AArch64::AUTIB;
   case DA: return Zero ? AArch64::AUTDZA : AArch64::AUTDA;
   case DB: return Zero ? AArch64::AUTDZB : AArch64::AUTDB;
+  default: return 0;
   }
 }
 
@@ -736,6 +737,7 @@ static inline unsigned getPACOpcodeForKey(AArch64PACKey::ID K, bool Zero) {
   case IB: return Zero ? AArch64::PACIZB : AArch64::PACIB;
   case DA: return Zero ? AArch64::PACDZA : AArch64::PACDA;
   case DB: return Zero ? AArch64::PACDZB : AArch64::PACDB;
+  default: return 0;
   }
 }
 

``````````

</details>


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


More information about the llvm-commits mailing list