-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[llvm][AArch64] Add missing default cases #89930
Conversation
Signed-off-by: Troy-Butler <squintik@outlook.com>
@llvm/pr-subscribers-backend-aarch64 Author: Troy Butler (Troy-Butler) ChangesAddresses 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:
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;
}
}
|
Can you make it an llvm_unreachable, as in getXPACOpcodeForKey? I believe there are only 4 valid values. |
✅ With the latest revision this PR passed the C/C++ code formatter. |
Signed-off-by: Troy-Butler <squintik@outlook.com>
Signed-off-by: Troy-Butler <squintik@outlook.com>
Certainly! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
I don't have merge rights, so if everything looks good, can the last reviewer please merge this into main? Thank you! |
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.