mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
c45f4d5e73
(the following is the original commit message) Preparation includes: - ensuring there are no loops. - ensuring there are no edges spanning more than a single layer. - ensuring there are no backwards facing edges that were not split into a bunch of parts to simplify laying them out. - ensuring there are no self loops (they are treated similarly to backwards facing edges, which they theoretically are). Subproducts include: - `Classifier` allowing to cheaply determine whether a given node is adjacent to an artificial edge. - `Ranks` container allowing to easily determine the layer each of the nodes belongs to.
26 lines
826 B
C++
26 lines
826 B
C++
#pragma once
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
#include "InternalGraph.h"
|
|
|
|
/// Ranks the nodes using specified ranking strategy.
|
|
template<RankingStrategy Strategy>
|
|
RankContainer rankNodes(InternalGraph &Graph);
|
|
|
|
/// Ranks the nodes using specified ranking strategy.
|
|
template<RankingStrategy Strategy>
|
|
RankContainer rankNodes(InternalGraph &Graph, int64_t DiamondBound);
|
|
|
|
/// Updates node ranking after the graph was modified.
|
|
///
|
|
/// Garanties ranking consistency i.e. that each node has
|
|
/// a rank greater than its predecessors.
|
|
///
|
|
/// Be careful, rank order is NOT preserved.
|
|
/// \note: There used to be an additional parameter for that, but it was never
|
|
/// actually implemented, so I removed it.
|
|
RankContainer &updateRanks(InternalGraph &Graph, RankContainer &Ranks);
|