[PATCH] D27108: [ELF] Print file:line for 'undefined section' error

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 24 09:30:05 PST 2016


ruiu added inline comments.


================
Comment at: ELF/ScriptParser.cpp:44-45
 
+static std::pair<size_t, size_t>
+getLocation(MemoryBufferRef MB, StringRef Token, std::string &LocStr) {
+  LocStr = MB.getBufferIdentifier();
----------------
This function seems odd because it returns two values as a pair but the third parameter is virtually the third return value.


================
Comment at: ELF/ScriptParser.cpp:48
+  std::pair<size_t, size_t> ErrPos = {0, 0};
+  if (!Token.empty()) {
+    ErrPos = getPos(MB.getBuffer(), Token);
----------------
Flip the condition and return eraly.


Repository:
  rL LLVM

https://reviews.llvm.org/D27108





More information about the llvm-commits mailing list