clang 20.0.0git
Macros | Functions | Variables
Marshallers.cpp File Reference
#include "Marshallers.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Regex.h"
#include <optional>
#include <string>
#include "clang/Basic/AttrList.inc"
#include "clang/AST/OperationKinds.def"
#include "llvm/Frontend/OpenMP/OMP.inc"
#include "clang/Basic/TokenKinds.def"

Go to the source code of this file.

Macros

#define ATTR(X)   "attr::" #X,
 
#define CAST_OPERATION(Name)   "CK_" #Name,
 
#define GEN_CLANG_CLAUSE_CLASS
 
#define CLAUSE_CLASS(Enum, Str, Class)   #Enum,
 
#define UNARY_EXPR_OR_TYPE_TRAIT(Spelling, Name, Key)   "UETT_" #Name,
 
#define CXX11_UNARY_EXPR_OR_TYPE_TRAIT(Spelling, Name, Key)   "UETT_" #Name,
 

Functions

static std::optional< std::string > getBestGuess (llvm::StringRef Search, llvm::ArrayRef< llvm::StringRef > Allowed, llvm::StringRef DropPrefix="", unsigned MaxEditDistance=3)
 
static std::optional< llvm::Regex::RegexFlags > getRegexFlag (llvm::StringRef Flag)
 
static std::optional< llvm::StringRef > getCloseRegexMatch (llvm::StringRef Flag)
 

Variables

static constexpr std::pair< llvm::StringRef, llvm::Regex::RegexFlags > RegexMap []
 

Macro Definition Documentation

◆ ATTR

#define ATTR (   X)    "attr::" #X,

◆ CAST_OPERATION

#define CAST_OPERATION (   Name)    "CK_" #Name,

◆ CLAUSE_CLASS

#define CLAUSE_CLASS (   Enum,
  Str,
  Class 
)    #Enum,

◆ CXX11_UNARY_EXPR_OR_TYPE_TRAIT

#define CXX11_UNARY_EXPR_OR_TYPE_TRAIT (   Spelling,
  Name,
  Key 
)    "UETT_" #Name,

◆ GEN_CLANG_CLAUSE_CLASS

#define GEN_CLANG_CLAUSE_CLASS

◆ UNARY_EXPR_OR_TYPE_TRAIT

#define UNARY_EXPR_OR_TYPE_TRAIT (   Spelling,
  Name,
  Key 
)    "UETT_" #Name,

Function Documentation

◆ getBestGuess()

static std::optional< std::string > getBestGuess ( llvm::StringRef  Search,
llvm::ArrayRef< llvm::StringRef >  Allowed,
llvm::StringRef  DropPrefix = "",
unsigned  MaxEditDistance = 3 
)
static

Definition at line 17 of file Marshallers.cpp.

◆ getCloseRegexMatch()

static std::optional< llvm::StringRef > getCloseRegexMatch ( llvm::StringRef  Flag)
static

◆ getRegexFlag()

static std::optional< llvm::Regex::RegexFlags > getRegexFlag ( llvm::StringRef  Flag)
static

Definition at line 121 of file Marshallers.cpp.

References RegexMap.

Variable Documentation

◆ RegexMap

constexpr std::pair<llvm::StringRef, llvm::Regex::RegexFlags> RegexMap[]
staticconstexpr
Initial value:
= {
{"NoFlags", llvm::Regex::RegexFlags::NoFlags},
{"IgnoreCase", llvm::Regex::RegexFlags::IgnoreCase},
{"Newline", llvm::Regex::RegexFlags::Newline},
{"BasicRegex", llvm::Regex::RegexFlags::BasicRegex},
}

Definition at line 113 of file Marshallers.cpp.

Referenced by getCloseRegexMatch(), and getRegexFlag().