MLIR 22.0.0git
Remarks.cpp File Reference
#include "mlir/IR/Remarks.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/Value.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"

Go to the source code of this file.

Namespaces

namespace  mlir
 Include the generated interface declarations.
namespace  mlir::remark

Functions

static void printArgs (llvm::raw_ostream &os, llvm::ArrayRef< Remark::Arg > args)
static bool isAnchored (llvm::StringRef s)
 Returns true if filter is already anchored like ^...$.
static std::string anchorWhole (llvm::StringRef filter)
 Anchor the entire pattern so it matches the whole string.
static std::optional< llvm::Regex > buildFilter (const mlir::remark::RemarkCategories &cats, const std::optional< std::string > &specific)
 Build a combined filter from cats.all and a category-specific pattern.

Function Documentation

◆ anchorWhole()

std::string anchorWhole ( llvm::StringRef filter)
static

Anchor the entire pattern so it matches the whole string.

Definition at line 275 of file Remarks.cpp.

References isAnchored().

Referenced by buildFilter().

◆ buildFilter()

std::optional< llvm::Regex > buildFilter ( const mlir::remark::RemarkCategories & cats,
const std::optional< std::string > & specific )
static

Build a combined filter from cats.all and a category-specific pattern.

If neither is present, return std::nullopt. Otherwise "(all|specific)" and anchor once. Also validate before returning.

Definition at line 285 of file Remarks.cpp.

References mlir::remark::RemarkCategories::all, and anchorWhole().

Referenced by mlir::remark::detail::RemarkEngine::RemarkEngine().

◆ isAnchored()

bool isAnchored ( llvm::StringRef s)
static

Returns true if filter is already anchored like ^...$.

Definition at line 269 of file Remarks.cpp.

Referenced by anchorWhole().

◆ printArgs()

void printArgs ( llvm::raw_ostream & os,
llvm::ArrayRef< Remark::Arg > args )
static