From: George Rimar Date: Thu, 5 Sep 2019 08:28:43 +0000 (+0000) Subject: [lib/ObjectYAML] - Stop calling error(1) when mapping the st_other field of a symbol. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2c7e2fc78583ea3f8cb8df1f67ad23146f6b94dd;p=llvm [lib/ObjectYAML] - Stop calling error(1) when mapping the st_other field of a symbol. 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@371023 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ObjectYAML/ELFYAML.cpp b/lib/ObjectYAML/ELFYAML.cpp index a81d27eed6b..068f3453d57 100644 --- a/lib/ObjectYAML/ELFYAML.cpp +++ b/lib/ObjectYAML/ELFYAML.cpp @@ -894,10 +894,8 @@ 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); } Optional denormalize(IO &) { @@ -942,7 +940,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: