Lines Matching refs:MIToken
62 MIToken &MIToken::reset(TokenKind Kind, StringRef Range) { in reset()
68 MIToken &MIToken::setStringValue(StringRef StrVal) { in setStringValue()
73 MIToken &MIToken::setOwnedStringValue(std::string StrVal) { in setOwnedStringValue()
79 MIToken &MIToken::setIntegerValue(APSInt IntVal) { in setIntegerValue()
168 static Cursor lexName(Cursor C, MIToken &Token, MIToken::TokenKind Type, in lexName()
180 Token.reset(MIToken::Error, Range.remaining()); in lexName()
190 static MIToken::TokenKind getIdentifierKind(StringRef Identifier) { in getIdentifierKind()
191 return StringSwitch<MIToken::TokenKind>(Identifier) in getIdentifierKind()
192 .Case("_", MIToken::underscore) in getIdentifierKind()
193 .Case("implicit", MIToken::kw_implicit) in getIdentifierKind()
194 .Case("implicit-def", MIToken::kw_implicit_define) in getIdentifierKind()
195 .Case("def", MIToken::kw_def) in getIdentifierKind()
196 .Case("dead", MIToken::kw_dead) in getIdentifierKind()
197 .Case("killed", MIToken::kw_killed) in getIdentifierKind()
198 .Case("undef", MIToken::kw_undef) in getIdentifierKind()
199 .Case("internal", MIToken::kw_internal) in getIdentifierKind()
200 .Case("early-clobber", MIToken::kw_early_clobber) in getIdentifierKind()
201 .Case("debug-use", MIToken::kw_debug_use) in getIdentifierKind()
202 .Case("renamable", MIToken::kw_renamable) in getIdentifierKind()
203 .Case("tied-def", MIToken::kw_tied_def) in getIdentifierKind()
204 .Case("frame-setup", MIToken::kw_frame_setup) in getIdentifierKind()
205 .Case("frame-destroy", MIToken::kw_frame_destroy) in getIdentifierKind()
206 .Case("nnan", MIToken::kw_nnan) in getIdentifierKind()
207 .Case("ninf", MIToken::kw_ninf) in getIdentifierKind()
208 .Case("nsz", MIToken::kw_nsz) in getIdentifierKind()
209 .Case("arcp", MIToken::kw_arcp) in getIdentifierKind()
210 .Case("contract", MIToken::kw_contract) in getIdentifierKind()
211 .Case("afn", MIToken::kw_afn) in getIdentifierKind()
212 .Case("reassoc", MIToken::kw_reassoc) in getIdentifierKind()
213 .Case("nuw", MIToken::kw_nuw) in getIdentifierKind()
214 .Case("nsw", MIToken::kw_nsw) in getIdentifierKind()
215 .Case("nusw", MIToken::kw_nusw) in getIdentifierKind()
216 .Case("exact", MIToken::kw_exact) in getIdentifierKind()
217 .Case("nneg", MIToken::kw_nneg) in getIdentifierKind()
218 .Case("disjoint", MIToken::kw_disjoint) in getIdentifierKind()
219 .Case("nofpexcept", MIToken::kw_nofpexcept) in getIdentifierKind()
220 .Case("unpredictable", MIToken::kw_unpredictable) in getIdentifierKind()
221 .Case("debug-location", MIToken::kw_debug_location) in getIdentifierKind()
222 .Case("debug-instr-number", MIToken::kw_debug_instr_number) in getIdentifierKind()
223 .Case("dbg-instr-ref", MIToken::kw_dbg_instr_ref) in getIdentifierKind()
224 .Case("same_value", MIToken::kw_cfi_same_value) in getIdentifierKind()
225 .Case("offset", MIToken::kw_cfi_offset) in getIdentifierKind()
226 .Case("rel_offset", MIToken::kw_cfi_rel_offset) in getIdentifierKind()
227 .Case("def_cfa_register", MIToken::kw_cfi_def_cfa_register) in getIdentifierKind()
228 .Case("def_cfa_offset", MIToken::kw_cfi_def_cfa_offset) in getIdentifierKind()
229 .Case("adjust_cfa_offset", MIToken::kw_cfi_adjust_cfa_offset) in getIdentifierKind()
230 .Case("escape", MIToken::kw_cfi_escape) in getIdentifierKind()
231 .Case("def_cfa", MIToken::kw_cfi_def_cfa) in getIdentifierKind()
232 .Case("llvm_def_aspace_cfa", MIToken::kw_cfi_llvm_def_aspace_cfa) in getIdentifierKind()
233 .Case("remember_state", MIToken::kw_cfi_remember_state) in getIdentifierKind()
234 .Case("restore", MIToken::kw_cfi_restore) in getIdentifierKind()
235 .Case("restore_state", MIToken::kw_cfi_restore_state) in getIdentifierKind()
236 .Case("undefined", MIToken::kw_cfi_undefined) in getIdentifierKind()
237 .Case("register", MIToken::kw_cfi_register) in getIdentifierKind()
238 .Case("window_save", MIToken::kw_cfi_window_save) in getIdentifierKind()
240 MIToken::kw_cfi_aarch64_negate_ra_sign_state) in getIdentifierKind()
241 .Case("blockaddress", MIToken::kw_blockaddress) in getIdentifierKind()
242 .Case("intrinsic", MIToken::kw_intrinsic) in getIdentifierKind()
243 .Case("target-index", MIToken::kw_target_index) in getIdentifierKind()
244 .Case("half", MIToken::kw_half) in getIdentifierKind()
245 .Case("bfloat", MIToken::kw_bfloat) in getIdentifierKind()
246 .Case("float", MIToken::kw_float) in getIdentifierKind()
247 .Case("double", MIToken::kw_double) in getIdentifierKind()
248 .Case("x86_fp80", MIToken::kw_x86_fp80) in getIdentifierKind()
249 .Case("fp128", MIToken::kw_fp128) in getIdentifierKind()
250 .Case("ppc_fp128", MIToken::kw_ppc_fp128) in getIdentifierKind()
251 .Case("target-flags", MIToken::kw_target_flags) in getIdentifierKind()
252 .Case("volatile", MIToken::kw_volatile) in getIdentifierKind()
253 .Case("non-temporal", MIToken::kw_non_temporal) in getIdentifierKind()
254 .Case("dereferenceable", MIToken::kw_dereferenceable) in getIdentifierKind()
255 .Case("invariant", MIToken::kw_invariant) in getIdentifierKind()
256 .Case("align", MIToken::kw_align) in getIdentifierKind()
257 .Case("basealign", MIToken::kw_basealign) in getIdentifierKind()
258 .Case("addrspace", MIToken::kw_addrspace) in getIdentifierKind()
259 .Case("stack", MIToken::kw_stack) in getIdentifierKind()
260 .Case("got", MIToken::kw_got) in getIdentifierKind()
261 .Case("jump-table", MIToken::kw_jump_table) in getIdentifierKind()
262 .Case("constant-pool", MIToken::kw_constant_pool) in getIdentifierKind()
263 .Case("call-entry", MIToken::kw_call_entry) in getIdentifierKind()
264 .Case("custom", MIToken::kw_custom) in getIdentifierKind()
265 .Case("liveout", MIToken::kw_liveout) in getIdentifierKind()
266 .Case("landing-pad", MIToken::kw_landing_pad) in getIdentifierKind()
268 MIToken::kw_inlineasm_br_indirect_target) in getIdentifierKind()
269 .Case("ehfunclet-entry", MIToken::kw_ehfunclet_entry) in getIdentifierKind()
270 .Case("liveins", MIToken::kw_liveins) in getIdentifierKind()
271 .Case("successors", MIToken::kw_successors) in getIdentifierKind()
272 .Case("floatpred", MIToken::kw_floatpred) in getIdentifierKind()
273 .Case("intpred", MIToken::kw_intpred) in getIdentifierKind()
274 .Case("shufflemask", MIToken::kw_shufflemask) in getIdentifierKind()
275 .Case("pre-instr-symbol", MIToken::kw_pre_instr_symbol) in getIdentifierKind()
276 .Case("post-instr-symbol", MIToken::kw_post_instr_symbol) in getIdentifierKind()
277 .Case("heap-alloc-marker", MIToken::kw_heap_alloc_marker) in getIdentifierKind()
278 .Case("pcsections", MIToken::kw_pcsections) in getIdentifierKind()
279 .Case("cfi-type", MIToken::kw_cfi_type) in getIdentifierKind()
280 .Case("bbsections", MIToken::kw_bbsections) in getIdentifierKind()
281 .Case("bb_id", MIToken::kw_bb_id) in getIdentifierKind()
282 .Case("unknown-size", MIToken::kw_unknown_size) in getIdentifierKind()
283 .Case("unknown-address", MIToken::kw_unknown_address) in getIdentifierKind()
284 .Case("distinct", MIToken::kw_distinct) in getIdentifierKind()
285 .Case("ir-block-address-taken", MIToken::kw_ir_block_address_taken) in getIdentifierKind()
287 MIToken::kw_machine_block_address_taken) in getIdentifierKind()
288 .Case("call-frame-size", MIToken::kw_call_frame_size) in getIdentifierKind()
289 .Case("noconvergent", MIToken::kw_noconvergent) in getIdentifierKind()
290 .Default(MIToken::Identifier); in getIdentifierKind()
293 static Cursor maybeLexIdentifier(Cursor C, MIToken &Token) { in maybeLexIdentifier()
305 static Cursor maybeLexMachineBasicBlock(Cursor C, MIToken &Token, in maybeLexMachineBasicBlock()
314 Token.reset(MIToken::Error, C.remaining()); in maybeLexMachineBasicBlock()
332 Token.reset(IsReference ? MIToken::MachineBasicBlock in maybeLexMachineBasicBlock()
333 : MIToken::MachineBasicBlockLabel, in maybeLexMachineBasicBlock()
340 static Cursor maybeLexIndex(Cursor C, MIToken &Token, StringRef Rule, in maybeLexIndex()
341 MIToken::TokenKind Kind) { in maybeLexIndex()
353 static Cursor maybeLexIndexAndName(Cursor C, MIToken &Token, StringRef Rule, in maybeLexIndexAndName()
354 MIToken::TokenKind Kind) { in maybeLexIndexAndName()
376 static Cursor maybeLexJumpTableIndex(Cursor C, MIToken &Token) { in maybeLexJumpTableIndex()
377 return maybeLexIndex(C, Token, "%jump-table.", MIToken::JumpTableIndex); in maybeLexJumpTableIndex()
380 static Cursor maybeLexStackObject(Cursor C, MIToken &Token) { in maybeLexStackObject()
381 return maybeLexIndexAndName(C, Token, "%stack.", MIToken::StackObject); in maybeLexStackObject()
384 static Cursor maybeLexFixedStackObject(Cursor C, MIToken &Token) { in maybeLexFixedStackObject()
385 return maybeLexIndex(C, Token, "%fixed-stack.", MIToken::FixedStackObject); in maybeLexFixedStackObject()
388 static Cursor maybeLexConstantPoolItem(Cursor C, MIToken &Token) { in maybeLexConstantPoolItem()
389 return maybeLexIndex(C, Token, "%const.", MIToken::ConstantPoolItem); in maybeLexConstantPoolItem()
392 static Cursor maybeLexSubRegisterIndex(Cursor C, MIToken &Token, in maybeLexSubRegisterIndex()
397 return lexName(C, Token, MIToken::SubRegisterIndex, Rule.size(), in maybeLexSubRegisterIndex()
401 static Cursor maybeLexIRBlock(Cursor C, MIToken &Token, in maybeLexIRBlock()
407 return maybeLexIndex(C, Token, Rule, MIToken::IRBlock); in maybeLexIRBlock()
408 return lexName(C, Token, MIToken::NamedIRBlock, Rule.size(), ErrorCallback); in maybeLexIRBlock()
411 static Cursor maybeLexIRValue(Cursor C, MIToken &Token, in maybeLexIRValue()
417 return maybeLexIndex(C, Token, Rule, MIToken::IRValue); in maybeLexIRValue()
418 return lexName(C, Token, MIToken::NamedIRValue, Rule.size(), ErrorCallback); in maybeLexIRValue()
421 static Cursor maybeLexStringConstant(Cursor C, MIToken &Token, in maybeLexStringConstant()
425 return lexName(C, Token, MIToken::StringConstant, /*PrefixLength=*/0, in maybeLexStringConstant()
429 static Cursor lexVirtualRegister(Cursor C, MIToken &Token) { in lexVirtualRegister()
435 Token.reset(MIToken::VirtualRegister, Range.upto(C)) in lexVirtualRegister()
445 static Cursor lexNamedVirtualRegister(Cursor C, MIToken &Token) { in lexNamedVirtualRegister()
450 Token.reset(MIToken::NamedVirtualRegister, Range.upto(C)) in lexNamedVirtualRegister()
455 static Cursor maybeLexRegister(Cursor C, MIToken &Token, in maybeLexRegister()
475 Token.reset(MIToken::NamedRegister, Range.upto(C)) in maybeLexRegister()
480 static Cursor maybeLexGlobalValue(Cursor C, MIToken &Token, in maybeLexGlobalValue()
485 return lexName(C, Token, MIToken::NamedGlobalValue, /*PrefixLength=*/1, in maybeLexGlobalValue()
492 Token.reset(MIToken::GlobalValue, Range.upto(C)) in maybeLexGlobalValue()
497 static Cursor maybeLexExternalSymbol(Cursor C, MIToken &Token, in maybeLexExternalSymbol()
501 return lexName(C, Token, MIToken::ExternalSymbol, /*PrefixLength=*/1, in maybeLexExternalSymbol()
505 static Cursor maybeLexMCSymbol(Cursor C, MIToken &Token, in maybeLexMCSymbol()
521 Token.reset(MIToken::Error, Start.remaining()); in maybeLexMCSymbol()
526 Token.reset(MIToken::MCSymbol, Start.upto(C)).setStringValue(String); in maybeLexMCSymbol()
535 Token.reset(MIToken::Error, Start.remaining()); in maybeLexMCSymbol()
542 Token.reset(MIToken::Error, Start.remaining()); in maybeLexMCSymbol()
547 Token.reset(MIToken::MCSymbol, Start.upto(R)) in maybeLexMCSymbol()
556 static Cursor lexFloatingPointLiteral(Cursor Range, Cursor C, MIToken &Token) { in lexFloatingPointLiteral()
568 Token.reset(MIToken::FloatingPointLiteral, Range.upto(C)); in lexFloatingPointLiteral()
572 static Cursor maybeLexHexadecimalLiteral(Cursor C, MIToken &Token) { in maybeLexHexadecimalLiteral()
588 Token.reset(MIToken::HexLiteral, Range.upto(C)); in maybeLexHexadecimalLiteral()
590 Token.reset(MIToken::FloatingPointLiteral, Range.upto(C)); in maybeLexHexadecimalLiteral()
594 static Cursor maybeLexNumericalLiteral(Cursor C, MIToken &Token) { in maybeLexNumericalLiteral()
604 Token.reset(MIToken::IntegerLiteral, StrVal).setIntegerValue(APSInt(StrVal)); in maybeLexNumericalLiteral()
608 static MIToken::TokenKind getMetadataKeywordKind(StringRef Identifier) { in getMetadataKeywordKind()
609 return StringSwitch<MIToken::TokenKind>(Identifier) in getMetadataKeywordKind()
610 .Case("!tbaa", MIToken::md_tbaa) in getMetadataKeywordKind()
611 .Case("!alias.scope", MIToken::md_alias_scope) in getMetadataKeywordKind()
612 .Case("!noalias", MIToken::md_noalias) in getMetadataKeywordKind()
613 .Case("!range", MIToken::md_range) in getMetadataKeywordKind()
614 .Case("!DIExpression", MIToken::md_diexpr) in getMetadataKeywordKind()
615 .Case("!DILocation", MIToken::md_dilocation) in getMetadataKeywordKind()
616 .Default(MIToken::Error); in getMetadataKeywordKind()
619 static Cursor maybeLexExclaim(Cursor C, MIToken &Token, in maybeLexExclaim()
626 Token.reset(MIToken::exclaim, Range.upto(C)); in maybeLexExclaim()
639 static MIToken::TokenKind symbolToken(char C) { in symbolToken()
642 return MIToken::comma; in symbolToken()
644 return MIToken::dot; in symbolToken()
646 return MIToken::equal; in symbolToken()
648 return MIToken::colon; in symbolToken()
650 return MIToken::lparen; in symbolToken()
652 return MIToken::rparen; in symbolToken()
654 return MIToken::lbrace; in symbolToken()
656 return MIToken::rbrace; in symbolToken()
658 return MIToken::plus; in symbolToken()
660 return MIToken::minus; in symbolToken()
662 return MIToken::less; in symbolToken()
664 return MIToken::greater; in symbolToken()
666 return MIToken::Error; in symbolToken()
670 static Cursor maybeLexSymbol(Cursor C, MIToken &Token) { in maybeLexSymbol()
671 MIToken::TokenKind Kind; in maybeLexSymbol()
674 Kind = MIToken::coloncolon; in maybeLexSymbol()
678 if (Kind == MIToken::Error) in maybeLexSymbol()
686 static Cursor maybeLexNewline(Cursor C, MIToken &Token) { in maybeLexNewline()
691 Token.reset(MIToken::Newline, Range.upto(C)); in maybeLexNewline()
695 static Cursor maybeLexEscapedIRValue(Cursor C, MIToken &Token, in maybeLexEscapedIRValue()
707 Token.reset(MIToken::Error, Range.remaining()); in maybeLexEscapedIRValue()
714 Token.reset(MIToken::QuotedIRValue, Range.upto(C)).setStringValue(Value); in maybeLexEscapedIRValue()
718 StringRef llvm::lexMIToken(StringRef Source, MIToken &Token, in lexMIToken()
722 Token.reset(MIToken::Eof, C.remaining()); in lexMIToken()
769 Token.reset(MIToken::Error, C.remaining()); in lexMIToken()