[llvm] [llvm-ifs] Treat unknown symbol types as error. (PR #75872)

via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 19 11:15:54 PST 2023


================
@@ -201,6 +201,12 @@ Expected<std::unique_ptr<IFSStub>> ifs::readIFSFromBuffer(StringRef Buf) {
           "IFS arch '" + *Stub->Target.ArchString + "' is unsupported");
     Stub->Target.Arch = eMachine;
   }
+  for (const auto &item : Stub->Symbols) {
+    if (item.Type == IFSSymbolType::Unknown)
+      return createStringError(
+          std::make_error_code(std::errc::invalid_argument),
+          "IFS symbol type for symbol '" + item.Name + "' is unsupported");
----------------
zeroomega wrote:

The error message I used here matches the error message used https://github.com/llvm/llvm-project/pull/75872/files/3374f89d95e7888e0edb01a205cb2b4c85185265#diff-2d9e2d92eeaa1f78b0ff93f60f50e82c16f9adc6ef19768ef750e5c888c6f32eR201
I can create a separate PR to change the error messages of those cases if you prefer.

https://github.com/llvm/llvm-project/pull/75872


More information about the llvm-commits mailing list