-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[RISCV] Just reporting an error shouldn't generate a crash diagnostic #134040
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a394bf5
Just reporting an error so report_fatal_error won't GenCrashDiag
paulhuggett 3ce1899
Update target-abi-invalid so that it no longer expects crashes
paulhuggett 6cad02c
Tweak a comment so that it makes more sense.
paulhuggett 33c8f67
Ad "gen_crash_diag=" comments.
paulhuggett File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,14 @@ namespace RISCV { | |
| #include "RISCVGenSearchableTables.inc" | ||
| } // namespace RISCV | ||
|
|
||
| // Report an error but don't ask the user to report a bug. | ||
| [[noreturn]] static void reportError(const char *Reason) { | ||
| report_fatal_error(Reason, false); | ||
| } | ||
| [[noreturn]] static void reportError(Error Err) { | ||
| report_fatal_error(std::move(Err), false); | ||
|
||
| } | ||
|
|
||
| namespace RISCVABI { | ||
| ABI computeTargetABI(const Triple &TT, const FeatureBitset &FeatureBits, | ||
| StringRef ABIName) { | ||
|
|
@@ -87,15 +95,15 @@ ABI computeTargetABI(const Triple &TT, const FeatureBitset &FeatureBits, | |
| if ((TargetABI == RISCVABI::ABI::ABI_ILP32E || | ||
| (TargetABI == ABI_Unknown && IsRVE && !IsRV64)) && | ||
| FeatureBits[RISCV::FeatureStdExtD]) | ||
| report_fatal_error("ILP32E cannot be used with the D ISA extension"); | ||
| reportError("ILP32E cannot be used with the D ISA extension"); | ||
|
|
||
| if (TargetABI != ABI_Unknown) | ||
| return TargetABI; | ||
|
|
||
| // If no explicit ABI is given, try to compute the default ABI. | ||
| auto ISAInfo = RISCVFeatures::parseFeatureBits(IsRV64, FeatureBits); | ||
| if (!ISAInfo) | ||
| report_fatal_error(ISAInfo.takeError()); | ||
| reportError(ISAInfo.takeError()); | ||
| return getTargetABI((*ISAInfo)->computeDefaultABI()); | ||
| } | ||
|
|
||
|
|
@@ -127,12 +135,12 @@ namespace RISCVFeatures { | |
|
|
||
| void validate(const Triple &TT, const FeatureBitset &FeatureBits) { | ||
| if (TT.isArch64Bit() && !FeatureBits[RISCV::Feature64Bit]) | ||
| report_fatal_error("RV64 target requires an RV64 CPU"); | ||
| reportError("RV64 target requires an RV64 CPU"); | ||
| if (!TT.isArch64Bit() && !FeatureBits[RISCV::Feature32Bit]) | ||
| report_fatal_error("RV32 target requires an RV32 CPU"); | ||
| reportError("RV32 target requires an RV32 CPU"); | ||
| if (FeatureBits[RISCV::Feature32Bit] && | ||
| FeatureBits[RISCV::Feature64Bit]) | ||
| report_fatal_error("RV32 and RV64 can't be combined"); | ||
| reportError("RV32 and RV64 can't be combined"); | ||
| } | ||
|
|
||
| llvm::Expected<std::unique_ptr<RISCVISAInfo>> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Add
/*gen_crash_diag=*/in front of thefalse