From: George Rimar Date: Thu, 5 Sep 2019 08:52:26 +0000 (+0000) Subject: Recommit r371023 "[lib/ObjectYAML] - Stop calling error(1) when mapping the st_other... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=080f69e3bdf847f5a33a0a7c5135a65dee3f3908;p=llvm Recommit r371023 "[lib/ObjectYAML] - Stop calling error(1) when mapping the st_other field of a symbol." Fix: added missing return "return 0;" Original commit message: This eliminates one of the error(1) call in this lib. It is different from the others because happens on a fields mapping stage and can be easily fixed. Differential revision: https://reviews.llvm.org/D67150 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371030 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ObjectYAML/ELFYAML.cpp b/lib/ObjectYAML/ELFYAML.cpp index a81d27eed6b..30d4c0505a9 100644 --- a/lib/ObjectYAML/ELFYAML.cpp +++ b/lib/ObjectYAML/ELFYAML.cpp @@ -894,10 +894,9 @@ struct NormalizedOther { if (to_integer(Name, Val)) return Val; - llvm::WithColor::error() - << "an unknown value is used for symbol's 'Other' field: " << Name - << ".\n"; - exit(1); + YamlIO.setError("an unknown value is used for symbol's 'Other' field: " + + Name); + return 0; } Optional denormalize(IO &) { @@ -942,7 +941,7 @@ struct NormalizedOther { return Map; } - const IO &YamlIO; + IO &YamlIO; Optional> Other; std::string UnknownFlagsHolder; }; diff --git a/test/tools/yaml2obj/elf-symbol-stother.yaml b/test/tools/yaml2obj/elf-symbol-stother.yaml index da771d690df..997a4b0be55 100644 --- a/test/tools/yaml2obj/elf-symbol-stother.yaml +++ b/test/tools/yaml2obj/elf-symbol-stother.yaml @@ -4,7 +4,7 @@ ## to a different machine type to what is specified by the YAML. # RUN: not yaml2obj --docnum=1 2>&1 %s | FileCheck %s --check-prefix=ERR -# ERR: error: an unknown value is used for symbol's 'Other' field: STO_MIPS_OPTIONAL. +# ERR: error: an unknown value is used for symbol's 'Other' field: STO_MIPS_OPTIONAL --- !ELF FileHeader: