diff options
author | SimplyTheOther <simplytheother@gmail.com> | 2020-10-05 22:23:06 +0800 |
---|---|---|
committer | SimplyTheOther <simplytheother@gmail.com> | 2020-12-08 21:10:13 +0800 |
commit | 423462fb6785896c8031319d50ac38fbca3afb51 (patch) | |
tree | 2189e0aefa07f55ade13bd052e9d852f3afdccfa /gcc/rust/expand/rust-macro-expand.h | |
parent | e7cf2f7789dccbb1d8aac6222b2b1c0f4d5f18f6 (diff) | |
download | gcc-423462fb6785896c8031319d50ac38fbca3afb51.zip gcc-423462fb6785896c8031319d50ac38fbca3afb51.tar.gz gcc-423462fb6785896c8031319d50ac38fbca3afb51.tar.bz2 |
Added proper cfg_attr expansion
Diffstat (limited to 'gcc/rust/expand/rust-macro-expand.h')
-rw-r--r-- | gcc/rust/expand/rust-macro-expand.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/rust/expand/rust-macro-expand.h b/gcc/rust/expand/rust-macro-expand.h index 92cb06d..7e684a9 100644 --- a/gcc/rust/expand/rust-macro-expand.h +++ b/gcc/rust/expand/rust-macro-expand.h @@ -27,7 +27,7 @@ struct MacroExpander ExpansionCfg cfg; unsigned int expansion_depth = 0; - MacroExpander (AST::Crate &crate, ExpansionCfg cfg) : cfg (cfg), crate (crate) + MacroExpander (AST::Crate &crate, ExpansionCfg cfg, Session &session) : cfg (cfg), crate (crate), session (session) {} ~MacroExpander () = default; @@ -40,11 +40,15 @@ struct MacroExpander // should this be public or private? void expand_invoc (std::unique_ptr<AST::MacroInvocation> &invoc); + void expand_cfg_attrs(std::vector<AST::Attribute>& attrs); + bool check_cfg(AST::Attribute& attr); + /* TODO: make it extend ASTVisitor so that individual items can be accessed * properly? */ private: AST::Crate &crate; + Session &session; }; } // namespace Rust |