[PATCH] D99362: Verify the LLVMContext for Attributes.

Nick Lewycky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 2 09:07:42 PDT 2021


nickwasmer added a comment.

Ping!

This patch includes a change to FoldingSet. Does it make sense for FoldingSet to have a Contains() method? Was it previously missing because we didn't need it yet, or was it missing because not having it makes for a better API? Should that be broken out into its own patch or

This patch adds "hasParentContext" which is a new way of querying the context. Is this an acceptable way API to add? Do we need to do this unusual API or is there a way we could have added a normal "getParent" method to these instead?

Is verifying the contexts of attributes worth adding the above methods? FWIW, I think that a front-end could have a bug where they generate IR using one LLVMContext per source function, but build the attributes for their builtin functions on the first LLVMContext and cache it. The Verifier won't catch the cross-LLVMContext usage before this patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99362



More information about the llvm-commits mailing list