Skip to content

Commit e00035c

Browse files
committed
Avoid compiler range-loop-analysis failure when using xcode command line tools 12.0.
1 parent 64a995b commit e00035c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+235
-235
lines changed

src/compiler/asserts.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void replaceAssertVertex(NGHolder &g, NFAVertex t, const ExpressionInfo &expr,
127127

128128
// Wire up all the predecessors to all the successors.
129129

130-
for (const auto &inEdge : in_edges_range(t, g)) {
130+
for (const auto inEdge : in_edges_range(t, g)) {
131131
NFAVertex u = source(inEdge, g);
132132
if (u == t) {
133133
continue; // ignore self-loops
@@ -141,7 +141,7 @@ void replaceAssertVertex(NGHolder &g, NFAVertex t, const ExpressionInfo &expr,
141141
continue;
142142
}
143143

144-
for (const auto &outEdge : out_edges_range(t, g)) {
144+
for (const auto outEdge : out_edges_range(t, g)) {
145145
NFAVertex v = target(outEdge, g);
146146

147147
DEBUG_PRINTF("consider path [%zu,%zu,%zu]\n", g[u].index,
@@ -229,7 +229,7 @@ void checkForMultilineStart(ReportManager &rm, NGHolder &g,
229229

230230
/* we need to interpose a dummy dot vertex between v and accept if
231231
* required so that ^ doesn't match trailing \n */
232-
for (const auto &e : out_edges_range(v, g)) {
232+
for (const auto e : out_edges_range(v, g)) {
233233
if (target(e, g) == g.accept) {
234234
dead.push_back(e);
235235
}
@@ -283,7 +283,7 @@ void removeAssertVertices(ReportManager &rm, NGHolder &g,
283283

284284
// Build a cache of (u, v) vertex pairs to edge descriptors.
285285
edge_cache_t edge_cache;
286-
for (const auto &e : edges_range(g)) {
286+
for (const auto e : edges_range(g)) {
287287
edge_cache[make_pair(source(e, g), target(e, g))] = e;
288288
}
289289

src/nfa/castlecompile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ void getNeighborInfo(const CliqueGraph &g, vector<u32> &neighbor,
155155
u32 id = g[cv].stateId;
156156

157157
// find neighbors for cv
158-
for (const auto &v : adjacent_vertices_range(cv, g)) {
158+
for (const auto v : adjacent_vertices_range(cv, g)) {
159159
if (g[v].stateId != id && contains(group, g[v].stateId)) {
160160
neighbor.push_back(g[v].stateId);
161161
DEBUG_PRINTF("Neighbor:%u\n", g[v].stateId);

src/nfa/goughcompile.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ void copy_propagation(GoughGraph &g, const Grey &grey) {
504504
for (auto v : vertices_range(g)) {
505505
copy_propagate_update_vars(g[v].vars, &changes);
506506
}
507-
for (const auto &e : edges_range(g)) {
507+
for (const auto e : edges_range(g)) {
508508
copy_propagate_update_vars(g[e].vars, &changes);
509509
}
510510
} while(changes);
@@ -562,7 +562,7 @@ void remove_dead(GoughGraph &g) {
562562
i--;
563563
}
564564
}
565-
for (const auto &e : edges_range(g)) {
565+
for (const auto e : edges_range(g)) {
566566
for (u32 i = 0; i < g[e].vars.size(); i++) {
567567
GoughSSAVar *var = g[e].vars[i].get();
568568
if (var->seen) {
@@ -896,7 +896,7 @@ static
896896
void build_blocks(const GoughGraph &g,
897897
map<gough_edge_id, vector<gough_ins> > *blocks,
898898
u32 base_temp_slot) {
899-
for (const auto &e : edges_range(g)) {
899+
for (const auto e : edges_range(g)) {
900900
if (g[e].vars.empty()) {
901901
continue;
902902
}
@@ -946,7 +946,7 @@ void copy_in_blocks(raw_som_dfa &raw, u8 alphaShift, const GoughGraph &cfg,
946946
assert(top_sym == raw.alpha_size - 1U);
947947
map<vector<gough_ins>, u32> &processed = *prog_offsets;
948948

949-
for (const auto &e : edges_range(cfg)) {
949+
for (const auto e : edges_range(cfg)) {
950950
if (!contains(blocks, gough_edge_id(cfg, e))) {
951951
continue;
952952
}
@@ -985,7 +985,7 @@ void copy_in_blocks(raw_som_dfa &raw, u8 alphaShift, const GoughGraph &cfg,
985985
}
986986

987987
bool find_normal_self_loop(GoughVertex v, const GoughGraph &g, GoughEdge *out) {
988-
for (const auto &e : out_edges_range(v, g)) {
988+
for (const auto e : out_edges_range(v, g)) {
989989
if (target(e, g) != v) {
990990
continue;
991991
}

src/nfa/goughcompile_accel.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ bool verify_neighbour(const GoughGraph &g, GoughVertex u,
146146
const map<gough_edge_id, vector<gough_ins> > &blocks,
147147
const set<GoughVertex> &succs,
148148
const vector<gough_ins> &block_sl) {
149-
for (const auto &e : out_edges_range(u, g)) {
149+
for (const auto e : out_edges_range(u, g)) {
150150
if (!g[e].reach.any()) { /* ignore top edges */
151151
continue;
152152
}
@@ -172,7 +172,7 @@ static
172172
bool verify_neighbour_no_block(const GoughGraph &g, GoughVertex u,
173173
const map<gough_edge_id, vector<gough_ins> > &blocks,
174174
const set<GoughVertex> &succs) {
175-
for (const auto &e : out_edges_range(u, g)) {
175+
for (const auto e : out_edges_range(u, g)) {
176176
if (!g[e].reach.any()) { /* ignore top edges */
177177
continue;
178178
}
@@ -216,7 +216,7 @@ bool allow_two_byte_accel(const GoughGraph &g,
216216
const auto &block_sl = blocks.at(gough_edge_id(g, self_loop));
217217

218218
set<GoughVertex> succs;
219-
for (const auto &e : out_edges_range(v, g)) {
219+
for (const auto e : out_edges_range(v, g)) {
220220
if (g[e].reach.none()) { /* ignore top edges */
221221
continue;
222222
}
@@ -237,7 +237,7 @@ bool allow_two_byte_accel(const GoughGraph &g,
237237
} else {
238238
DEBUG_PRINTF("no edge plan on self loop\n");
239239
set<GoughVertex> succs;
240-
for (const auto &e : out_edges_range(v, g)) {
240+
for (const auto e : out_edges_range(v, g)) {
241241
if (g[e].reach.none()) { /* ignore top edges */
242242
continue;
243243
}

src/nfa/goughcompile_dump.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void dump_graph(const GoughGraph &g, const string &base, const Grey &grey) {
8585

8686
fprintf(f, "label = \"%u\"];\n", g[v].state_id);
8787
}
88-
for (const auto &e : edges_range(g)) {
88+
for (const auto e : edges_range(g)) {
8989
GoughVertex s = source(e, g);
9090
GoughVertex t = target(e, g);
9191

@@ -153,7 +153,7 @@ void dump_var_mapping(const GoughGraph &g, const string &base,
153153
fprintf(f, "\n");
154154
}
155155
}
156-
for (const auto &e : edges_range(g)) {
156+
for (const auto e : edges_range(g)) {
157157
set<const GoughSSAVar *> used = uses(g[e]);
158158
if (g[e].vars.empty() && used.empty()) {
159159
continue;
@@ -200,7 +200,7 @@ void gather_vars(const GoughGraph &g, vector<const GoughSSAVar *> *vars,
200200
}
201201
}
202202

203-
for (const auto &e : edges_range(g)) {
203+
for (const auto e : edges_range(g)) {
204204
for (u32 i = 0; i < g[e].vars.size(); i++) {
205205
const GoughSSAVar *vp = g[e].vars[i].get();
206206
stringstream ss;

src/nfa/goughcompile_reg.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void all_vars(const GoughGraph &g, vector<GoughSSAVar *> *out) {
6060
for (auto v : vertices_range(g)) {
6161
push_back_all_raw(out, g[v].vars);
6262
}
63-
for (const auto &e : edges_range(g)) {
63+
for (const auto e : edges_range(g)) {
6464
push_back_all_raw(out, g[e].vars);
6565
}
6666
}
@@ -89,7 +89,7 @@ void fill_aux(const GoughGraph &g, GoughGraphAux *aux) {
8989
aux->reporters[var].insert(v);
9090
}
9191
}
92-
for (const auto &e : edges_range(g)) {
92+
for (const auto e : edges_range(g)) {
9393
for (const auto &var : g[e].vars) {
9494
aux->containing_e[var.get()] = e;
9595
DEBUG_PRINTF("%u is on edge %u->%u\n", var->slot,
@@ -217,7 +217,7 @@ void handle_pending_vertex(GoughVertex def_v, const GoughGraph &g,
217217
DEBUG_PRINTF("contains target vertex\n");
218218
return; /* we have reached def */
219219
}
220-
for (const auto &e : in_edges_range(current, g)) {
220+
for (const auto e : in_edges_range(current, g)) {
221221
handle_pending_edge(g, e, nullptr, pending_vertex, rv);
222222
}
223223
}
@@ -293,7 +293,7 @@ u32 initial_slots(const GoughGraph &g) {
293293
for (auto v : vertices_range(g)) {
294294
set_initial_slots(g[v].vars, &next_slot);
295295
}
296-
for (const auto &e : edges_range(g)) {
296+
for (const auto e : edges_range(g)) {
297297
set_initial_slots(g[e].vars, &next_slot);
298298
}
299299

@@ -405,7 +405,7 @@ void find_dom_ordering(const GoughGraph &cfg, vector<GoughSSAVar *> *out) {
405405

406406
for (auto it = g_order.rbegin(); it != g_order.rend(); ++it) {
407407
add_to_dom_ordering(cfg[*it].vars, out);
408-
for (const auto &e : out_edges_range(*it, cfg)) {
408+
for (const auto e : out_edges_range(*it, cfg)) {
409409
add_to_dom_ordering(cfg[e].vars, out);
410410
}
411411
}
@@ -444,7 +444,7 @@ void update_local_slots(GoughGraph &g, set<GoughSSAVar *> &locals,
444444
/* local variables only occur on edges (joins are never local) */
445445

446446
u32 allocated_count = 0;
447-
for (const auto &e : edges_range(g)) {
447+
for (const auto e : edges_range(g)) {
448448
u32 next_slot = local_base;
449449
for (auto &var : g[e].vars) {
450450
if (contains(locals, var.get())) {

src/nfa/limex_compile.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,7 @@ void findMaskedCompressionStates(const build_info &args,
12391239
if (!inspects_states_for_accepts(h)
12401240
&& !hasInitDsStates(h, args.state_ids)) {
12411241
NFAStateSet nonleaf(args.num_states);
1242-
for (const auto &e : edges_range(h)) {
1242+
for (const auto e : edges_range(h)) {
12431243
u32 from = args.state_ids.at(source(e, h));
12441244
u32 to = args.state_ids.at(target(e, h));
12451245
if (from == NO_STATE) {
@@ -1459,7 +1459,7 @@ u32 buildExceptionMap(const build_info &args, ReportListCache &reports_cache,
14591459
}
14601460

14611461
// are we a non-limited transition?
1462-
for (const auto &oe : out_edges_range(v, h)) {
1462+
for (const auto oe : out_edges_range(v, h)) {
14631463
if (contains(exceptional, oe)) {
14641464
NFAVertex w = target(oe, h);
14651465
u32 w_idx = args.state_ids.at(w);
@@ -1550,7 +1550,7 @@ static
15501550
u32 findMaxVarShift(const build_info &args, u32 nShifts) {
15511551
const NGHolder &h = args.h;
15521552
u32 shiftMask = 0;
1553-
for (const auto &e : edges_range(h)) {
1553+
for (const auto e : edges_range(h)) {
15541554
u32 from = args.state_ids.at(source(e, h));
15551555
u32 to = args.state_ids.at(target(e, h));
15561556
if (from == NO_STATE || to == NO_STATE) {
@@ -1579,7 +1579,7 @@ int getLimexScore(const build_info &args, u32 nShifts) {
15791579
maxVarShift = findMaxVarShift(args, nShifts);
15801580

15811581
NFAStateSet exceptionalStates(args.num_states);
1582-
for (const auto &e : edges_range(h)) {
1582+
for (const auto e : edges_range(h)) {
15831583
u32 from = args.state_ids.at(source(e, h));
15841584
u32 to = args.state_ids.at(target(e, h));
15851585
if (from == NO_STATE || to == NO_STATE) {
@@ -1870,7 +1870,7 @@ struct Factory {
18701870
u32 shiftMask = 0;
18711871
int shiftMaskIdx = 0;
18721872

1873-
for (const auto &e : edges_range(h)) {
1873+
for (const auto e : edges_range(h)) {
18741874
u32 from = args.state_ids.at(source(e, h));
18751875
u32 to = args.state_ids.at(target(e, h));
18761876
if (from == NO_STATE || to == NO_STATE) {
@@ -1908,7 +1908,7 @@ struct Factory {
19081908
u32 maxShift) {
19091909
const NGHolder &h = args.h;
19101910

1911-
for (const auto &e : edges_range(h)) {
1911+
for (const auto e : edges_range(h)) {
19121912
u32 from = args.state_ids.at(source(e, h));
19131913
u32 to = args.state_ids.at(target(e, h));
19141914
if (from == NO_STATE || to == NO_STATE) {

src/nfa/mcsheng_compile.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ dstate_id_t find_sheng_states(dfa_info &info,
549549
/* get an estimate of stickness of the cyclic: assume any edges from
550550
* states with larger state ids are back edges */
551551
CharReach est_back_reach;
552-
for (const auto &u : inv_adjacent_vertices_range(v, g)) {
552+
for (const auto u : inv_adjacent_vertices_range(v, g)) {
553553
if (g[u].index < g[v].index) {
554554
continue;
555555
}
@@ -587,7 +587,7 @@ dstate_id_t find_sheng_states(dfa_info &info,
587587
}
588588

589589
sheng_states.insert(v);
590-
for (const auto &t : adjacent_vertices_range(v, g)) {
590+
for (const auto t : adjacent_vertices_range(v, g)) {
591591
if (!contains(considered, g[t].index)) {
592592
to_consider.push_back(t);
593593
}

src/nfagraph/ng_anchored_dots.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ void reformAnchoredRepeatsComponent(NGHolder &g,
177177
bool selfLoop = false;
178178
bool bustOut = false;
179179

180-
for (const auto &e : out_edges_range(dotV, g)) {
180+
for (const auto e : out_edges_range(dotV, g)) {
181181
NFAVertex t = target(e, g);
182182
if (t == dotV) {
183183
selfLoop = true;
@@ -280,7 +280,7 @@ void reformUnanchoredRepeatsComponent(NGHolder &g,
280280
bool selfLoop = false;
281281
bool bustOut = false;
282282

283-
for (const auto &e : out_edges_range(dotV, g)) {
283+
for (const auto e : out_edges_range(dotV, g)) {
284284
NFAVertex t = target(e, g);
285285

286286
if (t == dotV) {

src/nfagraph/ng_asserts.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static const CharReach CHARREACH_NONWORD_UCP_PRE(CHARREACH_NONWORD);
9292
static
9393
vector<NFAEdge> getAsserts(const NGHolder &g) {
9494
vector<NFAEdge> out;
95-
for (const auto &e : edges_range(g)) {
95+
for (const auto e : edges_range(g)) {
9696
if (g[e].assert_flags) {
9797
out.push_back(e);
9898
}
@@ -255,7 +255,7 @@ void splitVertex(ReportManager &rm, NGHolder &g, const ExpressionInfo &expr,
255255
static
256256
void resolveEdges(ReportManager &rm, NGHolder &g, const ExpressionInfo &expr,
257257
set<NFAEdge> *dead) {
258-
for (const auto &e : edges_range(g)) {
258+
for (const auto e : edges_range(g)) {
259259
u32 flags = g[e].assert_flags;
260260
if (!flags) {
261261
continue;

0 commit comments

Comments
 (0)