[PATCH] D120635: [RISCV] Fix parseBareSymbol to not double-parse top-level operators
Jessica Clarke via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 27 12:49:11 PST 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6aa8521fdb7a: [RISCV] Fix parseBareSymbol to not double-parse top-level operators (authored by jrtc27).
Changed prior to commit:
https://reviews.llvm.org/D120635?vs=411696&id=411700#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120635/new/
https://reviews.llvm.org/D120635
Files:
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
llvm/test/MC/RISCV/rvi-pseudos.s
Index: llvm/test/MC/RISCV/rvi-pseudos.s
===================================================================
--- llvm/test/MC/RISCV/rvi-pseudos.s
+++ llvm/test/MC/RISCV/rvi-pseudos.s
@@ -187,3 +187,9 @@
# CHECK: auipc a5, %pcrel_hi((255+a_symbol)-4)
# CHECK: addi a5, a5, %pcrel_lo(.Lpcrel_hi30)
lla a5, (0xFF + a_symbol) - 4
+
+## Check that we don't double-parse a top-level minus.
+# CHECK: .Lpcrel_hi31:
+# CHECK: auipc a5, %pcrel_hi(a_symbol-4)
+# CHECK: addi a5, a5, %pcrel_lo(.Lpcrel_hi31)
+lla a5, a_symbol - 4
Index: llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
===================================================================
--- llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
+++ llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
@@ -1613,9 +1613,11 @@
return MatchOperand_Success;
case AsmToken::Plus:
Opcode = MCBinaryExpr::Add;
+ getLexer().Lex();
break;
case AsmToken::Minus:
Opcode = MCBinaryExpr::Sub;
+ getLexer().Lex();
break;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120635.411700.patch
Type: text/x-patch
Size: 1008 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220227/f5f19891/attachment.bin>
More information about the llvm-commits
mailing list