[PATCH] D67449: [llvm-ar] Include a line number when failing to parse an MRI script

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 13 19:29:42 PDT 2019


MaskRay added subscribers: jhenderson, grimar.
MaskRay added a comment.

I wish we can create a new function for MRI error reporting but as it stands, `runMRIScript` can call `readLibrary, addChildMember, and addMember` which can in turn call `fail` or `failIfError`, so `fail` has to be aware of the MRI line number. + at grimar @jhenderson in case they have suggestions.



================
Comment at: llvm/test/tools/llvm-ar/mri-errors.test:9
+RUN: not llvm-ar -M < %t/script1.mri 2>&1 | FileCheck --check-prefix=SCRIPT1 %s
+SCRIPT1: error: script line 2: Could not open library
+
----------------
A bit inconvenience for you (sorry!): after D67558, the error messages are no longer capitalized, so this needs a rebase.

If I recall correctly, one point raised by @grimar or @jhenderson before is that we should still use `# ` comment markers even if the test contains no code. I hope they can confirm.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D67449





More information about the llvm-commits mailing list