//===- AttributeImpl.h - Attribute Internals --------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// /// /// \file /// This file defines various helper methods and classes used by /// LLVMContextImpl for creating and managing attributes. /// //===----------------------------------------------------------------------===// #ifndef LLVM_LIB_IR_ATTRIBUTEIMPL_H #define LLVM_LIB_IR_ATTRIBUTEIMPL_H #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/StringRef.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/ConstantRange.h" #include "llvm/IR/ConstantRangeList.h" #include "llvm/Support/TrailingObjects.h" #include <cassert> #include <cstddef> #include <cstdint> #include <optional> #include <string> #include <utility> namespace llvm { class LLVMContext; class Type; //===----------------------------------------------------------------------===// /// \class /// This class represents a single, uniqued attribute. That attribute /// could be a single enum, a tuple, or a string. class AttributeImpl : public FoldingSetNode { … }; static_assert …; //===----------------------------------------------------------------------===// /// \class /// A set of classes that contain the value of the /// attribute object. There are three main categories: enum attribute entries, /// represented by Attribute::AttrKind; alignment attribute entries; and string /// attribute enties, which are for target-dependent attributes. class EnumAttributeImpl : public AttributeImpl { … }; class IntAttributeImpl : public EnumAttributeImpl { … }; class StringAttributeImpl final : public AttributeImpl, private TrailingObjects<StringAttributeImpl, char> { … }; class TypeAttributeImpl : public EnumAttributeImpl { … }; class ConstantRangeAttributeImpl : public EnumAttributeImpl { … }; class ConstantRangeListAttributeImpl final : public EnumAttributeImpl, private TrailingObjects<ConstantRangeListAttributeImpl, ConstantRange> { … }; class AttributeBitSet { … }; //===----------------------------------------------------------------------===// /// \class /// This class represents a group of attributes that apply to one /// element: function, return type, or parameter. class AttributeSetNode final : public FoldingSetNode, private TrailingObjects<AttributeSetNode, Attribute> { … }; //===----------------------------------------------------------------------===// /// \class /// This class represents a set of attributes that apply to the function, /// return type, and parameters. class AttributeListImpl final : public FoldingSetNode, private TrailingObjects<AttributeListImpl, AttributeSet> { … }; static_assert …; } // end namespace llvm #endif // LLVM_LIB_IR_ATTRIBUTEIMPL_H