[PATCH] D39749: Allow yaml2obj to order implicit sections for ELF

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 11:32:18 PST 2017


jakehehrlich added a comment.

Overall looks good to me. I just have one nit about the lookup function.



================
Comment at: tools/yaml2obj/yaml2elf.cpp:78
+  /// \returns unsigned max if name is not present in the map
+  unsigned lookup(StringRef Name) const {
+    StringMap<int>::const_iterator I = Map.find(Name);
----------------
I think you should use an Optional here instead of returning a maximal value. Also can you implement one of the lookup functions in terms of the other to dedup code?


https://reviews.llvm.org/D39749





More information about the llvm-commits mailing list