aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve/rust-ast-resolve-expr.h
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-03-07 18:19:01 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2022-03-11 09:21:29 +0100
commitf02392c8b378a68fb2525098a41a90bd16faa7fd (patch)
tree5ed1ad4ae2afdde2a1a92644ea39802a3971b197 /gcc/rust/resolve/rust-ast-resolve-expr.h
parent39c04258300be68a36b80f2f23929a97e8af1865 (diff)
downloadgcc-f02392c8b378a68fb2525098a41a90bd16faa7fd.zip
gcc-f02392c8b378a68fb2525098a41a90bd16faa7fd.tar.gz
gcc-f02392c8b378a68fb2525098a41a90bd16faa7fd.tar.bz2
macros: Replace macro invocations with expanded nodes
Different parsing functions need to be called based on the context surrounding the macro invocation. This commit adds a flowchart trying to explain the base resolving rules Macro expansion happens at the same level as stripping, where nodes might get removed if they are gated behind an unmet predicate. We also perform macro expansion during this visitor's pass. What we can do is thus to replace macro invocations with new items that might have resulted from macro expansion: Since we're already mutating numerous elements by removing them if they should be stripped, we can also add elements if they should be expanded. This commit also "fixes" macro test cases so that they are now accepted by the new parser, which is more strict than it should for now. Co-authored-by: SimplyTheOther <simplytheother@gmail.com> Co-authored-by: philberty <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-expr.h')
-rw-r--r--gcc/rust/resolve/rust-ast-resolve-expr.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-expr.h b/gcc/rust/resolve/rust-ast-resolve-expr.h
index d8bd203..a049ba1 100644
--- a/gcc/rust/resolve/rust-ast-resolve-expr.h
+++ b/gcc/rust/resolve/rust-ast-resolve-expr.h
@@ -62,8 +62,6 @@ public:
static void go (AST::Expr *expr, NodeId parent, const CanonicalPath &prefix,
const CanonicalPath &canonical_prefix);
- void visit (AST::MacroInvocation &expr) override;
-
void visit (AST::TupleIndexExpr &expr) override;
void visit (AST::TupleExpr &expr) override;