-
Notifications
You must be signed in to change notification settings - Fork 13.6k
llvm-readobj: Use reportFatalUsageError #142039
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
arsenm
merged 1 commit into
main
from
users/arsenm/llvm-readobj/use-reportFatalUsageError
May 30, 2025
Merged
llvm-readobj: Use reportFatalUsageError #142039
arsenm
merged 1 commit into
main
from
users/arsenm/llvm-readobj/use-reportFatalUsageError
May 30, 2025
Conversation
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
This was referenced May 29, 2025
This stack of pull requests is managed by Graphite. Learn more about stacking. |
@llvm/pr-subscribers-llvm-binary-utilities @llvm/pr-subscribers-backend-mips Author: Matt Arsenault (arsenm) ChangesFull diff: https://github.com/llvm/llvm-project/pull/142039.diff 3 Files Affected:
diff --git a/llvm/test/tools/llvm-readobj/COFF/arm64-many-epilogs.s b/llvm/test/tools/llvm-readobj/COFF/arm64-many-epilogs.s
index 50b5fab935139..815e16af9f619 100644
--- a/llvm/test/tools/llvm-readobj/COFF/arm64-many-epilogs.s
+++ b/llvm/test/tools/llvm-readobj/COFF/arm64-many-epilogs.s
@@ -1,6 +1,6 @@
// REQUIRES: aarch64-registered-target
// RUN: llvm-mc -filetype=obj -triple aarch64-windows %s -o - \
-// RUN: | not --crash llvm-readobj --unwind - 2>&1 | FileCheck %s
+// RUN: | not llvm-readobj --unwind - 2>&1 | FileCheck %s
// Older versions of LLVM had a bug where we would accidentally
// truncate the number of epilogue scopes to a uint8_t; make
diff --git a/llvm/test/tools/llvm-readobj/COFF/arm64-win-error2.s b/llvm/test/tools/llvm-readobj/COFF/arm64-win-error2.s
index ede77a168cdc4..5c2e1d008b056 100644
--- a/llvm/test/tools/llvm-readobj/COFF/arm64-win-error2.s
+++ b/llvm/test/tools/llvm-readobj/COFF/arm64-win-error2.s
@@ -6,7 +6,7 @@
// REQUIRES: aarch64-registered-target
// RUN: llvm-mc -filetype=obj -triple aarch64-windows %s -o - \
-// RUN: | not --crash llvm-readobj --unwind - 2>&1 | FileCheck %s
+// RUN: | not llvm-readobj --unwind - 2>&1 | FileCheck %s
// CHECK: LLVM ERROR: Malformed unwind data
diff --git a/llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp b/llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
index ebee841e8acf2..c6e409c63ef3a 100644
--- a/llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
+++ b/llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
@@ -306,7 +306,7 @@ ErrorOr<SymbolRef> Decoder::getSymbolForLocation(
std::string Buf;
llvm::raw_string_ostream OS(Buf);
logAllUnhandledErrors(AddressOrErr.takeError(), OS);
- report_fatal_error(Twine(Buf));
+ reportFatalUsageError(Twine(Buf));
}
// We apply SymbolOffset here directly. We return it separately to allow
// the caller to print it as an offset on the symbol name.
@@ -1094,7 +1094,7 @@ bool Decoder::dumpXDataRecord(const COFFObjectFile &COFF,
// A header is one or two words, followed by at least one word to describe
// the unwind codes. Applicable to both ARM and AArch64.
if (Contents.size() - Offset < 8)
- report_fatal_error(".xdata must be at least 8 bytes in size");
+ reportFatalUsageError(".xdata must be at least 8 bytes in size");
const ExceptionDataRecord XData(Data, isAArch64);
DictScope XRS(SW, "ExceptionData");
@@ -1115,7 +1115,7 @@ bool Decoder::dumpXDataRecord(const COFFObjectFile &COFF,
(XData.E() ? 0 : XData.EpilogueCount() * 4) -
(XData.X() ? 8 : 0)) < (int64_t)ByteCodeLength) {
SW.flush();
- report_fatal_error("Malformed unwind data");
+ reportFatalUsageError("Malformed unwind data");
}
if (XData.E()) {
@@ -1178,7 +1178,7 @@ bool Decoder::dumpXDataRecord(const COFFObjectFile &COFF,
std::string Buf;
llvm::raw_string_ostream OS(Buf);
logAllUnhandledErrors(Name.takeError(), OS);
- report_fatal_error(Twine(Buf));
+ reportFatalUsageError(Twine(Buf));
}
ListScope EHS(SW, "ExceptionHandler");
@@ -1217,7 +1217,7 @@ bool Decoder::dumpUnpackedEntry(const COFFObjectFile &COFF,
std::string Buf;
llvm::raw_string_ostream OS(Buf);
logAllUnhandledErrors(FunctionNameOrErr.takeError(), OS);
- report_fatal_error(Twine(Buf));
+ reportFatalUsageError(Twine(Buf));
}
FunctionName = *FunctionNameOrErr;
}
@@ -1231,7 +1231,7 @@ bool Decoder::dumpUnpackedEntry(const COFFObjectFile &COFF,
std::string Buf;
llvm::raw_string_ostream OS(Buf);
logAllUnhandledErrors(Name.takeError(), OS);
- report_fatal_error(Twine(Buf));
+ reportFatalUsageError(Twine(Buf));
}
SW.printString("ExceptionRecord",
@@ -1276,7 +1276,7 @@ bool Decoder::dumpPackedEntry(const object::COFFObjectFile &COFF,
std::string Buf;
llvm::raw_string_ostream OS(Buf);
logAllUnhandledErrors(FunctionNameOrErr.takeError(), OS);
- report_fatal_error(Twine(Buf));
+ reportFatalUsageError(Twine(Buf));
}
FunctionName = *FunctionNameOrErr;
}
@@ -1375,7 +1375,7 @@ bool Decoder::dumpPackedARM64Entry(const object::COFFObjectFile &COFF,
std::string Buf;
llvm::raw_string_ostream OS(Buf);
logAllUnhandledErrors(FunctionNameOrErr.takeError(), OS);
- report_fatal_error(Twine(Buf));
+ reportFatalUsageError(Twine(Buf));
}
FunctionName = *FunctionNameOrErr;
}
|
nikic
approved these changes
May 29, 2025
a9173ec
to
275abaf
Compare
Base automatically changed from
users/arsenm/codegen/convert-some-uses-reportFatalUsageError
to
main
May 30, 2025 06:06
d27c5f8
to
946da8c
Compare
sivan-shani
pushed a commit
to sivan-shani/llvm-project
that referenced
this pull request
Jun 3, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.