[PATCH] D61532: implement of the parsing symbol table for xcoffobjfile and output as yaml format

Digger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 15 12:36:02 PDT 2019


DiggerLin added inline comments.


================
Comment at: llvm/lib/Object/XCOFFObjectFile.cpp:112
+  if (SymEntPtr->SectionNumber == XCOFF::N_DEBUG) {
+    llvm_unreachable("Not yet implemented!");
+    return StringRef(nullptr, 0);
----------------
DiggerLin wrote:
> hubert.reinterpretcast wrote:
> > If an error recovery path is thought to be necessary, then `llvm_unreachable` is the wrong answer. Since the error recovery seems reasonable, use `assert` instead.
> we do not support xcoff object file which generated by -g currently. we will support it later, and symbol name in the .debug section  later. So I think use  llvm_unreachable maybe more reasonable.
changed to assert.


================
Comment at: llvm/tools/obj2yaml/xcoff2yaml.cpp:34
   dumpHeader();
+  if ((EC = dumpSymbols()))
+    return EC;
----------------
sfertile wrote:
> What gets returned when this is false?
if symbol name parse failed . 
it return std::error_code which value is 3 . defined in 
Error.h 

enum class object_error {
  // Error code 0 is absent. Use std::error_code() instead.
  arch_not_found = 1,
  invalid_file_type,
  parse_failed,
  unexpected_eof,
  string_table_non_null_end,
  invalid_section_index,
  bitcode_section_not_found,
  invalid_symbol_index,
};


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61532/new/

https://reviews.llvm.org/D61532





More information about the llvm-commits mailing list