//===- PrintSCC.cpp - Enumerate SCCs in some key graphs -------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file provides passes to print out SCCs in a CFG or a CallGraph.
// Normally, you would not use these passes; instead, you would use the
// scc_iterator directly to enumerate SCCs and process them in some way. These
// passes serve three purposes:
//
// (1) As a reference for how to use the scc_iterator.
// (2) To print out the SCCs for a CFG or a CallGraph:
// analyze -print-cfg-sccs to print the SCCs in each CFG of a module.
// analyze -print-cfg-sccs -stats to print the #SCCs and the maximum SCC size.
// analyze -print-cfg-sccs -debug > /dev/null to watch the algorithm in action.
//
// and similarly:
// analyze -print-callgraph-sccs [-stats] [-debug] to print SCCs in the CallGraph
//
// (3) To test the scc_iterator.
//
//===----------------------------------------------------------------------===//
using namespace llvm;
char CFGSCC::ID = 0;
static RegisterPass<CFGSCC>
;
char CallGraphSCC::ID = 0;
static RegisterPass<CallGraphSCC>
;
bool
// run - Print out SCCs in the call graph for the specified module.
bool