MLIR 24.0.0git
LoopAnnotationImporter.cpp File Reference
#include "LoopAnnotationImporter.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/IR/Constants.h"

Go to the source code of this file.

Functions

static bool isEmptyOrNull (const Attribute attr)
static bool isEmptyOrNull (uint32_t value)
template<typename T>
static bool isEmptyOrNull (const SmallVectorImpl< T > &vec)
template<typename... P>
static bool anyFailedOrAllEmpty (const P &...args)
 Helper function that returns true if any of the argument conversions failed or if all of them are null or empty.
template<typename T, typename... P>
static T createIfNonNull (MLIRContext *ctx, const P &...args)
 Helper function that only creates and attribute of type T if all argument conversion were successfull and at least one of them holds a non-null value.

Function Documentation

◆ anyFailedOrAllEmpty()

template<typename... P>
bool anyFailedOrAllEmpty ( const P &... args)
static

Helper function that returns true if any of the argument conversions failed or if all of them are null or empty.

Definition at line 277 of file LoopAnnotationImporter.cpp.

References isEmptyOrNull().

Referenced by createIfNonNull().

◆ createIfNonNull()

template<typename T, typename... P>
T createIfNonNull ( MLIRContext * ctx,
const P &... args )
static

Helper function that only creates and attribute of type T if all argument conversion were successfull and at least one of them holds a non-null value.

Definition at line 288 of file LoopAnnotationImporter.cpp.

References anyFailedOrAllEmpty().

◆ isEmptyOrNull() [1/3]

bool isEmptyOrNull ( const Attribute attr)
static

Definition at line 265 of file LoopAnnotationImporter.cpp.

Referenced by anyFailedOrAllEmpty().

◆ isEmptyOrNull() [2/3]

template<typename T>
bool isEmptyOrNull ( const SmallVectorImpl< T > & vec)
static

Definition at line 270 of file LoopAnnotationImporter.cpp.

◆ isEmptyOrNull() [3/3]

bool isEmptyOrNull ( uint32_t value)
static

Definition at line 267 of file LoopAnnotationImporter.cpp.