clang 20.0.0git
PostOrderCFGView.h
Go to the documentation of this file.
1//===- PostOrderCFGView.h - Post order view of CFG blocks -------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements post order view of the blocks in a CFG.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_POSTORDERCFGVIEW_H
14#define LLVM_CLANG_ANALYSIS_ANALYSES_POSTORDERCFGVIEW_H
15
17#include "clang/Analysis/CFG.h"
18#include "clang/Basic/LLVM.h"
19#include "llvm/ADT/BitVector.h"
20#include "llvm/ADT/DenseMap.h"
21#include "llvm/ADT/PostOrderIterator.h"
22#include <utility>
23#include <vector>
24
25namespace clang {
26
28 virtual void anchor();
29
30public:
31 /// Implements a set of CFGBlocks using a BitVector.
32 ///
33 /// This class contains a minimal interface, primarily dictated by the SetType
34 /// template parameter of the llvm::po_iterator template, as used with
35 /// external storage. We also use this set to keep track of which CFGBlocks we
36 /// visit during the analysis.
38 llvm::BitVector VisitedBlockIDs;
39
40 public:
41 // po_iterator requires this iterator, but the only interface needed is the
42 // value_type type.
43 struct iterator { using value_type = const CFGBlock *; };
44
45 CFGBlockSet() = default;