9 #ifndef ATTRKINDDETAIL_H_
10 #define ATTRKINDDETAIL_H_
13 #include "llvm/IR/Attributes.h"
23 using ElemTy = std::pair<llvm::Attribute::AttrKind, llvm::StringRef>;
26 {llvm::Attribute::AttrKind::Alignment, LLVMDialect::getAlignAttrName()},
27 {llvm::Attribute::AttrKind::AllocAlign,
28 LLVMDialect::getAllocAlignAttrName()},
29 {llvm::Attribute::AttrKind::AllocatedPointer,
30 LLVMDialect::getAllocatedPointerAttrName()},
31 {llvm::Attribute::AttrKind::ByVal, LLVMDialect::getByValAttrName()},
32 {llvm::Attribute::AttrKind::ByRef, LLVMDialect::getByRefAttrName()},
33 {llvm::Attribute::AttrKind::NoUndef, LLVMDialect::getNoUndefAttrName()},
34 {llvm::Attribute::AttrKind::Dereferenceable,
35 LLVMDialect::getDereferenceableAttrName()},
36 {llvm::Attribute::AttrKind::DereferenceableOrNull,
37 LLVMDialect::getDereferenceableOrNullAttrName()},
38 {llvm::Attribute::AttrKind::InAlloca, LLVMDialect::getInAllocaAttrName()},
39 {llvm::Attribute::AttrKind::InReg, LLVMDialect::getInRegAttrName()},
40 {llvm::Attribute::AttrKind::Nest, LLVMDialect::getNestAttrName()},
41 {llvm::Attribute::AttrKind::NoAlias, LLVMDialect::getNoAliasAttrName()},
42 {llvm::Attribute::AttrKind::NoCapture,
43 LLVMDialect::getNoCaptureAttrName()},
44 {llvm::Attribute::AttrKind::NoFree, LLVMDialect::getNoFreeAttrName()},
45 {llvm::Attribute::AttrKind::NonNull, LLVMDialect::getNonNullAttrName()},
46 {llvm::Attribute::AttrKind::Preallocated,
47 LLVMDialect::getPreallocatedAttrName()},
48 {llvm::Attribute::AttrKind::Range, LLVMDialect::getRangeAttrName()},
49 {llvm::Attribute::AttrKind::ReadOnly, LLVMDialect::getReadonlyAttrName()},
50 {llvm::Attribute::AttrKind::ReadNone, LLVMDialect::getReadnoneAttrName()},
51 {llvm::Attribute::AttrKind::Returned, LLVMDialect::getReturnedAttrName()},
52 {llvm::Attribute::AttrKind::SExt, LLVMDialect::getSExtAttrName()},
53 {llvm::Attribute::AttrKind::StackAlignment,
54 LLVMDialect::getStackAlignmentAttrName()},
55 {llvm::Attribute::AttrKind::StructRet,
56 LLVMDialect::getStructRetAttrName()},
57 {llvm::Attribute::AttrKind::WriteOnly,
58 LLVMDialect::getWriteOnlyAttrName()},
59 {llvm::Attribute::AttrKind::ZExt, LLVMDialect::getZExtAttrName()}};
66 llvm::Attribute::AttrKind>
68 static auto attrNameToKindMapping = []() {
71 nameKindMap.insert({kindNamePair.second, kindNamePair.first});
75 return attrNameToKindMapping;
static llvm::ArrayRef< std::pair< llvm::Attribute::AttrKind, llvm::StringRef > > getAttrKindToNameMapping()
Returns a list of pairs that each hold a mapping from LLVM attribute kinds to their corresponding str...
static llvm::DenseMap< llvm::StringRef, llvm::Attribute::AttrKind > getAttrNameToKindMapping()
Returns a dense map from LLVM attribute name to their kind in LLVM IR dialect.
Include the generated interface declarations.