[PATCH] [obj2yaml] Support ELF input format in the obj2yaml tool

Sean Silva chisophugis at gmail.com
Mon May 12 11:00:49 PDT 2014

Comment at: test/Object/obj2yaml.test:203
@@ +202,3 @@
+ELF-MIPSEL-NEXT:     AddressAlign:    0x0000000000000004
+ELF-MIPSEL-NEXT:     Content:         0000023C00004224E8FFBD271400BFAF1000B0AF218059000000018E000024240000198E09F8200321E000020000198E09F8200321E00002000002241000B08F1400BF8F0800E0031800BD27
+ELF-MIPSEL-NEXT:   - Type:            SHT_REL
Simon Atanasyan wrote:
> Michael Spencer wrote:
> > Content needs to be quoted. 0 is the octal prefix in YAML prior to 1.2.
> Now the llvm::yaml::Output class prints quotes for strings which are **valid** numbers. The string 0000023C... is not a valid octal number. Do you suggest to implement a general solution and always print quotes for all string which starts from a digit even if the rest of the string is not a valid number? This greatly simplify the `isNumber` function from the `YAMLTraits.h`, but I am still note sure that we need so general modification.
I wouldn't be opposed to being more conservative when quoting in general. I think that the extra quotes would probably be a net win for the human reader, which has a much harder time knowing if it is an octal number.

That can be a separate patch though. The current patch LGTM.


More information about the llvm-commits mailing list