Skip to content

Commit 3c2e614

Browse files
authored
[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 <[email protected]> Co-authored-by: Troy-Butler <[email protected]>
1 parent 57f0284 commit 3c2e614

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/Target/AArch64/AArch64InstrInfo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,7 @@ static inline unsigned getAUTOpcodeForKey(AArch64PACKey::ID K, bool Zero) {
725725
case DA: return Zero ? AArch64::AUTDZA : AArch64::AUTDA;
726726
case DB: return Zero ? AArch64::AUTDZB : AArch64::AUTDB;
727727
}
728+
llvm_unreachable("Unhandled AArch64PACKey::ID enum");
728729
}
729730

730731
/// 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) {
737738
case DA: return Zero ? AArch64::PACDZA : AArch64::PACDA;
738739
case DB: return Zero ? AArch64::PACDZB : AArch64::PACDB;
739740
}
741+
llvm_unreachable("Unhandled AArch64PACKey::ID enum");
740742
}
741743

742744
// struct TSFlags {

0 commit comments

Comments
 (0)