LLVM  8.0.1
Macros | Typedefs | Functions
AMDKernelCodeTUtils.cpp File Reference
#include "AMDKernelCodeTUtils.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 <cassert>
#include <cstdint>
#include <utility>
#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 StringMap< int > createIndexMap (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 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)
 

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 158 of file AMDKernelCodeTUtils.cpp.

◆ PrintFx

Definition at line 88 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 120 of file AMDKernelCodeTUtils.cpp.

◆ get_amd_kernel_code_t_FieldIndex()

static int get_amd_kernel_code_t_FieldIndex ( StringRef  name)
static

Definition at line 59 of file AMDKernelCodeTUtils.cpp.

References createIndexMap().

◆ get_amd_kernel_code_t_FieldName()

static StringRef get_amd_kernel_code_t_FieldName ( int  index)
static

Definition at line 65 of file AMDKernelCodeTUtils.cpp.

Referenced by llvm::printAmdKernelCodeField().

◆ 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 146 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 136 of file AMDKernelCodeTUtils.cpp.

Referenced by FunctionNumber(), and llvm::LLParser::getContext().

◆ 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 82 of file AMDKernelCodeTUtils.cpp.

References llvm::BitmaskEnumDetail::Mask(), and printName().

◆ 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 76 of file AMDKernelCodeTUtils.cpp.

References printName().

◆ printName()

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

Definition at line 71 of file AMDKernelCodeTUtils.cpp.

Referenced by printBitField(), and printField().