@@ -275,76 +275,6 @@ class ControlDependencyCalculator : public ManagedAnalysis {
275
275
276
276
namespace llvm {
277
277
278
- // / Clang's CFG contains nullpointers for unreachable succesors, e.g. when an
279
- // / if statement's condition is always false, it's 'then' branch is represented
280
- // / with a nullptr. This however will result in a nullpointer derefernece for
281
- // / dominator tree calculation.
282
- // /
283
- // / To circumvent this, let's just crudely specialize the children getters
284
- // / used in LLVM's dominator tree builder.
285
- namespace DomTreeBuilder {
286
-
287
- using ClangCFGDomChildrenGetter =
288
- SemiNCAInfo<clang::CFGDomTree::DominatorTreeBase>::ChildrenGetter<
289
- /* Inverse=*/ false >;
290
-
291
- template <>
292
- template <>
293
- inline ClangCFGDomChildrenGetter::ResultTy ClangCFGDomChildrenGetter::Get (
294
- clang::CFGBlock *N, std::integral_constant<bool , /* Inverse=*/ false >) {
295
- auto RChildren = reverse (children<NodePtr>(N));
296
- ResultTy Ret (RChildren.begin (), RChildren.end ());
297
- Ret.erase (std::remove (Ret.begin (), Ret.end (), nullptr ), Ret.end ());
298
- return Ret;
299
- }
300
-
301
- using ClangCFGDomReverseChildrenGetter =
302
- SemiNCAInfo<clang::CFGDomTree::DominatorTreeBase>::ChildrenGetter<
303
- /* Inverse=*/ true >;
304
-
305
- template <>
306
- template <>
307
- inline ClangCFGDomReverseChildrenGetter::ResultTy
308
- ClangCFGDomReverseChildrenGetter::Get (
309
- clang::CFGBlock *N, std::integral_constant<bool , /* Inverse=*/ true >) {
310
- auto IChildren = inverse_children<NodePtr>(N);
311
- ResultTy Ret (IChildren.begin (), IChildren.end ());
312
- Ret.erase (std::remove (Ret.begin (), Ret.end (), nullptr ), Ret.end ());
313
- return Ret;
314
- }
315
-
316
- using ClangCFGPostDomChildrenGetter =
317
- SemiNCAInfo<clang::CFGPostDomTree::DominatorTreeBase>::ChildrenGetter<
318
- /* Inverse=*/ false >;
319
-
320
- template <>
321
- template <>
322
- inline ClangCFGPostDomChildrenGetter::ResultTy
323
- ClangCFGPostDomChildrenGetter::Get (
324
- clang::CFGBlock *N, std::integral_constant<bool , /* Inverse=*/ false >) {
325
- auto RChildren = reverse (children<NodePtr>(N));
326
- ResultTy Ret (RChildren.begin (), RChildren.end ());
327
- Ret.erase (std::remove (Ret.begin (), Ret.end (), nullptr ), Ret.end ());
328
- return Ret;
329
- }
330
-
331
- using ClangCFGPostDomReverseChildrenGetter =
332
- SemiNCAInfo<clang::CFGPostDomTree::DominatorTreeBase>::ChildrenGetter<
333
- /* Inverse=*/ true >;
334
-
335
- template <>
336
- template <>
337
- inline ClangCFGPostDomReverseChildrenGetter::ResultTy
338
- ClangCFGPostDomReverseChildrenGetter::Get (
339
- clang::CFGBlock *N, std::integral_constant<bool , /* Inverse=*/ true >) {
340
- auto IChildren = inverse_children<NodePtr>(N);
341
- ResultTy Ret (IChildren.begin (), IChildren.end ());
342
- Ret.erase (std::remove (Ret.begin (), Ret.end (), nullptr ), Ret.end ());
343
- return Ret;
344
- }
345
-
346
- } // end of namespace DomTreeBuilder
347
-
348
278
// ===-------------------------------------
349
279
// / DominatorTree GraphTraits specialization so the DominatorTree can be
350
280
// / iterable by generic graph iterators.
0 commit comments