summaryrefslogtreecommitdiff
path: root/gcc/type-collector.hpp
blob: 44d7695ccc5a0cfab151d620a063c428932dd2e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once

#include "type-walker.hpp"
#include "collect-types.h"
#include <map>
#include <stack>

class TypeCollector : public TypeWalker {
public:
  void collect(const_tree t);
  TypeCollector() {};
  ptrset_t get_pointer_set() { _sanity_check(); return ptrset; }
private:
  std::map<const_tree, bool> ptr;
  ptrset_t ptrset;
  void _sanity_check();
  void _collect_simple(const_tree t);
  virtual bool is_memoized(const_tree t);

  virtual void _walk_void_pre(const_tree t);
  virtual void _walk_void_post(const_tree t);
  virtual void _walk_integer_pre(const_tree t);
  virtual void _walk_integer_post(const_tree t);
  virtual void _walk_real_pre(const_tree t);
  virtual void _walk_real_post(const_tree t);
  virtual void _walk_fixed_point_pre(const_tree t);
  virtual void _walk_fixed_point_post(const_tree t);
  virtual void _walk_complex_pre(const_tree t);
  virtual void _walk_complex_post(const_tree t);
  virtual void _walk_enumeral_pre(const_tree t);
  virtual void _walk_enumeral_post(const_tree t);
  virtual void _walk_boolean_pre(const_tree t);
  virtual void _walk_boolean_post(const_tree t);
  virtual void _walk_array_pre(const_tree t);
  virtual void _walk_array_post(const_tree t);
  virtual void _walk_pointer_pre(const_tree t);
  virtual void _walk_pointer_post(const_tree t);
  virtual void _walk_reference_pre(const_tree t);
  virtual void _walk_reference_post(const_tree t);
  virtual void _walk_record_pre(const_tree t);
  virtual void _walk_record_post(const_tree t);
  virtual void _walk_union_pre(const_tree t);
  virtual void _walk_union_post(const_tree t);
  virtual void _walk_function_pre(const_tree t);
  virtual void _walk_function_post(const_tree t);
  virtual void _walk_method_pre(const_tree t);
  virtual void _walk_method_post(const_tree t);
};