Page MenuHomePhabricator

Improve error messages for attributes in the wrong context.
ClosedPublic

Authored by nickwasmer on Apr 28 2021, 1:20 PM.

Details

Summary

verifyFunctionAttrs has a comment that the value V is printed in error messages. The recently added errors for attributes didn't print V. Make them print V.

Change the stringification of AttributeList. Firstly they started with 'PAL[' which stood for ParamAttrsList. Change that to 'AttributeList[' matching its current name AttributeList. Print out semantic meaning of the index instead of the raw index value (i.e. 'return', 'function' or 'arg(n)').

Diff Detail

Event Timeline

nickwasmer created this revision.Apr 28 2021, 1:20 PM
nickwasmer requested review of this revision.Apr 28 2021, 1:20 PM
dexonsmith accepted this revision.Apr 28 2021, 1:36 PM

Seems like a nice improvement. LGTM, with one style nit inline.

llvm/lib/IR/Attributes.cpp
1699–1712

I suggest reducing nesting with an early continue here.

This revision is now accepted and ready to land.Apr 28 2021, 1:36 PM
This revision was landed with ongoing or failed builds.Apr 29 2021, 1:44 AM
This revision was automatically updated to reflect the committed changes.