Minimized use of Parser.Lex() by using higher-level parse functions.
For example, a commonly used pattern
if (getLexer().isNot(Tok)) { return err; } Parser.Lex();
may be replaced with the following code:
if (!trySkipToken(Tok)) { return err; }
Paths
| Differential D93548
[AMDGPU][MC][NFC] Parser refactoring ClosedPublic Authored by dp on Dec 18 2020, 8:53 AM.
Details
Summary Minimized use of Parser.Lex() by using higher-level parse functions. if (getLexer().isNot(Tok)) { return err; } Parser.Lex(); may be replaced with the following code: if (!trySkipToken(Tok)) { return err; }
Diff Detail
Event TimelineHerald added subscribers: kerbowa, hiraditya, t-tye and 7 others. · View Herald TranscriptDec 18 2020, 8:53 AM This revision is now accepted and ready to land.Dec 18 2020, 12:22 PM Closed by commit rG8ab5770a17fe: [AMDGPU][MC][NFC] Parser refactoring (authored by dp). · Explain WhyDec 21 2020, 9:23 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 313122 llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
|
After this change callers of parseStringWithPrefix no longer need to call lex()