aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/module.cc
blob: 02b5af811896c411c5d6a4a75605207f0fcf7cc1 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
/* C++ modules.  Experimental!
   Copyright (C) 2017-2020 Free Software Foundation, Inc.
   Written by Nathan Sidwell <nathan@acm.org> while at FaceBook

   This file is part of GCC.

   GCC is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3, or (at your option)
   any later version.

   GCC is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.  */

/* This file intentionally left empty of all but barest minium.  */

/* In expermental (trunk) sources, MODULE_VERSION is a #define passed
   in from the Makefile.  It records the modification date of the
   source directory -- that's the only way to stay sane.  In release
   sources, we (plan to) use the compiler's major.minor versioning.
   While the format might not change between at minor versions, it
   seems simplest to tie the two together.  There's no concept of
   inter-version compatibility.  */
#define IS_EXPERIMENTAL(V) ((V) >= (1U << 20))
#define MODULE_MAJOR(V) ((V) / 10000)
#define MODULE_MINOR(V) ((V) % 10000)
#define EXPERIMENT(A,B) (IS_EXPERIMENTAL (MODULE_VERSION) ? (A) : (B))
#ifndef MODULE_VERSION
// Be sure you're ready!  Remove #error this before release!
#error "Shtopp! What are you doing? This is not ready yet."
#include "bversion.h"
#define MODULE_VERSION (BUILDING_GCC_MAJOR * 10000U + BUILDING_GCC_MINOR)
#elif !IS_EXPERIMENTAL (MODULE_VERSION)
#error "This is not the version I was looking for."
#endif

#define _DEFAULT_SOURCE 1 /* To get TZ field of struct tm, if available.  */
#include "config.h"

#include "system.h"
#include "coretypes.h"
#include "cp-tree.h"
#include "timevar.h"
#include "stringpool.h"
#include "dumpfile.h"
#include "bitmap.h"
#include "cgraph.h"
#include "tree-iterator.h"
#include "cpplib.h"
#include "mkdeps.h"
#include "incpath.h"
#include "libiberty.h"
#include "stor-layout.h"
#include "version.h"
#include "tree-diagnostic.h"
#include "toplev.h"
#include "opts.h"
#include "attribs.h"
#include "intl.h"
#include "langhooks.h"

/* Id for dumping module information.  */
int module_dump_id;

/* What the current TU is.  */
unsigned module_kind;

module_state *
get_module (tree, module_state *, bool)
{
  return nullptr;
}

const char *
module_name (unsigned, bool)
{
  return nullptr;
}

bitmap
get_import_bitmap ()
{
  return nullptr;
}

void
mangle_module (int, bool)
{
}

void
mangle_module_fini ()
{
}

int
module_initializer_kind ()
{
  return 0;
}

void
module_add_import_initializers ()
{
}

int
get_originating_module (tree, bool)
{
  return 0;
}

unsigned
get_importing_module (tree, bool)
{
  return 0;
}

bool
module_may_redeclare (tree)
{
  return true;
}

void
set_instantiating_module (tree)
{
}

void
set_defining_module (tree)
{
}

tree
get_originating_module_decl (tree decl)
{
  return decl;
}

void
set_originating_module (tree, bool)
{
}

void
lazy_load_binding (unsigned, tree, tree, binding_slot *)
{
}

void
lazy_load_members (tree)
{
}

bool
lazy_specializations_p (unsigned, bool, bool)
{
  return false;
}

bitmap
visible_instantiation_path (bitmap *)
{
  return nullptr;
}

void
import_module (module_state *, location_t, bool, tree, cpp_reader *)
{
}

void
declare_module (module_state *, location_t, bool, tree, cpp_reader *)
{
}

module_state *
preprocess_module (module_state *, unsigned, bool, bool, bool, cpp_reader *)
{
  return nullptr;
}

void
preprocessed_module (cpp_reader *)
{
}

void
module_begin_main_file (cpp_reader *, line_maps *, const line_map_ordinary *)
{
}

void
init_modules (cpp_reader *)
{
  /* Do not turn on yet.  */
  if (modules_p ())
    fatal_error (input_location,
		 "Shtopp! What are you doing? This is not ready yet.");
}

void
maybe_check_all_macros (cpp_reader *)
{
}

void
fini_modules ()
{
}

bool
handle_module_option (unsigned, const char *, int)
{
  return false;
}

void
module_preprocess_options (cpp_reader *)
{
}