summaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2021-04-28 13:15:39 -0700
committerNick Lewycky <nicholas@mxc.ca>2021-04-28 13:17:43 -0700
commit191570989ba291c639034906eeb6a0bae9ed47e9 (patch)
tree76743dd05a77562f148c14d41bf8ca69bb0514fd /llvm/lib/IR/Verifier.cpp
parent0cc3e10f5e291d85d5c5047ee783340a8694a249 (diff)
downloadllvm-cleaner-attribute-errors.tar.gz
Improve error messages for attributes in the wrong context.cleaner-attribute-errors
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)').
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r--llvm/lib/IR/Verifier.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index e83599f7d08f..856d1896489f 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -1895,13 +1895,13 @@ void Verifier::verifyFunctionAttrs(FunctionType *FT, AttributeList Attrs,
if (AttributeListsVisited.insert(Attrs.getRawPointer()).second) {
Assert(Attrs.hasParentContext(Context),
- "Attribute list does not match Module context!", &Attrs);
+ "Attribute list does not match Module context!", &Attrs, V);
for (const auto &AttrSet : Attrs) {
Assert(!AttrSet.hasAttributes() || AttrSet.hasParentContext(Context),
- "Attribute set does not match Module context!", &AttrSet);
+ "Attribute set does not match Module context!", &AttrSet, V);
for (const auto &A : AttrSet) {
Assert(A.hasParentContext(Context),
- "Attribute does not match Module context!", &A);
+ "Attribute does not match Module context!", &A, V);
}
}
}