MLIR 24.0.0git
LLVMAttrs.cpp File Reference
#include "mlir/Dialect/LLVMIR/LLVMAttrs.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/LLVMIR/LLVMTypes.h"
#include "mlir/Dialect/Ptr/IR/PtrEnums.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/DialectImplementation.h"
#include "mlir/Interfaces/FunctionInterfaces.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/Support/ErrorHandling.h"
#include "mlir/Dialect/LLVMIR/LLVMAttrInterfaces.cpp.inc"
#include "mlir/Dialect/LLVMIR/LLVMOpsEnums.cpp.inc"
#include "mlir/Dialect/LLVMIR/LLVMOpsAttrDefs.cpp.inc"
#include "llvm/IR/FixedMetadataKinds.def"

Go to the source code of this file.

Macros

#define GET_ATTRDEF_CLASSES
#define GET_ATTRDEF_LIST
#define LLVM_FIXED_MD_KIND(EnumID, Name, Value)

Functions

static ParseResult parseExpressionArg (AsmParser &parser, uint64_t opcode, SmallVector< uint64_t > &args)
 Parses DWARF expression arguments with respect to the DWARF operation opcode.
static void printExpressionArg (AsmPrinter &printer, uint64_t opcode, ArrayRef< uint64_t > args)
 Prints DWARF expression arguments with respect to the specific DWARF operation.
static ParseResult parseSourceLanguage (AsmParser &parser, DISourceLanguageNameAttr &language)
 Parses a source language from either the historical inline DW_LANG_* syntax or a nested DISourceLanguageNameAttr.
static void printSourceLanguage (AsmPrinter &printer, DISourceLanguageNameAttr language)
 Prints an unversioned source language without a dialect using the historical inline DW_LANG_* syntax.
static StringRef getFixedMetadataKindName (unsigned kind)

Variables

static constexpr unsigned kReservedFunctionMetadataKinds []

Macro Definition Documentation

◆ GET_ATTRDEF_CLASSES

#define GET_ATTRDEF_CLASSES

Definition at line 55 of file LLVMAttrs.cpp.

◆ GET_ATTRDEF_LIST

#define GET_ATTRDEF_LIST

◆ LLVM_FIXED_MD_KIND

#define LLVM_FIXED_MD_KIND ( EnumID,
Name,
Value )
Value:
case llvm::LLVMContext::EnumID: \
return Name;

Function Documentation

◆ getFixedMetadataKindName()

StringRef getFixedMetadataKindName ( unsigned kind)
static

Definition at line 160 of file LLVMAttrs.cpp.

◆ parseExpressionArg()

ParseResult parseExpressionArg ( AsmParser & parser,
uint64_t opcode,
SmallVector< uint64_t > & args )
static

Parses DWARF expression arguments with respect to the DWARF operation opcode.

Some DWARF expression operations have a specific number of operands and may appear in a textual form.

Definition at line 323 of file LLVMAttrs.cpp.

References mlir::AsmParser::emitError(), mlir::AsmParser::getCurrentLocation(), mlir::AsmParser::parseCommaSeparatedList(), mlir::AsmParser::parseInteger(), mlir::AsmParser::parseOptionalKeyword(), and success().

◆ parseSourceLanguage()

ParseResult parseSourceLanguage ( AsmParser & parser,
DISourceLanguageNameAttr & language )
static

Parses a source language from either the historical inline DW_LANG_* syntax or a nested DISourceLanguageNameAttr.

Definition at line 401 of file LLVMAttrs.cpp.

References mlir::AsmParser::emitError(), mlir::AsmParser::getContext(), mlir::AsmParser::getCurrentLocation(), mlir::OptionalParseResult::has_value(), mlir::AsmParser::parseKeyword(), mlir::AsmParser::parseOptionalAttribute(), and success().

◆ printExpressionArg()

void printExpressionArg ( AsmPrinter & printer,
uint64_t opcode,
ArrayRef< uint64_t > args )
static

Prints DWARF expression arguments with respect to the specific DWARF operation.

Some operands are printed in their textual form.

Definition at line 359 of file LLVMAttrs.cpp.

◆ printSourceLanguage()

void printSourceLanguage ( AsmPrinter & printer,
DISourceLanguageNameAttr language )
static

Prints an unversioned source language without a dialect using the historical inline DW_LANG_* syntax.

All other source languages are printed as a nested DISourceLanguageNameAttr.

Definition at line 428 of file LLVMAttrs.cpp.

References mlir::AsmPrinter::printAttribute().

Variable Documentation

◆ kReservedFunctionMetadataKinds

unsigned kReservedFunctionMetadataKinds[]
staticconstexpr
Initial value:
= {
llvm::LLVMContext::MD_dbg, llvm::LLVMContext::MD_prof}

Definition at line 157 of file LLVMAttrs.cpp.