MLIR  22.0.0git
Functions
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.

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 ^...$. More...
 
static std::string anchorWhole (llvm::StringRef filter)
 Anchor the entire pattern so it matches the whole string. More...
 
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. More...
 

Function Documentation

◆ anchorWhole()

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

Anchor the entire pattern so it matches the whole string.

Definition at line 258 of file Remarks.cpp.

References isAnchored().

Referenced by buildFilter().

◆ buildFilter()

static 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 268 of file Remarks.cpp.

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

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

◆ isAnchored()

static bool isAnchored ( llvm::StringRef  s)
static

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

Definition at line 252 of file Remarks.cpp.

Referenced by anchorWhole().

◆ printArgs()

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