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::ReadOnly, LLVMDialect::getReadonlyAttrName()},
49 {llvm::Attribute::AttrKind::ReadNone, LLVMDialect::getReadnoneAttrName()},
50 {llvm::Attribute::AttrKind::Returned, LLVMDialect::getReturnedAttrName()},
51 {llvm::Attribute::AttrKind::SExt, LLVMDialect::getSExtAttrName()},
52 {llvm::Attribute::AttrKind::StackAlignment,
53 LLVMDialect::getStackAlignmentAttrName()},
54 {llvm::Attribute::AttrKind::StructRet,
55 LLVMDialect::getStructRetAttrName()},
56 {llvm::Attribute::AttrKind::WriteOnly,
57 LLVMDialect::getWriteOnlyAttrName()},
58 {llvm::Attribute::AttrKind::ZExt, LLVMDialect::getZExtAttrName()}};
65 llvm::Attribute::AttrKind>
67 static auto attrNameToKindMapping = []() {
70 nameKindMap.insert({kindNamePair.second, kindNamePair.first});
74 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.