aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/util/rust-hir-map.h
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-02-16 17:53:55 +0000
committerPhilip Herron <philip.herron@embecosm.com>2022-02-17 13:28:24 +0000
commita026c166f077027f9997282cf63b0c6d02948ce0 (patch)
treedb381fcf0a856f5aad3f91e44cfaecda12709f7b /gcc/rust/util/rust-hir-map.h
parent864df7901cfb2581b226939bec85d75c2f301aa3 (diff)
downloadgcc-a026c166f077027f9997282cf63b0c6d02948ce0.zip
gcc-a026c166f077027f9997282cf63b0c6d02948ce0.tar.gz
gcc-a026c166f077027f9997282cf63b0c6d02948ce0.tar.bz2
Add mappings helpers for looking up macros definitions
Diffstat (limited to 'gcc/rust/util/rust-hir-map.h')
-rw-r--r--gcc/rust/util/rust-hir-map.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/rust/util/rust-hir-map.h b/gcc/rust/util/rust-hir-map.h
index 8781629..799351b 100644
--- a/gcc/rust/util/rust-hir-map.h
+++ b/gcc/rust/util/rust-hir-map.h
@@ -559,6 +559,10 @@ public:
return true;
}
+ void insert_macro_def (AST::MacroRulesDefinition *macro);
+
+ bool lookup_macro_def (NodeId id, AST::MacroRulesDefinition **def);
+
private:
Mappings ();
@@ -612,6 +616,9 @@ private:
// all hirid nodes
std::map<CrateNum, std::set<HirId>> hirNodesWithinCrate;
+ // macros
+ std::map<NodeId, AST::MacroRulesDefinition *> macroMappings;
+
// crate names
std::map<CrateNum, std::string> crate_names;
};