[PATCH] D27128: [ELF] Refactor file I/O error messages

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 25 08:47:03 PST 2016


ruiu added a comment.

A <file> in "cannot open <file>" is not a location where an error occurred. It's just a result of an error and an error location is somewhere else. For example, imagine that you have a linker script with an INPUT(<file>) command. If we fail to open that file, we want to print out something like this.

  error: <linker-script>:308: cannot open <file>: no such file

instead of

  error: <file>: cannot open: no such file

So, filename in this case does not indicate where an error happened. We should print out a location that made us open that file instead.


Repository:
  rL LLVM

https://reviews.llvm.org/D27128





More information about the llvm-commits mailing list