LLVM  14.0.0git
Macros | Typedefs | Functions
AMDKernelCodeTUtils.cpp File Reference
#include "AMDKernelCodeTUtils.h"
#include "AMDKernelCodeT.h"
#include "SIDefines.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/MC/MCParser/MCAsmLexer.h"
#include "llvm/MC/MCParser/MCAsmParser.h"
#include "llvm/Support/raw_ostream.h"
#include "AMDKernelCodeTInfo.h"
Include dependency graph for AMDKernelCodeTUtils.cpp:

Go to the source code of this file.

Macros

#define RECORD(name, altName, print, parse)   #name
 
#define RECORD(name, altName, print, parse)   #altName
 
#define RECORD(name, altName, print, parse)   print
 
#define RECORD(name, altName, print, parse)   parse
 

Typedefs

using PrintFx = void(*)(StringRef, const amd_kernel_code_t &, raw_ostream &)
 
using ParseFx = bool(*)(amd_kernel_code_t &, MCAsmParser &MCParser, raw_ostream &Err)
 

Functions

static ArrayRef< StringRefget_amd_kernel_code_t_FldNames ()
 
static ArrayRef< StringRefget_amd_kernel_code_t_FldAltNames ()
 
static StringMap< intcreateIndexMap (const ArrayRef< StringRef > &names, const ArrayRef< StringRef > &altNames)
 
static int get_amd_kernel_code_t_FieldIndex (StringRef name)
 
static StringRef get_amd_kernel_code_t_FieldName (int index)
 
static raw_ostreamprintName (raw_ostream &OS, StringRef Name)
 
template<typename T , T amd_kernel_code_t::* ptr>
static void printField (StringRef Name, const amd_kernel_code_t &C, raw_ostream &OS)
 
template<typename T , T amd_kernel_code_t::* ptr, int shift, int width = 1>
static void printBitField (StringRef Name, const amd_kernel_code_t &c, raw_ostream &OS)
 
static ArrayRef< PrintFxgetPrinterTable ()
 
static bool expectAbsExpression (MCAsmParser &MCParser, int64_t &Value, raw_ostream &Err)
 
template<typename T , T amd_kernel_code_t::* ptr>
static bool parseField (amd_kernel_code_t &C, MCAsmParser &MCParser, raw_ostream &Err)
 
template<typename T , T amd_kernel_code_t::* ptr, int shift, int width = 1>
static bool parseBitField (amd_kernel_code_t &C, MCAsmParser &MCParser, raw_ostream &Err)
 
static ArrayRef< ParseFxgetParserTable ()
 

Macro Definition Documentation

◆ RECORD [1/4]

#define RECORD (   name,
  altName,
  print,
  parse 
)    #name

◆ RECORD [2/4]

#define RECORD (   name,
  altName,
  print,
  parse 
)    #altName

◆ RECORD [3/4]

#define RECORD (   name,
  altName,
  print,
  parse 
)    print

◆ RECORD [4/4]

#define RECORD (   name,
  altName,
  print,
  parse 
)    parse

Typedef Documentation

◆ ParseFx

using ParseFx = bool(*)(amd_kernel_code_t &, MCAsmParser &MCParser, raw_ostream &Err)

Definition at line 155 of file AMDKernelCodeTUtils.cpp.

◆ PrintFx

Definition at line 85 of file AMDKernelCodeTUtils.cpp.

Function Documentation

◆ createIndexMap()

static StringMap<int> createIndexMap ( const ArrayRef< StringRef > &  names,
const ArrayRef< StringRef > &  altNames 
)
static

◆ expectAbsExpression()

static bool expectAbsExpression ( MCAsmParser MCParser,
int64_t &  Value,
raw_ostream Err 
)
static

Definition at line 117 of file AMDKernelCodeTUtils.cpp.

◆ get_amd_kernel_code_t_FieldIndex()

static int get_amd_kernel_code_t_FieldIndex ( StringRef  name)
static

◆ get_amd_kernel_code_t_FieldName()

static StringRef get_amd_kernel_code_t_FieldName ( int  index)
static

Definition at line 62 of file AMDKernelCodeTUtils.cpp.

References get_amd_kernel_code_t_FldNames(), and index.

Referenced by llvm::printAmdKernelCodeField().

◆ get_amd_kernel_code_t_FldAltNames()

static ArrayRef<StringRef> get_amd_kernel_code_t_FldAltNames ( )
static

Definition at line 35 of file AMDKernelCodeTUtils.cpp.

References llvm::makeArrayRef().

Referenced by get_amd_kernel_code_t_FieldIndex().

◆ get_amd_kernel_code_t_FldNames()

static ArrayRef<StringRef> get_amd_kernel_code_t_FldNames ( )
static

◆ getParserTable()

static ArrayRef<ParseFx> getParserTable ( )
static

Definition at line 157 of file AMDKernelCodeTUtils.cpp.

References llvm::makeArrayRef().

◆ getPrinterTable()

static ArrayRef<PrintFx> getPrinterTable ( )
static

◆ parseBitField()

template<typename T , T amd_kernel_code_t::* ptr, int shift, int width = 1>
static bool parseBitField ( amd_kernel_code_t C,
MCAsmParser MCParser,
raw_ostream Err 
)
static

Definition at line 143 of file AMDKernelCodeTUtils.cpp.

◆ parseField()

template<typename T , T amd_kernel_code_t::* ptr>
static bool parseField ( amd_kernel_code_t C,
MCAsmParser MCParser,
raw_ostream Err 
)
static

Definition at line 133 of file AMDKernelCodeTUtils.cpp.

◆ printBitField()

template<typename T , T amd_kernel_code_t::* ptr, int shift, int width = 1>
static void printBitField ( StringRef  Name,
const amd_kernel_code_t c,
raw_ostream OS 
)
static

Definition at line 79 of file AMDKernelCodeTUtils.cpp.

References c, int, llvm::BitmaskEnumDetail::Mask(), printName(), and shift.

◆ printField()

template<typename T , T amd_kernel_code_t::* ptr>
static void printField ( StringRef  Name,
const amd_kernel_code_t C,
raw_ostream OS 
)
static

Definition at line 73 of file AMDKernelCodeTUtils.cpp.

References int, and printName().

◆ printName()

static raw_ostream& printName ( raw_ostream OS,
StringRef  Name 
)
static

Definition at line 68 of file AMDKernelCodeTUtils.cpp.

Referenced by printBitField(), and printField().