[llvm-bugs] [Bug 48515] New: [AMDGPU][MC] Common code patterns in parser
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Dec 15 05:40:13 PST 2020
https://bugs.llvm.org/show_bug.cgi?id=48515
Bug ID: 48515
Summary: [AMDGPU][MC] Common code patterns in parser
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Backend: AMDGPU
Assignee: unassignedbugs at nondot.org
Reporter: dpreobrazhensky at luxoft.com
CC: llvm-bugs at lists.llvm.org
AMDGPU parser code has repeatedly used patterns which could be simplified.
Examples:
if (getLexer().isNot(X)) {
return ERR_CODE;
} Parser.Lex(); --> if (!trySkipToken(X)) return ERR_CODE;
Parser.getTok().getLoc() --> getLoc()
Parser.getTok().getString() --> getTokenStr()
Parser.getTok() --> getToken()
getLexer().getKind() == X --> isToken(X)
getLexer().getKind() --> getTokenKind()
getLexer().is(X) --> isToken(X)
getLexer().isNot(X) --> !isToken(X)
Parser.Lex() --> lex()
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201215/6c742cc8/attachment.html>
More information about the llvm-bugs
mailing list