]> git.lizzy.rs Git - rust.git/blob - src/librustc/hir/map/definitions.rs
Rollup merge of #62523 - pnkfelix:delay-bug-to-resolve-issue-62203-ice, r=varkor
[rust.git] / src / librustc / hir / map / definitions.rs
1 //! For each definition, we track the following data. A definition
2 //! here is defined somewhat circularly as "something with a `DefId`",
3 //! but it generally corresponds to things like structs, enums, etc.
4 //! There are also some rather random cases (like const initializer
5 //! expressions) that are mostly just leftovers.
6
7 use crate::hir;
8 use crate::hir::def_id::{CrateNum, DefId, DefIndex, LOCAL_CRATE, CRATE_DEF_INDEX};
9 use crate::ich::Fingerprint;
10 use rustc_data_structures::fx::FxHashMap;
11 use rustc_data_structures::indexed_vec::{IndexVec};
12 use rustc_data_structures::stable_hasher::StableHasher;
13 use crate::session::CrateDisambiguator;
14 use std::borrow::Borrow;
15 use std::fmt::Write;
16 use std::hash::Hash;
17 use syntax::ast;
18 use syntax::ext::hygiene::ExpnId;
19 use syntax::symbol::{Symbol, sym, InternedString};
20 use syntax_pos::{Span, DUMMY_SP};
21 use crate::util::nodemap::NodeMap;
22
23 /// The DefPathTable maps DefIndexes to DefKeys and vice versa.
24 /// Internally the DefPathTable holds a tree of DefKeys, where each DefKey
25 /// stores the DefIndex of its parent.
26 /// There is one DefPathTable for each crate.
27 #[derive(Clone, Default, RustcDecodable, RustcEncodable)]
28 pub struct DefPathTable {
29     index_to_key: Vec<DefKey>,
30     def_path_hashes: Vec<DefPathHash>,
31 }
32
33 impl DefPathTable {
34     fn allocate(&mut self,
35                 key: DefKey,
36                 def_path_hash: DefPathHash)
37                 -> DefIndex {
38         let index = {
39             let index = DefIndex::from(self.index_to_key.len());
40             debug!("DefPathTable::insert() - {:?} <-> {:?}", key, index);
41             self.index_to_key.push(key);
42             index
43         };
44         self.def_path_hashes.push(def_path_hash);
45         debug_assert!(self.def_path_hashes.len() == self.index_to_key.len());
46         index
47     }
48
49     pub fn next_id(&self) -> DefIndex {
50         DefIndex::from(self.index_to_key.len())
51     }
52
53     #[inline(always)]
54     pub fn def_key(&self, index: DefIndex) -> DefKey {
55         self.index_to_key[index.index()].clone()
56     }
57
58     #[inline(always)]
59     pub fn def_path_hash(&self, index: DefIndex) -> DefPathHash {
60         let ret = self.def_path_hashes[index.index()];
61         debug!("def_path_hash({:?}) = {:?}", index, ret);
62         return ret
63     }
64
65     pub fn add_def_path_hashes_to(&self,
66                                   cnum: CrateNum,
67                                   out: &mut FxHashMap<DefPathHash, DefId>) {
68         out.extend(
69             self.def_path_hashes
70                 .iter()
71                 .enumerate()
72                 .map(|(index, &hash)| {
73                     let def_id = DefId {
74                         krate: cnum,
75                         index: DefIndex::from(index),
76                     };
77                     (hash, def_id)
78                 })
79         );
80     }
81
82     pub fn size(&self) -> usize {
83         self.index_to_key.len()
84     }
85 }
86
87 /// The definition table containing node definitions.
88 /// It holds the `DefPathTable` for local `DefId`s/`DefPath`s and it also stores a
89 /// mapping from `NodeId`s to local `DefId`s.
90 #[derive(Clone, Default)]
91 pub struct Definitions {
92     table: DefPathTable,
93     node_to_def_index: NodeMap<DefIndex>,
94     def_index_to_node: Vec<ast::NodeId>,
95     pub(super) node_to_hir_id: IndexVec<ast::NodeId, hir::HirId>,
96     /// If `ExpnId` is an ID of some macro expansion,
97     /// then `DefId` is the normal module (`mod`) in which the expanded macro was defined.
98     parent_modules_of_macro_defs: FxHashMap<ExpnId, DefId>,
99     /// Item with a given `DefIndex` was defined during macro expansion with ID `ExpnId`.
100     expansions_that_defined: FxHashMap<DefIndex, ExpnId>,
101     next_disambiguator: FxHashMap<(DefIndex, DefPathData), u32>,
102     def_index_to_span: FxHashMap<DefIndex, Span>,
103     /// When collecting definitions from an AST fragment produced by a macro invocation `ExpnId`
104     /// we know what parent node that fragment should be attached to thanks to this table.
105     invocation_parents: FxHashMap<ExpnId, DefIndex>,
106 }
107
108 /// A unique identifier that we can use to lookup a definition
109 /// precisely. It combines the index of the definition's parent (if
110 /// any) with a `DisambiguatedDefPathData`.
111 #[derive(Clone, PartialEq, Debug, Hash, RustcEncodable, RustcDecodable)]
112 pub struct DefKey {
113     /// The parent path.
114     pub parent: Option<DefIndex>,
115
116     /// The identifier of this node.
117     pub disambiguated_data: DisambiguatedDefPathData,
118 }
119
120 impl DefKey {
121     fn compute_stable_hash(&self, parent_hash: DefPathHash) -> DefPathHash {
122         let mut hasher = StableHasher::new();
123
124         // We hash a 0u8 here to disambiguate between regular DefPath hashes,
125         // and the special "root_parent" below.
126         0u8.hash(&mut hasher);
127         parent_hash.hash(&mut hasher);
128
129         let DisambiguatedDefPathData {
130             ref data,
131             disambiguator,
132         } = self.disambiguated_data;
133
134         ::std::mem::discriminant(data).hash(&mut hasher);
135         if let Some(name) = data.get_opt_name() {
136             name.hash(&mut hasher);
137         }
138
139         disambiguator.hash(&mut hasher);
140
141         DefPathHash(hasher.finish())
142     }
143
144     fn root_parent_stable_hash(crate_name: &str,
145                                crate_disambiguator: CrateDisambiguator)
146                                -> DefPathHash {
147         let mut hasher = StableHasher::new();
148         // Disambiguate this from a regular DefPath hash,
149         // see compute_stable_hash() above.
150         1u8.hash(&mut hasher);
151         crate_name.hash(&mut hasher);
152         crate_disambiguator.hash(&mut hasher);
153         DefPathHash(hasher.finish())
154     }
155 }
156
157 /// A pair of `DefPathData` and an integer disambiguator. The integer is
158 /// normally 0, but in the event that there are multiple defs with the
159 /// same `parent` and `data`, we use this field to disambiguate
160 /// between them. This introduces some artificial ordering dependency
161 /// but means that if you have (e.g.) two impls for the same type in
162 /// the same module, they do get distinct `DefId`s.
163 #[derive(Clone, PartialEq, Debug, Hash, RustcEncodable, RustcDecodable)]
164 pub struct DisambiguatedDefPathData {
165     pub data: DefPathData,
166     pub disambiguator: u32
167 }
168
169 #[derive(Clone, Debug, Hash, RustcEncodable, RustcDecodable)]
170 pub struct DefPath {
171     /// The path leading from the crate root to the item.
172     pub data: Vec<DisambiguatedDefPathData>,
173
174     /// The crate root this path is relative to.
175     pub krate: CrateNum,
176 }
177
178 impl DefPath {
179     pub fn is_local(&self) -> bool {
180         self.krate == LOCAL_CRATE
181     }
182
183     pub fn make<FN>(krate: CrateNum,
184                     start_index: DefIndex,
185                     mut get_key: FN) -> DefPath
186         where FN: FnMut(DefIndex) -> DefKey
187     {
188         let mut data = vec![];
189         let mut index = Some(start_index);
190         loop {
191             debug!("DefPath::make: krate={:?} index={:?}", krate, index);
192             let p = index.unwrap();
193             let key = get_key(p);
194             debug!("DefPath::make: key={:?}", key);
195             match key.disambiguated_data.data {
196                 DefPathData::CrateRoot => {
197                     assert!(key.parent.is_none());
198                     break;
199                 }
200                 _ => {
201                     data.push(key.disambiguated_data);
202                     index = key.parent;
203                 }
204             }
205         }
206         data.reverse();
207         DefPath { data: data, krate: krate }
208     }
209
210     /// Returns a string representation of the `DefPath` without
211     /// the crate-prefix. This method is useful if you don't have
212     /// a `TyCtxt` available.
213     pub fn to_string_no_crate(&self) -> String {
214         let mut s = String::with_capacity(self.data.len() * 16);
215
216         for component in &self.data {
217             write!(s,
218                    "::{}[{}]",
219                    component.data.as_interned_str(),
220                    component.disambiguator)
221                 .unwrap();
222         }
223
224         s
225     }
226
227     /// Returns a filename-friendly string for the `DefPath`, with the
228     /// crate-prefix.
229     pub fn to_string_friendly<F>(&self, crate_imported_name: F) -> String
230         where F: FnOnce(CrateNum) -> Symbol
231     {
232         let crate_name_str = crate_imported_name(self.krate).as_str();
233         let mut s = String::with_capacity(crate_name_str.len() + self.data.len() * 16);
234
235         write!(s, "::{}", crate_name_str).unwrap();
236
237         for component in &self.data {
238             if component.disambiguator == 0 {
239                 write!(s, "::{}", component.data.as_interned_str()).unwrap();
240             } else {
241                 write!(s,
242                        "{}[{}]",
243                        component.data.as_interned_str(),
244                        component.disambiguator)
245                        .unwrap();
246             }
247         }
248
249         s
250     }
251
252     /// Returns a filename-friendly string of the `DefPath`, without
253     /// the crate-prefix. This method is useful if you don't have
254     /// a `TyCtxt` available.
255     pub fn to_filename_friendly_no_crate(&self) -> String {
256         let mut s = String::with_capacity(self.data.len() * 16);
257
258         let mut opt_delimiter = None;
259         for component in &self.data {
260             opt_delimiter.map(|d| s.push(d));
261             opt_delimiter = Some('-');
262             if component.disambiguator == 0 {
263                 write!(s, "{}", component.data.as_interned_str()).unwrap();
264             } else {
265                 write!(s,
266                        "{}[{}]",
267                        component.data.as_interned_str(),
268                        component.disambiguator)
269                        .unwrap();
270             }
271         }
272         s
273     }
274 }
275
276 #[derive(Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
277 pub enum DefPathData {
278     // Root: these should only be used for the root nodes, because
279     // they are treated specially by the `def_path` function.
280     /// The crate root (marker)
281     CrateRoot,
282     // Catch-all for random DefId things like `DUMMY_NODE_ID`
283     Misc,
284     // Different kinds of items and item-like things:
285     /// An impl
286     Impl,
287     /// Something in the type NS
288     TypeNs(InternedString),
289     /// Something in the value NS
290     ValueNs(InternedString),
291     /// Something in the macro NS
292     MacroNs(InternedString),
293     /// Something in the lifetime NS
294     LifetimeNs(InternedString),
295     /// A closure expression
296     ClosureExpr,
297     // Subportions of items
298     /// Implicit ctor for a unit or tuple-like struct or enum variant.
299     Ctor,
300     /// A constant expression (see {ast,hir}::AnonConst).
301     AnonConst,
302     /// An `impl Trait` type node
303     ImplTrait,
304     /// Identifies a piece of crate metadata that is global to a whole crate
305     /// (as opposed to just one item). `GlobalMetaData` components are only
306     /// supposed to show up right below the crate root.
307     GlobalMetaData(InternedString),
308 }
309
310 #[derive(Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord, Debug,
311          RustcEncodable, RustcDecodable)]
312 pub struct DefPathHash(pub Fingerprint);
313
314 impl_stable_hash_for!(tuple_struct DefPathHash { fingerprint });
315
316 impl Borrow<Fingerprint> for DefPathHash {
317     #[inline]
318     fn borrow(&self) -> &Fingerprint {
319         &self.0
320     }
321 }
322
323 impl Definitions {
324     pub fn def_path_table(&self) -> &DefPathTable {
325         &self.table
326     }
327
328     /// Gets the number of definitions.
329     pub fn def_index_count(&self) -> usize {
330         self.table.index_to_key.len()
331     }
332
333     pub fn def_key(&self, index: DefIndex) -> DefKey {
334         self.table.def_key(index)
335     }
336
337     #[inline(always)]
338     pub fn def_path_hash(&self, index: DefIndex) -> DefPathHash {
339         self.table.def_path_hash(index)
340     }
341
342     /// Returns the path from the crate root to `index`. The root
343     /// nodes are not included in the path (i.e., this will be an
344     /// empty vector for the crate root). For an inlined item, this
345     /// will be the path of the item in the external crate (but the
346     /// path will begin with the path to the external crate).
347     pub fn def_path(&self, index: DefIndex) -> DefPath {
348         DefPath::make(LOCAL_CRATE, index, |p| self.def_key(p))
349     }
350
351     #[inline]
352     pub fn opt_def_index(&self, node: ast::NodeId) -> Option<DefIndex> {
353         self.node_to_def_index.get(&node).cloned()
354     }
355
356     #[inline]
357     pub fn opt_local_def_id(&self, node: ast::NodeId) -> Option<DefId> {
358         self.opt_def_index(node).map(DefId::local)
359     }
360
361     #[inline]
362     pub fn local_def_id(&self, node: ast::NodeId) -> DefId {
363         self.opt_local_def_id(node).unwrap()
364     }
365
366     #[inline]
367     pub fn as_local_node_id(&self, def_id: DefId) -> Option<ast::NodeId> {
368         if def_id.krate == LOCAL_CRATE {
369             let node_id = self.def_index_to_node[def_id.index.index()];
370             if node_id != ast::DUMMY_NODE_ID {
371                 return Some(node_id);
372             }
373         }
374         None
375     }
376
377     #[inline]
378     pub fn as_local_hir_id(&self, def_id: DefId) -> Option<hir::HirId> {
379         if def_id.krate == LOCAL_CRATE {
380             let hir_id = self.def_index_to_hir_id(def_id.index);
381             if hir_id != hir::DUMMY_HIR_ID {
382                 Some(hir_id)
383             } else {
384                 None
385             }
386         } else {
387             None
388         }
389     }
390
391     #[inline]
392     pub fn node_to_hir_id(&self, node_id: ast::NodeId) -> hir::HirId {
393         self.node_to_hir_id[node_id]
394     }
395
396     #[inline]
397     pub fn def_index_to_hir_id(&self, def_index: DefIndex) -> hir::HirId {
398         let node_id = self.def_index_to_node[def_index.index()];
399         self.node_to_hir_id[node_id]
400     }
401
402     /// Retrieves the span of the given `DefId` if `DefId` is in the local crate, the span exists
403     /// and it's not `DUMMY_SP`.
404     #[inline]
405     pub fn opt_span(&self, def_id: DefId) -> Option<Span> {
406         if def_id.krate == LOCAL_CRATE {
407             self.def_index_to_span.get(&def_id.index).cloned()
408         } else {
409             None
410         }
411     }
412
413     /// Adds a root definition (no parent) and a few other reserved definitions.
414     ///
415     /// After the initial definitions are created the first `FIRST_FREE_DEF_INDEX` indexes
416     /// are taken, so the "user" indexes will be allocated starting with `FIRST_FREE_DEF_INDEX`
417     /// in ascending order.
418     pub fn create_root_def(&mut self,
419                            crate_name: &str,
420                            crate_disambiguator: CrateDisambiguator)
421                            -> DefIndex {
422         let key = DefKey {
423             parent: None,
424             disambiguated_data: DisambiguatedDefPathData {
425                 data: DefPathData::CrateRoot,
426                 disambiguator: 0
427             }
428         };
429
430         let parent_hash = DefKey::root_parent_stable_hash(crate_name,
431                                                           crate_disambiguator);
432         let def_path_hash = key.compute_stable_hash(parent_hash);
433
434         // Create the definition.
435         let root_index = self.table.allocate(key, def_path_hash);
436         assert_eq!(root_index, CRATE_DEF_INDEX);
437         assert!(self.def_index_to_node.is_empty());
438         self.def_index_to_node.push(ast::CRATE_NODE_ID);
439         self.node_to_def_index.insert(ast::CRATE_NODE_ID, root_index);
440         self.set_invocation_parent(ExpnId::root(), root_index);
441
442         // Allocate some other DefIndices that always must exist.
443         GlobalMetaDataKind::allocate_def_indices(self);
444
445         root_index
446     }
447
448     /// Adds a definition with a parent definition.
449     pub fn create_def_with_parent(&mut self,
450                                   parent: DefIndex,
451                                   node_id: ast::NodeId,
452                                   data: DefPathData,
453                                   expn_id: ExpnId,
454                                   span: Span)
455                                   -> DefIndex {
456         debug!("create_def_with_parent(parent={:?}, node_id={:?}, data={:?})",
457                parent, node_id, data);
458
459         assert!(!self.node_to_def_index.contains_key(&node_id),
460                 "adding a def'n for node-id {:?} and data {:?} but a previous def'n exists: {:?}",
461                 node_id,
462                 data,
463                 self.table.def_key(self.node_to_def_index[&node_id]));
464
465         // The root node must be created with create_root_def()
466         assert!(data != DefPathData::CrateRoot);
467
468         // Find the next free disambiguator for this key.
469         let disambiguator = {
470             let next_disamb = self.next_disambiguator.entry((parent, data.clone())).or_insert(0);
471             let disambiguator = *next_disamb;
472             *next_disamb = next_disamb.checked_add(1).expect("disambiguator overflow");
473             disambiguator
474         };
475
476         let key = DefKey {
477             parent: Some(parent),
478             disambiguated_data: DisambiguatedDefPathData {
479                 data, disambiguator
480             }
481         };
482
483         let parent_hash = self.table.def_path_hash(parent);
484         let def_path_hash = key.compute_stable_hash(parent_hash);
485
486         debug!("create_def_with_parent: after disambiguation, key = {:?}", key);
487
488         // Create the definition.
489         let index = self.table.allocate(key, def_path_hash);
490         assert_eq!(index.index(), self.def_index_to_node.len());
491         self.def_index_to_node.push(node_id);
492
493         // Some things for which we allocate DefIndices don't correspond to
494         // anything in the AST, so they don't have a NodeId. For these cases
495         // we don't need a mapping from NodeId to DefIndex.
496         if node_id != ast::DUMMY_NODE_ID {
497             debug!("create_def_with_parent: def_index_to_node[{:?} <-> {:?}", index, node_id);
498             self.node_to_def_index.insert(node_id, index);
499         }
500
501         if expn_id != ExpnId::root() {
502             self.expansions_that_defined.insert(index, expn_id);
503         }
504
505         // The span is added if it isn't dummy
506         if !span.is_dummy() {
507             self.def_index_to_span.insert(index, span);
508         }
509
510         index
511     }
512
513     /// Initialize the `ast::NodeId` to `HirId` mapping once it has been generated during
514     /// AST to HIR lowering.
515     pub fn init_node_id_to_hir_id_mapping(&mut self,
516                                           mapping: IndexVec<ast::NodeId, hir::HirId>) {
517         assert!(self.node_to_hir_id.is_empty(),
518                 "Trying initialize NodeId -> HirId mapping twice");
519         self.node_to_hir_id = mapping;
520     }
521
522     pub fn expansion_that_defined(&self, index: DefIndex) -> ExpnId {
523         self.expansions_that_defined.get(&index).cloned().unwrap_or(ExpnId::root())
524     }
525
526     pub fn parent_module_of_macro_def(&self, expn_id: ExpnId) -> DefId {
527         self.parent_modules_of_macro_defs[&expn_id]
528     }
529
530     pub fn add_parent_module_of_macro_def(&mut self, expn_id: ExpnId, module: DefId) {
531         self.parent_modules_of_macro_defs.insert(expn_id, module);
532     }
533
534     pub fn invocation_parent(&self, invoc_id: ExpnId) -> DefIndex {
535         self.invocation_parents[&invoc_id]
536     }
537
538     pub fn set_invocation_parent(&mut self, invoc_id: ExpnId, parent: DefIndex) {
539         let old_parent = self.invocation_parents.insert(invoc_id, parent);
540         assert!(old_parent.is_none(), "parent def-index is reset for an invocation");
541     }
542 }
543
544 impl DefPathData {
545     pub fn get_opt_name(&self) -> Option<InternedString> {
546         use self::DefPathData::*;
547         match *self {
548             TypeNs(name) |
549             ValueNs(name) |
550             MacroNs(name) |
551             LifetimeNs(name) |
552             GlobalMetaData(name) => Some(name),
553
554             Impl |
555             CrateRoot |
556             Misc |
557             ClosureExpr |
558             Ctor |
559             AnonConst |
560             ImplTrait => None
561         }
562     }
563
564     pub fn as_interned_str(&self) -> InternedString {
565         use self::DefPathData::*;
566         let s = match *self {
567             TypeNs(name) |
568             ValueNs(name) |
569             MacroNs(name) |
570             LifetimeNs(name) |
571             GlobalMetaData(name) => {
572                 return name
573             }
574             // Note that this does not show up in user print-outs.
575             CrateRoot => sym::double_braced_crate,
576             Impl => sym::double_braced_impl,
577             Misc => sym::double_braced_misc,
578             ClosureExpr => sym::double_braced_closure,
579             Ctor => sym::double_braced_constructor,
580             AnonConst => sym::double_braced_constant,
581             ImplTrait => sym::double_braced_opaque,
582         };
583
584         s.as_interned_str()
585     }
586
587     pub fn to_string(&self) -> String {
588         self.as_interned_str().to_string()
589     }
590 }
591
592 /// Evaluates to the number of tokens passed to it.
593 ///
594 /// Logarithmic counting: every one or two recursive expansions, the number of
595 /// tokens to count is divided by two, instead of being reduced by one.
596 /// Therefore, the recursion depth is the binary logarithm of the number of
597 /// tokens to count, and the expanded tree is likewise very small.
598 macro_rules! count {
599     ()                     => (0usize);
600     ($one:tt)              => (1usize);
601     ($($pairs:tt $_p:tt)*) => (count!($($pairs)*) << 1usize);
602     ($odd:tt $($rest:tt)*) => (count!($($rest)*) | 1usize);
603 }
604
605 // We define the GlobalMetaDataKind enum with this macro because we want to
606 // make sure that we exhaustively iterate over all variants when registering
607 // the corresponding DefIndices in the DefTable.
608 macro_rules! define_global_metadata_kind {
609     (pub enum GlobalMetaDataKind {
610         $($variant:ident),*
611     }) => (
612         #[derive(Clone, Copy, Debug, Hash, RustcEncodable, RustcDecodable)]
613         pub enum GlobalMetaDataKind {
614             $($variant),*
615         }
616
617         pub const FIRST_FREE_DEF_INDEX: usize = 1 + count!($($variant)*);
618
619         impl GlobalMetaDataKind {
620             fn allocate_def_indices(definitions: &mut Definitions) {
621                 $({
622                     let instance = GlobalMetaDataKind::$variant;
623                     definitions.create_def_with_parent(
624                         CRATE_DEF_INDEX,
625                         ast::DUMMY_NODE_ID,
626                         DefPathData::GlobalMetaData(instance.name().as_interned_str()),
627                         ExpnId::root(),
628                         DUMMY_SP
629                     );
630
631                     // Make sure calling def_index does not crash.
632                     instance.def_index(&definitions.table);
633                 })*
634             }
635
636             pub fn def_index(&self, def_path_table: &DefPathTable) -> DefIndex {
637                 let def_key = DefKey {
638                     parent: Some(CRATE_DEF_INDEX),
639                     disambiguated_data: DisambiguatedDefPathData {
640                         data: DefPathData::GlobalMetaData(self.name().as_interned_str()),
641                         disambiguator: 0,
642                     }
643                 };
644
645                 // These DefKeys are all right after the root,
646                 // so a linear search is fine.
647                 let index = def_path_table.index_to_key
648                                           .iter()
649                                           .position(|k| *k == def_key)
650                                           .unwrap();
651
652                 DefIndex::from(index)
653             }
654
655             fn name(&self) -> Symbol {
656
657                 let string = match *self {
658                     $(
659                         GlobalMetaDataKind::$variant => {
660                             concat!("{{GlobalMetaData::", stringify!($variant), "}}")
661                         }
662                     )*
663                 };
664
665                 Symbol::intern(string)
666             }
667         }
668     )
669 }
670
671 define_global_metadata_kind!(pub enum GlobalMetaDataKind {
672     Krate,
673     CrateDeps,
674     DylibDependencyFormats,
675     LangItems,
676     LangItemsMissing,
677     NativeLibraries,
678     SourceMap,
679     Impls,
680     ExportedSymbols
681 });