LLVM 20.0.0git
Public Types | Public Member Functions | List of all members
llvm::MIToken Struct Reference

A token produced by the machine instruction lexer. More...

#include "CodeGen/MIRParser/MILexer.h"

Public Types

enum  TokenKind {
  Eof , Error , Newline , comma ,
  equal , underscore , colon , coloncolon ,
  dot , exclaim , lparen , rparen ,
  lbrace , rbrace , plus , minus ,
  less , greater , kw_implicit , kw_implicit_define ,
  kw_def , kw_dead , kw_dereferenceable , kw_killed ,
  kw_undef , kw_internal , kw_early_clobber , kw_debug_use ,
  kw_renamable , kw_tied_def , kw_frame_setup , kw_frame_destroy ,
  kw_nnan , kw_ninf , kw_nsz , kw_arcp ,
  kw_contract , kw_afn , kw_reassoc , kw_nusw ,
  kw_nuw , kw_nsw , kw_exact , kw_nofpexcept ,
  kw_unpredictable , kw_nneg , kw_disjoint , kw_debug_location ,
  kw_debug_instr_number , kw_dbg_instr_ref , kw_cfi_same_value , kw_cfi_offset ,
  kw_cfi_rel_offset , kw_cfi_def_cfa_register , kw_cfi_def_cfa_offset , kw_cfi_adjust_cfa_offset ,
  kw_cfi_escape , kw_cfi_def_cfa , kw_cfi_llvm_def_aspace_cfa , kw_cfi_register ,
  kw_cfi_remember_state , kw_cfi_restore , kw_cfi_restore_state , kw_cfi_undefined ,
  kw_cfi_window_save , kw_cfi_aarch64_negate_ra_sign_state , kw_blockaddress , kw_intrinsic ,
  kw_target_index , kw_half , kw_bfloat , kw_float ,
  kw_double , kw_x86_fp80 , kw_fp128 , kw_ppc_fp128 ,
  kw_target_flags , kw_volatile , kw_non_temporal , kw_invariant ,
  kw_align , kw_basealign , kw_addrspace , kw_stack ,
  kw_got , kw_jump_table , kw_constant_pool , kw_call_entry ,
  kw_custom , kw_liveout , kw_landing_pad , kw_inlineasm_br_indirect_target ,
  kw_ehfunclet_entry , kw_liveins , kw_successors , kw_floatpred ,
  kw_intpred , kw_shufflemask , kw_pre_instr_symbol , kw_post_instr_symbol ,
  kw_heap_alloc_marker , kw_pcsections , kw_cfi_type , kw_bbsections ,
  kw_bb_id , kw_unknown_size , kw_unknown_address , kw_ir_block_address_taken ,
  kw_machine_block_address_taken , kw_call_frame_size , kw_noconvergent , kw_distinct ,
  md_tbaa , md_alias_scope , md_noalias , md_range ,
  md_diexpr , md_dilocation , Identifier , NamedRegister ,
  NamedVirtualRegister , MachineBasicBlockLabel , MachineBasicBlock , StackObject ,
  FixedStackObject , NamedGlobalValue , GlobalValue , ExternalSymbol ,
  MCSymbol , IntegerLiteral , FloatingPointLiteral , HexLiteral ,
  VectorLiteral , VirtualRegister , ConstantPoolItem , JumpTableIndex ,
  NamedIRBlock , IRBlock , NamedIRValue , IRValue ,
  QuotedIRValue , SubRegisterIndex , StringConstant
}
 

Public Member Functions

 MIToken ()=default
 
MITokenreset (TokenKind Kind, StringRef Range)
 
MITokensetStringValue (StringRef StrVal)
 
MITokensetOwnedStringValue (std::string StrVal)
 
MITokensetIntegerValue (APSInt IntVal)
 
TokenKind kind () const
 
bool isError () const
 
bool isNewlineOrEOF () const
 
bool isErrorOrEOF () const
 
bool isRegister () const
 
bool isRegisterFlag () const
 
bool isMemoryOperandFlag () const
 
bool is (TokenKind K) const
 
bool isNot (TokenKind K) const
 
StringRef::iterator location () const
 
StringRef range () const
 
StringRef stringValue () const
 Return the token's string value.
 
const APSIntintegerValue () const
 
bool hasIntegerValue () const
 

Detailed Description

A token produced by the machine instruction lexer.

Definition at line 26 of file MILexer.h.

Member Enumeration Documentation

◆ TokenKind

