[PATCH] D26438: [Verifier] Add verification for TBAA metadata

Manman Ren via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 6 16:46:53 PST 2016


manmanren added a comment.

The rest looks pretty reasonable.

Manman



================
Comment at: lib/IR/Verifier.cpp:3802
+static bool IsSingularStructTBAANode(const MDNode *MD,
+                                     SmallPtrSetImpl<const MDNode *> &Visited) {
+  if (MD->getNumOperands() != 3)
----------------
This seems somewhat heavy-weighted. I guess you are trying to differentiate a scalar type node from a struct type node with a single field, given that both can have 3 operands with the 2nd operand being a type and the 3rd being an offset. I don't think you can really differentiate the two cases. I feel like checking the offset being zero for the access type node of a tag should be enough.

I will not call them *singular" struct type node, since they are scalar type node.

createTBAAScalarTypeNode will generate such a scalar type node with 3 operands, createTBAANode (which is not used in clang any more) can generate a scalar type node with 2 operands.


https://reviews.llvm.org/D26438





More information about the llvm-commits mailing list