[all-commits] [llvm/llvm-project] 244d9d: Verify the LLVMContext that an Attribute belongs to.

nlewycky via All-commits all-commits at lists.llvm.org
Fri Apr 16 09:44:57 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 244d9d6e41db71e76eeb55e56d84f658b3f56681
      https://github.com/llvm/llvm-project/commit/244d9d6e41db71e76eeb55e56d84f658b3f56681
  Author: Nick Lewycky <nick at wasmer.io>
  Date:   2021-04-16 (Fri, 16 Apr 2021)

  Changed paths:
    M llvm/include/llvm/IR/Attributes.h
    M llvm/lib/IR/Attributes.cpp
    M llvm/lib/IR/Verifier.cpp
    M llvm/unittests/IR/AttributesTest.cpp
    M llvm/unittests/IR/VerifierTest.cpp

  Log Message:
  -----------
  Verify the LLVMContext that an Attribute belongs to.

Attributes don't know their parent Context, adding this would make Attribute larger. Instead, we add hasParentContext that answers whether this Attribute belongs to a particular LLVMContext by checking for itself inside the context's FoldingSet. Same with AttributeSet and AttributeList. The Verifier checks them with the Module context.

Differential Revision: https://reviews.llvm.org/D99362




More information about the All-commits mailing list