Enumerator
Eof 
Error 
Newline 
comma 
equal 
underscore 
colon 
coloncolon 
dot 
exclaim 
lparen 
rparen 
lbrace 
rbrace 
plus 
minus 
less 
greater 
kw_implicit 
kw_implicit_define 
kw_def 
kw_dead 
kw_dereferenceable 
kw_killed 
kw_undef 
kw_internal 
kw_early_clobber 
kw_debug_use 
kw_renamable 
kw_tied_def 
kw_frame_setup 
kw_frame_destroy 
kw_nnan 
kw_ninf 
kw_nsz 
kw_arcp 
kw_contract 
kw_afn 
kw_reassoc 
kw_nusw 
kw_nuw 
kw_nsw 
kw_exact 
kw_nofpexcept 
kw_unpredictable 
kw_nneg 
kw_disjoint 
kw_debug_location 
kw_debug_instr_number 
kw_dbg_instr_ref 
kw_cfi_same_value 
kw_cfi_offset 
kw_cfi_rel_offset 
kw_cfi_def_cfa_register 
kw_cfi_def_cfa_offset 
kw_cfi_adjust_cfa_offset 
kw_cfi_escape 
kw_cfi_def_cfa 
kw_cfi_llvm_def_aspace_cfa 
kw_cfi_register 
kw_cfi_remember_state 
kw_cfi_restore 
kw_cfi_restore_state 
kw_cfi_undefined 
kw_cfi_window_save 
kw_cfi_aarch64_negate_ra_sign_state 
kw_blockaddress 
kw_intrinsic 
kw_target_index 
kw_half 
kw_bfloat 
kw_float 
kw_double 
kw_x86_fp80 
kw_fp128 
kw_ppc_fp128 
kw_target_flags 
kw_volatile 
kw_non_temporal 
kw_invariant 
kw_align 
kw_basealign 
kw_addrspace 
kw_stack 
kw_got 
kw_jump_table 
kw_constant_pool 
kw_call_entry 
kw_custom 
kw_liveout 
kw_landing_pad 
kw_inlineasm_br_indirect_target 
kw_ehfunclet_entry 
kw_liveins 
kw_successors 
kw_floatpred 
kw_intpred 
kw_shufflemask 
kw_pre_instr_symbol 
kw_post_instr_symbol 
kw_heap_alloc_marker 
kw_pcsections 
kw_cfi_type 
kw_bbsections 
kw_bb_id 
kw_unknown_size 
kw_unknown_address 
kw_ir_block_address_taken 
kw_machine_block_address_taken 
kw_call_frame_size 
kw_noconvergent 
kw_distinct 
md_tbaa 
md_alias_scope 
md_noalias 
md_range 
md_diexpr 
md_dilocation 
Identifier 
NamedRegister 
NamedVirtualRegister 
MachineBasicBlockLabel 
MachineBasicBlock 
StackObject 
FixedStackObject 
NamedGlobalValue 
GlobalValue 
ExternalSymbol 
MCSymbol 
IntegerLiteral 
FloatingPointLiteral 
HexLiteral 
VectorLiteral 
VirtualRegister 
ConstantPoolItem 
JumpTableIndex 
NamedIRBlock 
IRBlock 
NamedIRValue 
IRValue 
QuotedIRValue 
SubRegisterIndex 
StringConstant 

Definition at line 27 of file MILexer.h.

Constructor & Destructor Documentation

◆ MIToken()

llvm::MIToken::MIToken ( )
default

Member Function Documentation

◆ hasIntegerValue()

bool llvm::MIToken::hasIntegerValue ( ) const
inline

◆ integerValue()

const APSInt & llvm::MIToken::integerValue ( ) const
inline

Definition at line 240 of file MILexer.h.

Referenced by getUnsigned().

◆ is()

bool llvm::MIToken::is ( TokenKind  K) const
inline

Definition at line 229 of file MILexer.h.

Referenced by getHexUint(), and getUnsigned().

◆ isError()

bool llvm::MIToken::isError ( ) const
inline

Definition at line 204 of file MILexer.h.

References Error.

Referenced by maybeLexExclaim().

◆ isErrorOrEOF()

bool llvm::MIToken::isErrorOrEOF ( ) const
inline

Definition at line 208 of file MILexer.h.

References Eof.

◆ isMemoryOperandFlag()

bool llvm::MIToken::isMemoryOperandFlag ( ) const
inline

Definition at line 223 of file MILexer.h.

References kw_dereferenceable, kw_invariant, kw_non_temporal, kw_volatile, and StringConstant.

◆ isNewlineOrEOF()

bool llvm::MIToken::isNewlineOrEOF ( ) const
inline

Definition at line 206 of file MILexer.h.

References Eof, and Newline.

◆ isNot()

bool llvm::MIToken::isNot ( TokenKind  K) const
inline

Definition at line 231 of file MILexer.h.

◆ isRegister()

bool llvm::MIToken::isRegister ( ) const
inline

Definition at line 210 of file MILexer.h.

References NamedRegister, NamedVirtualRegister, underscore, and VirtualRegister.

◆ isRegisterFlag()

bool llvm::MIToken::isRegisterFlag ( ) const
inline

◆ kind()

TokenKind llvm::MIToken::kind ( ) const
inline

Definition at line 202 of file MILexer.h.

Referenced by parseGlobalValue(), and parseIRValue().

◆ location()

StringRef::iterator llvm::MIToken::location ( ) const
inline

Definition at line 233 of file MILexer.h.

References Range.

Referenced by getUnsigned(), maybeLexExclaim(), parseGlobalValue(), and parseIRValue().

◆ range()

StringRef llvm::MIToken::range ( ) const
inline

Definition at line 235 of file MILexer.h.

References Range.

Referenced by getHexUint(), parseGlobalValue(), and parseIRValue().

◆ reset()

MIToken & MIToken::reset ( TokenKind  Kind,
StringRef  Range 
)

◆ setIntegerValue()

MIToken & MIToken::setIntegerValue ( APSInt  IntVal)

◆ setOwnedStringValue()

MIToken & MIToken::setOwnedStringValue ( std::string  StrVal)

Definition at line 73 of file MILexer.cpp.

Referenced by lexName(), and maybeLexMCSymbol().

◆ setStringValue()

MIToken & MIToken::setStringValue ( StringRef  StrVal)

◆ stringValue()

StringRef llvm::MIToken::stringValue ( ) const
inline

Return the token's string value.

Definition at line 238 of file MILexer.h.

Referenced by parseGlobalValue(), and parseIRValue().


The documentation for this struct was generated from the following files: