@@ -117,8 +117,8 @@ struct generic_compiler {
117
117
}
118
118
};
119
119
120
- struct definition {
121
- const detail::definition_info * info;
120
+ struct overrider {
121
+ const detail::overrider_info * info;
122
122
std::vector<class_*> vp;
123
123
std::uintptr_t pf;
124
124
std::size_t method_index, spec_index;
@@ -147,14 +147,14 @@ struct generic_compiler {
147
147
struct method {
148
148
detail::method_info* info;
149
149
std::vector<class_*> vp;
150
- std::vector<definition > specs;
150
+ std::vector<overrider > specs;
151
151
std::vector<std::size_t > slots;
152
152
std::vector<std::size_t > strides;
153
- std::vector<const definition *> dispatch_table;
153
+ std::vector<const overrider *> dispatch_table;
154
154
// following two are dummies, when converting to a function pointer, we will
155
155
// get the corresponding pointer from method_info
156
- definition not_implemented;
157
- definition ambiguous;
156
+ overrider not_implemented;
157
+ overrider ambiguous;
158
158
const std::uintptr_t * gv_dispatch_table{nullptr };
159
159
auto arity () const {
160
160
return vp.size ();
@@ -199,11 +199,11 @@ trace_type<Policy>& operator<<(
199
199
struct spec_name {
200
200
spec_name (
201
201
const detail::generic_compiler::method& method,
202
- const detail::generic_compiler::definition * def)
202
+ const detail::generic_compiler::overrider * def)
203
203
: method(method), def(def) {
204
204
}
205
205
const detail::generic_compiler::method& method;
206
- const detail::generic_compiler::definition * def;
206
+ const detail::generic_compiler::overrider * def;
207
207
};
208
208
209
209
template <class Policy >
@@ -251,10 +251,10 @@ struct compiler : detail::generic_compiler {
251
251
bool concrete);
252
252
void install_gv ();
253
253
void print (const update_method_report& report) const ;
254
- static std::vector<const definition *>
255
- best (std::vector<const definition *>& candidates);
256
- static bool is_more_specific (const definition * a, const definition * b);
257
- static bool is_base (const definition * a, const definition * b);
254
+ static std::vector<const overrider *>
255
+ best (std::vector<const overrider *>& candidates);
256
+ static bool is_more_specific (const overrider * a, const overrider * b);
257
+ static bool is_base (const overrider * a, const overrider * b);
258
258
259
259
static type_id static_type (type_id type) {
260
260
if constexpr (std::is_base_of_v<
@@ -342,15 +342,15 @@ void compiler<Policy>::resolve_static_type_ids() {
342
342
}
343
343
344
344
if (!method.specs .empty ())
345
- for (auto & definition : method.specs ) {
346
- if (*definition .vp_end == 0 ) {
345
+ for (auto & overrider : method.specs ) {
346
+ if (*overrider .vp_end == 0 ) {
347
347
for (auto & ti : range{
348
- definition .vp_begin ,
349
- definition .vp_end }) {
348
+ overrider .vp_begin ,
349
+ overrider .vp_end }) {
350
350
resolve (&ti);
351
351
}
352
352
353
- *definition .vp_end = 1 ;
353
+ *overrider .vp_end = 1 ;
354
354
}
355
355
}
356
356
}
@@ -578,18 +578,18 @@ void compiler<Policy>::augment_methods() {
578
578
meth_iter->specs .resize (spec_size);
579
579
auto spec_iter = meth_iter->specs .begin ();
580
580
581
- for (auto & definition_info : meth_info.specs ) {
581
+ for (auto & overrider_info : meth_info.specs ) {
582
582
spec_iter->method_index = meth_iter - methods.begin ();
583
583
spec_iter->spec_index = spec_iter - meth_iter->specs .begin ();
584
584
585
- ++trace << type_name (definition_info .type ) << " ("
586
- << definition_info .pf << " )\n " ;
587
- spec_iter->info = &definition_info ;
585
+ ++trace << type_name (overrider_info .type ) << " ("
586
+ << overrider_info .pf << " )\n " ;
587
+ spec_iter->info = &overrider_info ;
588
588
spec_iter->vp .reserve (meth_info.arity ());
589
589
std::size_t param_index = 0 ;
590
590
591
591
for (auto type :
592
- range{definition_info .vp_begin , definition_info .vp_end }) {
592
+ range{overrider_info .vp_begin , overrider_info .vp_end }) {
593
593
indent _ (trace);
594
594
auto class_ = class_map[Policy::type_index (type)];
595
595
if (!class_) {
@@ -892,18 +892,18 @@ void compiler<Policy>::build_dispatch_tables() {
892
892
accumulate (m.report , report);
893
893
++trace << " assigning next\n " ;
894
894
895
- std::vector<const definition *> specs;
895
+ std::vector<const overrider *> specs;
896
896
std::transform (
897
897
m.specs .begin (), m.specs .end (), std::back_inserter (specs),
898
- [](const definition & spec) { return &spec; });
898
+ [](const overrider & spec) { return &spec; });
899
899
900
900
for (auto & spec : m.specs ) {
901
901
indent _ (trace);
902
902
++trace << type_name (spec.info ->type ) << " :\n " ;
903
- std::vector<const definition *> candidates;
903
+ std::vector<const overrider *> candidates;
904
904
std::copy_if (
905
905
specs.begin (), specs.end (), std::back_inserter (candidates),
906
- [&spec](const definition * other) {
906
+ [&spec](const overrider * other) {
907
907
return is_base (other, &spec);
908
908
});
909
909
@@ -922,7 +922,7 @@ void compiler<Policy>::build_dispatch_tables() {
922
922
void * next;
923
923
924
924
if (nexts.size () == 1 ) {
925
- const definition_info * next_info = nexts.front ()->info ;
925
+ const overrider_info * next_info = nexts.front ()->info ;
926
926
next = next_info->pf ;
927
927
++trace << " -> "
928
928
<< " #" << nexts.front ()->spec_index
@@ -966,7 +966,7 @@ void compiler<Policy>::build_dispatch_table(
966
966
}
967
967
968
968
if (dim == 0 ) {
969
- std::vector<const definition *> applicable;
969
+ std::vector<const overrider *> applicable;
970
970
std::size_t i = 0 ;
971
971
972
972
for (const auto & spec : m.specs ) {
@@ -1129,12 +1129,12 @@ void compiler<Policy>::install_gv() {
1129
1129
}
1130
1130
1131
1131
template <class Policy >
1132
- std::vector<const detail::generic_compiler::definition *>
1133
- compiler<Policy>::best(std::vector<const definition *>& candidates) {
1134
- std::vector<const definition *> best;
1132
+ std::vector<const detail::generic_compiler::overrider *>
1133
+ compiler<Policy>::best(std::vector<const overrider *>& candidates) {
1134
+ std::vector<const overrider *> best;
1135
1135
1136
1136
for (auto spec : candidates) {
1137
- const definition * candidate = spec;
1137
+ const overrider * candidate = spec;
1138
1138
1139
1139
for (auto iter = best.begin (); iter != best.end ();) {
1140
1140
if (is_more_specific (spec, *iter)) {
@@ -1157,7 +1157,7 @@ compiler<Policy>::best(std::vector<const definition*>& candidates) {
1157
1157
1158
1158
template <class Policy >
1159
1159
bool compiler<Policy>::is_more_specific(
1160
- const definition * a, const definition * b) {
1160
+ const overrider * a, const overrider * b) {
1161
1161
bool result = false ;
1162
1162
1163
1163
auto a_iter = a->vp .begin (), a_last = a->vp .end (), b_iter = b->vp .begin ();
@@ -1179,7 +1179,7 @@ bool compiler<Policy>::is_more_specific(
1179
1179
}
1180
1180
1181
1181
template <class Policy >
1182
- bool compiler<Policy>::is_base(const definition * a, const definition * b) {
1182
+ bool compiler<Policy>::is_base(const overrider * a, const overrider * b) {
1183
1183
bool result = false ;
1184
1184
1185
1185
auto a_iter = a->vp .begin (), a_last = a->vp .end (), b_iter = b->vp .begin ();
0 commit comments