[llvm] r371030 - Recommit r371023 "[lib/ObjectYAML] - Stop calling error(1) when mapping the st_other field of a symbol."
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 5 01:52:26 PDT 2019
Author: grimar
Date: Thu Sep 5 01:52:26 2019
New Revision: 371030
URL: http://llvm.org/viewvc/llvm-project?rev=371030&view=rev
Log:
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
Modified:
llvm/trunk/lib/ObjectYAML/ELFYAML.cpp
llvm/trunk/test/tools/yaml2obj/elf-symbol-stother.yaml
Modified: llvm/trunk/lib/ObjectYAML/ELFYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ObjectYAML/ELFYAML.cpp?rev=371030&r1=371029&r2=371030&view=diff
==============================================================================
--- llvm/trunk/lib/ObjectYAML/ELFYAML.cpp (original)
+++ llvm/trunk/lib/ObjectYAML/ELFYAML.cpp Thu Sep 5 01:52:26 2019
@@ -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<uint8_t> denormalize(IO &) {
@@ -942,7 +941,7 @@ struct NormalizedOther {
return Map;
}
- const IO &YamlIO;
+ IO &YamlIO;
Optional<std::vector<StOtherPiece>> Other;
std::string UnknownFlagsHolder;
};
Modified: llvm/trunk/test/tools/yaml2obj/elf-symbol-stother.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/elf-symbol-stother.yaml?rev=371030&r1=371029&r2=371030&view=diff
==============================================================================
--- llvm/trunk/test/tools/yaml2obj/elf-symbol-stother.yaml (original)
+++ llvm/trunk/test/tools/yaml2obj/elf-symbol-stother.yaml Thu Sep 5 01:52:26 2019
@@ -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:
More information about the llvm-commits
mailing list