MLIR  20.0.0git
Functions
Support.cpp File Reference
#include "mlir/CAPI/Support.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ThreadPool.h"
#include <cstring>

Go to the source code of this file.

Functions

MlirStringRef mlirStringRefCreateFromCString (const char *str)
 Constructs a string reference from a null-terminated C string. More...
 
bool mlirStringRefEqual (MlirStringRef string, MlirStringRef other)
 Returns true if two string references are equal, false otherwise. More...
 
MlirLlvmThreadPool mlirLlvmThreadPoolCreate ()
 Create an LLVM thread pool. More...
 
void mlirLlvmThreadPoolDestroy (MlirLlvmThreadPool threadPool)
 Destroy an LLVM thread pool. More...
 
MlirTypeID mlirTypeIDCreate (const void *ptr)
 ptr must be 8 byte aligned and unique to a type valid for the duration of the returned type id's usage More...
 
bool mlirTypeIDEqual (MlirTypeID typeID1, MlirTypeID typeID2)
 Checks if two type ids are equal. More...
 
size_t mlirTypeIDHashValue (MlirTypeID typeID)
 Returns the hash value of the type id. More...
 
MlirTypeIDAllocator mlirTypeIDAllocatorCreate ()
 Creates a type id allocator for dynamic type id creation. More...
 
void mlirTypeIDAllocatorDestroy (MlirTypeIDAllocator allocator)
 Deallocates the allocator and all allocated type ids. More...
 
MlirTypeID mlirTypeIDAllocatorAllocateTypeID (MlirTypeIDAllocator allocator)
 Allocates a type id that is valid for the lifetime of the allocator. More...
 

Function Documentation

◆ mlirLlvmThreadPoolCreate()

MlirLlvmThreadPool mlirLlvmThreadPoolCreate ( void  )

Create an LLVM thread pool.

This is reexported here to avoid directly pulling in the LLVM headers directly.

Definition at line 27 of file Support.cpp.

References wrap().

◆ mlirLlvmThreadPoolDestroy()

void mlirLlvmThreadPoolDestroy ( MlirLlvmThreadPool  threadPool)

Destroy an LLVM thread pool.

Definition at line 31 of file Support.cpp.

◆ mlirStringRefCreateFromCString()

MlirStringRef mlirStringRefCreateFromCString ( const char *  str)

Constructs a string reference from a null-terminated C string.

Prefer mlirStringRefCreate if the length of the string is known.

Definition at line 15 of file Support.cpp.

References mlirStringRefCreate().

◆ mlirStringRefEqual()

bool mlirStringRefEqual ( MlirStringRef  string,
MlirStringRef  other 
)

Returns true if two string references are equal, false otherwise.

Definition at line 19 of file Support.cpp.

References MlirStringRef::data, and MlirStringRef::length.

◆ mlirTypeIDAllocatorAllocateTypeID()

MlirTypeID mlirTypeIDAllocatorAllocateTypeID ( MlirTypeIDAllocator  allocator)

Allocates a type id that is valid for the lifetime of the allocator.

Definition at line 67 of file Support.cpp.

References unwrap(), and wrap().

◆ mlirTypeIDAllocatorCreate()

MlirTypeIDAllocator mlirTypeIDAllocatorCreate ( void  )

Creates a type id allocator for dynamic type id creation.

Definition at line 59 of file Support.cpp.

References wrap().

◆ mlirTypeIDAllocatorDestroy()

void mlirTypeIDAllocatorDestroy ( MlirTypeIDAllocator  allocator)

Deallocates the allocator and all allocated type ids.

Definition at line 63 of file Support.cpp.

References unwrap().

◆ mlirTypeIDCreate()

MlirTypeID mlirTypeIDCreate ( const void *  ptr)

ptr must be 8 byte aligned and unique to a type valid for the duration of the returned type id's usage

Definition at line 38 of file Support.cpp.

References mlir::TypeID::getFromOpaquePointer(), and wrap().

Referenced by llvm::DenseMapInfo< MlirTypeID >::getEmptyKey(), and llvm::DenseMapInfo< MlirTypeID >::getTombstoneKey().

◆ mlirTypeIDEqual()

bool mlirTypeIDEqual ( MlirTypeID  typeID1,
MlirTypeID  typeID2 
)

Checks if two type ids are equal.

Definition at line 47 of file Support.cpp.

References unwrap().

Referenced by llvm::DenseMapInfo< MlirTypeID >::isEqual(), and mlir::python::PyTypeID::operator==().

◆ mlirTypeIDHashValue()

size_t mlirTypeIDHashValue ( MlirTypeID  typeID)

Returns the hash value of the type id.

Definition at line 51 of file Support.cpp.

References mlir::polynomial::hash_value(), and unwrap().

Referenced by llvm::DenseMapInfo< MlirTypeID >::getHashValue().