[llvm] 3c2e614 - [llvm][AArch64] Add missing default cases (#89930)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 24 11:04:33 PDT 2024
Author: Troy Butler
Date: 2024-04-24T11:04:28-07:00
New Revision: 3c2e614acd76495fda74f945dddd8bb89ae0f41f
URL: https://github.com/llvm/llvm-project/commit/3c2e614acd76495fda74f945dddd8bb89ae0f41f
DIFF: https://github.com/llvm/llvm-project/commit/3c2e614acd76495fda74f945dddd8bb89ae0f41f.diff
LOG: [llvm][AArch64] Add missing default cases (#89930)
Addresses issue #89709.
Functions getAUTOpcodeForKey() and getPACOpcodeForKey() contain switch
statements without default cases. Resolved by adding a call to
llvm_unreachable() at the end of each function.
---------
Signed-off-by: Troy-Butler <squintik at outlook.com>
Co-authored-by: Troy-Butler <squintik at outlook.com>
Added:
Modified:
llvm/lib/Target/AArch64/AArch64InstrInfo.h
Removed:
################################################################################
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.h b/llvm/lib/Target/AArch64/AArch64InstrInfo.h
index 9a2914891675c5..f434799c3982b4 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.h
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.h
@@ -725,6 +725,7 @@ static inline unsigned getAUTOpcodeForKey(AArch64PACKey::ID K, bool Zero) {
case DA: return Zero ? AArch64::AUTDZA : AArch64::AUTDA;
case DB: return Zero ? AArch64::AUTDZB : AArch64::AUTDB;
}
+ llvm_unreachable("Unhandled AArch64PACKey::ID enum");
}
/// Return PAC opcode to be used for a ptrauth sign using the given key, or its
@@ -737,6 +738,7 @@ static inline unsigned getPACOpcodeForKey(AArch64PACKey::ID K, bool Zero) {
case DA: return Zero ? AArch64::PACDZA : AArch64::PACDA;
case DB: return Zero ? AArch64::PACDZB : AArch64::PACDB;
}
+ llvm_unreachable("Unhandled AArch64PACKey::ID enum");
}
// struct TSFlags {
More information about the llvm-commits
mailing list