[all-commits] [llvm/llvm-project] 52053a: [NVPTX] Disable parens for identifiers starting wi...
Andrew Savonichev via All-commits
all-commits at lists.llvm.org
Sun Apr 17 08:03:02 PDT 2022
Author: Andrew Savonichev <andrew.savonichev at gmail.com>
Date: 2022-04-17 (Sun, 17 Apr 2022)
[NVPTX] Disable parens for identifiers starting with '$'
ptxas fails to parse such syntax:
mov.u64 %rd1, ($str);
fatal : Parsing error near '$str': syntax error
A new MCAsmInfo option was added because InParens parameter of
MCExpr::print is not sufficient to disable parens
completely. MCExpr::print resets it to false for a recursive call in
case of unary or binary expressions.
Targets that require parens around identifiers that start with '$'
should always pass MCAsmInfo to MCExpr::print.
Therefore 'operator<<(raw_ostream &, MCExpr&)' should be avoided
because it calls MCExpr::print with nullptr MAI.
Differential Revision: https://reviews.llvm.org/D123702
More information about the All-commits