17#include "llvm-c/Core.h"
18#include "llvm/ADT/SmallVector.h"
19#include "llvm/ADT/SmallVectorExtras.h"
27 return wrap(LLVMPointerType::get(
unwrap(ctx), addressSpace));
31 return wrap(LLVM::LLVMPointerType::name);
35 return wrap(LLVM::LLVMPointerType::getTypeID());
39 return isa<LLVM::LLVMPointerType>(
unwrap(type));
43 return cast<LLVM::LLVMPointerType>(
unwrap(pointerType)).getAddressSpace();
53 return wrap(LLVMArrayType::get(
unwrap(elementType), numElements));
57 return wrap(LLVMArrayType::name);
65 MlirType
const *argumentTypes,
bool isVarArg) {
67 return wrap(LLVMFunctionType::get(
69 unwrapList(nArgumentTypes, argumentTypes, argumentStorage), isVarArg));
73 return wrap(LLVMFunctionType::name);
77 return llvm::cast<LLVM::LLVMFunctionType>(
unwrap(type)).getNumParams();
81 assert(pos >= 0 &&
"pos in array must be positive");
82 return wrap(llvm::cast<LLVM::LLVMFunctionType>(
unwrap(type))
83 .getParamType(
static_cast<unsigned>(pos)));
87 return wrap(llvm::cast<LLVM::LLVMFunctionType>(
unwrap(type)).getReturnType());
91 return isa<LLVM::LLVMStructType>(
unwrap(type));
95 return wrap(LLVM::LLVMStructType::getTypeID());
99 return wrap(LLVM::LLVMStructType::name);
103 return !cast<LLVM::LLVMStructType>(
unwrap(type)).isIdentified();
107 return cast<LLVM::LLVMStructType>(
unwrap(type)).getBody().size();
111 return wrap(cast<LLVM::LLVMStructType>(
unwrap(type)).getBody()[position]);
115 return cast<LLVM::LLVMStructType>(
unwrap(type)).isPacked();
119 return wrap(cast<LLVM::LLVMStructType>(
unwrap(type)).getName());
123 return cast<LLVM::LLVMStructType>(
unwrap(type)).isOpaque();
127 MlirType
const *fieldTypes,
130 return wrap(LLVMStructType::getLiteral(
137 MlirType
const *fieldTypes,
140 return wrap(LLVMStructType::getLiteralChecked(
142 unwrapList(nFieldTypes, fieldTypes, fieldStorage), isPacked));
155 MlirType
const *fieldTypes,
158 return wrap(LLVMStructType::getNewIdentified(
165 MlirType
const *fieldTypes,
169 cast<LLVM::LLVMStructType>(
unwrap(structType))
170 .setBody(
unwrapList(nFieldTypes, fieldTypes, fields), isPacked));
176 uint64_t
const *arguments) {
178 return wrap(DIExpressionElemAttr::get(
unwrap(ctx), opcode, list));
182 return wrap(DIExpressionElemAttr::name);
186 MlirAttribute
const *operations) {
188 attrStorage.reserve(nOperations);
190 return wrap(DIExpressionAttr::get(
192 llvm::map_to_vector(
unwrapList(nOperations, operations, attrStorage),
193 llvm::CastTo<DIExpressionElemAttr>)));
197 return wrap(DIExpressionAttr::name);
201 return wrap(DINullTypeAttr::get(
unwrap(ctx)));
205 return wrap(DINullTypeAttr::name);
213 return wrap(DIBasicTypeAttr::get(
214 unwrap(ctx), tag, cast<StringAttr>(
unwrap(name)), sizeInBits, encoding));
218 return wrap(DIBasicTypeAttr::name);
223 DICompositeTypeAttr::getRecSelf(cast<DistinctAttr>(
unwrap(recId))));
227 MlirContext ctx, MlirAttribute recId,
bool isRecSelf,
unsigned int tag,
228 MlirAttribute name, MlirAttribute file, uint32_t line, MlirAttribute scope,
229 MlirAttribute baseType,
int64_t flags, uint64_t sizeInBits,
230 uint64_t alignInBits,
intptr_t nElements, MlirAttribute
const *elements,
231 MlirAttribute dataLocation, MlirAttribute rank, MlirAttribute allocated,
232 MlirAttribute associated) {
234 elementsStorage.reserve(nElements);
236 return wrap(DICompositeTypeAttr::get(
237 unwrap(ctx), cast<DistinctAttr>(
unwrap(recId)), isRecSelf, tag,
238 cast<StringAttr>(
unwrap(name)), cast<DIFileAttr>(
unwrap(file)), line,
239 cast<DIScopeAttr>(
unwrap(scope)), cast<DITypeAttr>(
unwrap(baseType)),
240 DIFlags(flags), sizeInBits, alignInBits,
241 cast<DIExpressionAttr>(
unwrap(dataLocation)),
242 cast<DIExpressionAttr>(
unwrap(rank)),
243 cast<DIExpressionAttr>(
unwrap(allocated)),
244 cast<DIExpressionAttr>(
unwrap(associated)),
245 llvm::map_to_vector(
unwrapList(nElements, elements, elementsStorage),
246 llvm::CastTo<DINodeAttr>)));
250 return wrap(DICompositeTypeAttr::name);
255 MlirAttribute name, MlirAttribute baseType,
256 uint64_t sizeInBits, uint32_t alignInBits,
257 uint64_t offsetInBits,
int64_t dwarfAddressSpace,
258 int64_t flags, MlirAttribute extraData) {
259 std::optional<unsigned> addressSpace = std::nullopt;
260 if (dwarfAddressSpace >= 0)
261 addressSpace = (
unsigned)dwarfAddressSpace;
262 return wrap(DIDerivedTypeAttr::get(
264 cast<DITypeAttr>(
unwrap(baseType)), sizeInBits, alignInBits, offsetInBits,
265 addressSpace, DIFlags(flags), cast<DINodeAttr>(
unwrap(extraData))));
269 return wrap(DIDerivedTypeAttr::name);
273 MlirContext ctx,
unsigned int tag, MlirAttribute name, uint64_t sizeInBits,
274 uint32_t alignInBits, MlirAttribute stringLength,
275 MlirAttribute stringLengthExp, MlirAttribute stringLocationExp,
277 return wrap(DIStringTypeAttr::get(
278 unwrap(ctx), tag, cast<StringAttr>(
unwrap(name)), sizeInBits, alignInBits,
279 cast<DIVariableAttr>(
unwrap(stringLength)),
280 cast<DIExpressionAttr>(
unwrap(stringLengthExp)),
281 cast<DIExpressionAttr>(
unwrap(stringLocationExp)), encoding));
285 return wrap(DIStringTypeAttr::name);
290 return wrap(cast<DIDerivedTypeAttr>(
unwrap(diDerivedType)).getBaseType());
294 return wrap(CConvAttr::get(
unwrap(ctx), CConv(cconv)));
300 return wrap(ComdatAttr::get(
unwrap(ctx), comdat::Comdat(comdat)));
306 return wrap(LinkageAttr::get(
unwrap(ctx), linkage::Linkage(linkage)));
310 return wrap(LinkageAttr::name);
314 MlirAttribute directory) {
316 cast<StringAttr>(
unwrap(directory))));
322 MlirContext ctx, MlirAttribute
id,
unsigned int sourceLanguage,
323 MlirAttribute file, MlirAttribute producer,
bool isOptimized,
325 MlirAttribute splitDebugFilename) {
326 return wrap(DICompileUnitAttr::get(
327 unwrap(ctx), cast<DistinctAttr>(
unwrap(
id)), sourceLanguage,
328 cast<DIFileAttr>(
unwrap(file)), cast<StringAttr>(
unwrap(producer)),
329 isOptimized, DIEmissionKind(emissionKind), DINameTableKind(nameTableKind),
330 cast<StringAttr>(
unwrap(splitDebugFilename))));
334 return wrap(DICompileUnitAttr::name);
338 return wrap(DIFlagsAttr::get(
unwrap(ctx), DIFlags(value)));
342 return wrap(DIFlagsAttr::name);
349 unsigned int column) {
351 DILexicalBlockAttr::get(
unwrap(ctx), cast<DIScopeAttr>(
unwrap(scope)),
352 cast<DIFileAttr>(
unwrap(file)), line, column));
356 return wrap(DILexicalBlockAttr::name);
362 unsigned int discriminator) {
363 return wrap(DILexicalBlockFileAttr::get(
365 cast<DIFileAttr>(
unwrap(file)), discriminator));
369 return wrap(DILexicalBlockFileAttr::name);
373 MlirContext ctx, MlirAttribute scope, MlirAttribute name,
374 MlirAttribute diFile,
unsigned int line,
unsigned int arg,
375 unsigned int alignInBits, MlirAttribute diType,
int64_t flags) {
376 return wrap(DILocalVariableAttr::get(
378 cast<StringAttr>(
unwrap(name)), cast<DIFileAttr>(
unwrap(diFile)), line,
379 arg, alignInBits, cast<DITypeAttr>(
unwrap(diType)), DIFlags(flags)));
383 return wrap(DILocalVariableAttr::name);
387 unsigned int callingConvention,
389 MlirAttribute
const *types) {
391 attrStorage.reserve(nTypes);
393 return wrap(DISubroutineTypeAttr::get(
394 unwrap(ctx), callingConvention,
395 llvm::map_to_vector(
unwrapList(nTypes, types, attrStorage),
396 llvm::CastTo<DITypeAttr>)));
400 return wrap(DISubroutineTypeAttr::name);
404 return wrap(DISubprogramAttr::getRecSelf(cast<DistinctAttr>(
unwrap(recId))));
408 MlirContext ctx, MlirAttribute recId,
bool isRecSelf, MlirAttribute
id,
409 MlirAttribute compileUnit, MlirAttribute scope, MlirAttribute name,
410 MlirAttribute linkageName, MlirAttribute file,
unsigned int line,
411 unsigned int scopeLine, uint64_t subprogramFlags, MlirAttribute type,
412 intptr_t nRetainedNodes, MlirAttribute
const *retainedNodes,
413 intptr_t nAnnotations, MlirAttribute
const *annotations) {
415 nodesStorage.reserve(nRetainedNodes);
418 annotationsStorage.reserve(nAnnotations);
420 return wrap(DISubprogramAttr::get(
421 unwrap(ctx), cast<DistinctAttr>(
unwrap(recId)), isRecSelf,
422 cast<DistinctAttr>(
unwrap(
id)),
423 cast<DICompileUnitAttr>(
unwrap(compileUnit)),
424 cast<DIScopeAttr>(
unwrap(scope)), cast<StringAttr>(
unwrap(name)),
425 cast<StringAttr>(
unwrap(linkageName)), cast<DIFileAttr>(
unwrap(file)),
426 line, scopeLine, DISubprogramFlags(subprogramFlags),
427 cast<DISubroutineTypeAttr>(
unwrap(type)),
429 unwrapList(nRetainedNodes, retainedNodes, nodesStorage),
430 llvm::CastTo<DINodeAttr>),
432 unwrapList(nAnnotations, annotations, annotationsStorage),
433 llvm::CastTo<DINodeAttr>)));
437 return wrap(DISubprogramAttr::name);
441 return wrap(cast<DISubprogramAttr>(
unwrap(diSubprogram)).getScope());
445 return cast<DISubprogramAttr>(
unwrap(diSubprogram)).getLine();
449 return cast<DISubprogramAttr>(
unwrap(diSubprogram)).getScopeLine();
454 return wrap(cast<DISubprogramAttr>(
unwrap(diSubprogram)).getCompileUnit());
458 return wrap(cast<DISubprogramAttr>(
unwrap(diSubprogram)).getFile());
466 MlirAttribute scope, MlirAttribute name,
467 MlirAttribute configMacros,
468 MlirAttribute includePath,
469 MlirAttribute apinotes,
unsigned int line,
471 return wrap(DIModuleAttr::get(
473 cast<DIScopeAttr>(
unwrap(scope)), cast<StringAttr>(
unwrap(name)),
474 cast<StringAttr>(
unwrap(configMacros)),
475 cast<StringAttr>(
unwrap(includePath)), cast<StringAttr>(
unwrap(apinotes)),
480 return wrap(DIModuleAttr::name);
484 return wrap(cast<DIModuleAttr>(
unwrap(diModule)).getScope());
488 MlirContext ctx,
unsigned int tag, MlirAttribute scope,
489 MlirAttribute entity, MlirAttribute file,
unsigned int line,
490 MlirAttribute name,
intptr_t nElements, MlirAttribute
const *elements) {
492 elementsStorage.reserve(nElements);
493 return wrap(DIImportedEntityAttr::get(
495 cast<DINodeAttr>(
unwrap(entity)), cast<DIFileAttr>(
unwrap(file)), line,
496 cast<StringAttr>(
unwrap(name)),
497 llvm::map_to_vector(
unwrapList(nElements, elements, elementsStorage),
498 llvm::CastTo<DINodeAttr>)));
502 return wrap(DIImportedEntityAttr::name);
506 MlirAttribute value) {
507 return wrap(DIAnnotationAttr::get(
unwrap(ctx), cast<StringAttr>(
unwrap(name)),
508 cast<StringAttr>(
unwrap(value))));
512 return wrap(DIAnnotationAttr::name);
static Type getElementType(Type type)
Determine the element type of type.
MlirStringRef mlirLLVMDIFlagsAttrGetName(void)
MlirStringRef mlirLLVMDIModuleAttrGetName(void)
MlirStringRef mlirLLVMDIAnnotationAttrGetName(void)
bool mlirLLVMStructTypeIsLiteral(MlirType type)
Returns true if the type is a literal (unnamed) LLVM struct type.
MlirAttribute mlirLLVMLinkageAttrGet(MlirContext ctx, MlirLLVMLinkage linkage)
Creates a LLVM Linkage attribute.
MlirStringRef mlirLLVMDIImportedEntityAttrGetName(void)
MlirAttribute mlirLLVMDISubprogramAttrGetFile(MlirAttribute diSubprogram)
Gets the file from this DISubprogramAttr.
MlirStringRef mlirLLVMDICompileUnitAttrGetName(void)
MlirType mlirLLVMFunctionTypeGet(MlirType resultType, intptr_t nArgumentTypes, MlirType const *argumentTypes, bool isVarArg)
Creates an llvm.func type.
MlirAttribute mlirLLVMDIModuleAttrGetScope(MlirAttribute diModule)
Gets the scope of this DIModuleAttr.
MlirStringRef mlirLLVMDISubroutineTypeAttrGetName(void)
MlirType mlirLLVMFunctionTypeGetInput(MlirType type, intptr_t pos)
Returns the pos-th input type.
MlirStringRef mlirLLVMCConvAttrGetName(void)
MlirStringRef mlirLLVMDILexicalBlockAttrGetName(void)
MlirStringRef mlirLLVMDIStringTypeAttrGetName(void)
intptr_t mlirLLVMStructTypeGetNumElementTypes(MlirType type)
Returns the number of fields in the struct.
MlirStringRef mlirLLVMStructTypeGetName(void)
intptr_t mlirLLVMFunctionTypeGetNumInputs(MlirType type)
Returns the number of input types.
MlirStringRef mlirLLVMDILexicalBlockFileAttrGetName(void)
MlirAttribute mlirLLVMDINullTypeAttrGet(MlirContext ctx)
Creates a LLVM DINullType attribute.
MlirStringRef mlirLLVMPointerTypeGetName(void)
MlirStringRef mlirLLVMDIFileAttrGetName(void)
MlirType mlirLLVMArrayTypeGetElementType(MlirType type)
Returns the element type of the llvm.array type.
MlirLogicalResult mlirLLVMStructTypeSetBody(MlirType structType, intptr_t nFieldTypes, MlirType const *fieldTypes, bool isPacked)
Sets the body of the identified struct if it hasn't been set yet.
MlirAttribute mlirLLVMDIFileAttrGet(MlirContext ctx, MlirAttribute name, MlirAttribute directory)
Creates a LLVM DIFileAttr attribute.
MlirTypeID mlirLLVMPointerTypeGetTypeID()
bool mlirTypeIsALLVMStructType(MlirType type)
Returns true if the type is an LLVM dialect struct type.
MlirStringRef mlirLLVMStructTypeGetIdentifier(MlirType type)
Returns the identifier of the identified struct.
MlirAttribute mlirLLVMDIStringTypeAttrGet(MlirContext ctx, unsigned int tag, MlirAttribute name, uint64_t sizeInBits, uint32_t alignInBits, MlirAttribute stringLength, MlirAttribute stringLengthExp, MlirAttribute stringLocationExp, MlirLLVMTypeEncoding encoding)
MlirAttribute mlirLLVMDICompositeTypeAttrGet(MlirContext ctx, MlirAttribute recId, bool isRecSelf, unsigned int tag, MlirAttribute name, MlirAttribute file, uint32_t line, MlirAttribute scope, MlirAttribute baseType, int64_t flags, uint64_t sizeInBits, uint64_t alignInBits, intptr_t nElements, MlirAttribute const *elements, MlirAttribute dataLocation, MlirAttribute rank, MlirAttribute allocated, MlirAttribute associated)
Creates a LLVM DICompositeType attribute.
MlirAttribute mlirLLVMDISubprogramAttrGetScope(MlirAttribute diSubprogram)
Gets the scope from this DISubprogramAttr.
MlirAttribute mlirLLVMDILexicalBlockAttrGet(MlirContext ctx, MlirAttribute scope, MlirAttribute file, unsigned int line, unsigned int column)
Creates a LLVM DILexicalBlock attribute.
MlirAttribute mlirLLVMDIExpressionElemAttrGet(MlirContext ctx, unsigned int opcode, intptr_t nArguments, uint64_t const *arguments)
Creates a LLVM DIExpressionElem attribute.
MlirAttribute mlirLLVMDICompositeTypeAttrGetRecSelf(MlirAttribute recId)
Creates a self-referencing LLVM DICompositeType attribute.
MlirStringRef mlirLLVMArrayTypeGetName(void)
MlirTypeID mlirLLVMStructTypeGetTypeID()
MlirAttribute mlirLLVMDIBasicTypeAttrGet(MlirContext ctx, unsigned int tag, MlirAttribute name, uint64_t sizeInBits, MlirLLVMTypeEncoding encoding)
Creates a LLVM DIBasicType attribute.
MlirType mlirLLVMFunctionTypeGetReturnType(MlirType type)
Returns the return type of the function type.
MlirStringRef mlirLLVMDINullTypeAttrGetName(void)
MlirStringRef mlirLLVMDIDerivedTypeAttrGetName(void)
MlirAttribute mlirLLVMComdatAttrGet(MlirContext ctx, MlirLLVMComdat comdat)
Creates a LLVM Comdat attribute.
MlirAttribute mlirLLVMDISubprogramAttrGetRecSelf(MlirAttribute recId)
Creates a self-referencing LLVM DISubprogramAttr attribute.
MlirType mlirLLVMVoidTypeGet(MlirContext ctx)
Creates an llmv.void type.
MlirStringRef mlirLLVMDIBasicTypeAttrGetName(void)
MlirAttribute mlirLLVMDIImportedEntityAttrGet(MlirContext ctx, unsigned int tag, MlirAttribute scope, MlirAttribute entity, MlirAttribute file, unsigned int line, MlirAttribute name, intptr_t nElements, MlirAttribute const *elements)
Creates a LLVM DIImportedEntityAttr attribute.
MlirType mlirLLVMStructTypeIdentifiedNewGet(MlirContext ctx, MlirStringRef name, intptr_t nFieldTypes, MlirType const *fieldTypes, bool isPacked)
Creates an LLVM identified struct type with no body and a name starting with the given prefix.
MlirType mlirLLVMStructTypeGetElementType(MlirType type, intptr_t position)
Returns the positions-th field of the struct.
MlirType mlirLLVMStructTypeOpaqueGet(MlirContext ctx, MlirStringRef name)
MlirType mlirLLVMArrayTypeGet(MlirType elementType, unsigned numElements)
Creates an llvm.array type.
MlirAttribute mlirLLVMDISubprogramAttrGetType(MlirAttribute diSubprogram)
Gets the type from this DISubprogramAttr.
MlirAttribute mlirLLVMDISubprogramAttrGetCompileUnit(MlirAttribute diSubprogram)
Gets the compile unit from this DISubprogram.
MlirAttribute mlirLLVMDIModuleAttrGet(MlirContext ctx, MlirAttribute file, MlirAttribute scope, MlirAttribute name, MlirAttribute configMacros, MlirAttribute includePath, MlirAttribute apinotes, unsigned int line, bool isDecl)
Creates a LLVM DIModuleAttr attribute.
MlirStringRef mlirLLVMDICompositeTypeAttrGetName(void)
MlirStringRef mlirLLVMDIExpressionAttrGetName(void)
MlirStringRef mlirLLVMComdatAttrGetName(void)
MlirStringRef mlirLLVMDILocalVariableAttrGetName(void)
MlirStringRef mlirLLVMDISubprogramAttrGetName(void)
MlirAttribute mlirLLVMCConvAttrGet(MlirContext ctx, MlirLLVMCConv cconv)
Creates a LLVM CConv attribute.
MlirStringRef mlirLLVMLinkageAttrGetName(void)
MlirAttribute mlirLLVMDIAnnotationAttrGet(MlirContext ctx, MlirAttribute name, MlirAttribute value)
Creates a LLVM DIAnnotation attribute.
MlirType mlirLLVMStructTypeLiteralGetChecked(MlirLocation loc, intptr_t nFieldTypes, MlirType const *fieldTypes, bool isPacked)
Creates an LLVM literal (unnamed) struct type if possible.
MlirAttribute mlirLLVMDILexicalBlockFileAttrGet(MlirContext ctx, MlirAttribute scope, MlirAttribute file, unsigned int discriminator)
Creates a LLVM DILexicalBlockFile attribute.
MlirAttribute mlirLLVMDICompileUnitAttrGet(MlirContext ctx, MlirAttribute id, unsigned int sourceLanguage, MlirAttribute file, MlirAttribute producer, bool isOptimized, MlirLLVMDIEmissionKind emissionKind, MlirLLVMDINameTableKind nameTableKind, MlirAttribute splitDebugFilename)
Creates a LLVM DICompileUnit attribute.
MlirAttribute mlirLLVMDIExpressionAttrGet(MlirContext ctx, intptr_t nOperations, MlirAttribute const *operations)
Creates a LLVM DIExpression attribute.
bool mlirLLVMStructTypeIsPacked(MlirType type)
Returns true if the struct is packed.
MlirAttribute mlirLLVMDISubprogramAttrGet(MlirContext ctx, MlirAttribute recId, bool isRecSelf, MlirAttribute id, MlirAttribute compileUnit, MlirAttribute scope, MlirAttribute name, MlirAttribute linkageName, MlirAttribute file, unsigned int line, unsigned int scopeLine, uint64_t subprogramFlags, MlirAttribute type, intptr_t nRetainedNodes, MlirAttribute const *retainedNodes, intptr_t nAnnotations, MlirAttribute const *annotations)
Creates a LLVM DISubprogramAttr attribute.
unsigned mlirLLVMPointerTypeGetAddressSpace(MlirType pointerType)
Returns address space of llvm.ptr.
MlirAttribute mlirLLVMDIFlagsAttrGet(MlirContext ctx, uint64_t value)
Creates a LLVM DIFlags attribute.
MlirType mlirLLVMStructTypeIdentifiedGet(MlirContext ctx, MlirStringRef name)
Creates an LLVM identified struct type with no body.
MlirAttribute mlirLLVMDISubroutineTypeAttrGet(MlirContext ctx, unsigned int callingConvention, intptr_t nTypes, MlirAttribute const *types)
Creates a LLVM DISubroutineTypeAttr attribute.
MlirAttribute mlirLLVMDIDerivedTypeAttrGetBaseType(MlirAttribute diDerivedType)
Gets the base type from a LLVM DIDerivedType attribute.
bool mlirLLVMStructTypeIsOpaque(MlirType type)
Returns true is the struct is explicitly opaque (will not have a body) or uninitialized (will eventua...
bool mlirTypeIsALLVMPointerType(MlirType type)
Returns true if the type is an LLVM dialect pointer type.
unsigned int mlirLLVMDISubprogramAttrGetLine(MlirAttribute diSubprogram)
Gets the line from this DISubprogramAttr.
MlirAttribute mlirLLVMDILocalVariableAttrGet(MlirContext ctx, MlirAttribute scope, MlirAttribute name, MlirAttribute diFile, unsigned int line, unsigned int arg, unsigned int alignInBits, MlirAttribute diType, int64_t flags)
Creates a LLVM DILocalVariableAttr attribute.
MlirStringRef mlirLLVMVoidTypeGetName(void)
unsigned int mlirLLVMDISubprogramAttrGetScopeLine(MlirAttribute diSubprogram)
Gets the scope line from this DISubprogram.
MlirAttribute mlirLLVMDIDerivedTypeAttrGet(MlirContext ctx, unsigned int tag, MlirAttribute name, MlirAttribute baseType, uint64_t sizeInBits, uint32_t alignInBits, uint64_t offsetInBits, int64_t dwarfAddressSpace, int64_t flags, MlirAttribute extraData)
Creates a LLVM DIDerivedType attribute.
MlirType mlirLLVMStructTypeLiteralGet(MlirContext ctx, intptr_t nFieldTypes, MlirType const *fieldTypes, bool isPacked)
Creates an LLVM literal (unnamed) struct type.
MlirStringRef mlirLLVMDIExpressionElemAttrGetName(void)
MlirStringRef mlirLLVMFunctionTypeGetName(void)
#define MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Name, Namespace, ClassName)
static llvm::ArrayRef< CppTy > unwrapList(size_t size, CTy *first, llvm::SmallVectorImpl< CppTy > &storage)
MlirDiagnostic wrap(mlir::Diagnostic &diagnostic)
mlir::Diagnostic & unwrap(MlirDiagnostic diagnostic)
MLIR_CAPI_EXPORTED MlirType mlirLLVMPointerTypeGet(MlirContext ctx, unsigned addressSpace)
Creates an llvm.ptr type.
The OpAsmOpInterface, see OpAsmInterface.td for more details.
Include the generated interface declarations.
Type getType(OpFoldResult ofr)
Returns the int type of the integer in ofr.
InFlightDiagnostic emitError(Location loc)
Utility method to emit an error message using this location.
A logical result value, essentially a boolean with named states.
A pointer to a sized fragment of a string, not necessarily null-terminated.