clang 22.0.0git
CFGStmtMap.h
Go to the documentation of this file.
1//===--- CFGStmtMap.h - Map from Stmt* to CFGBlock* -----------*- 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 defines the CFGStmtMap class, which defines a mapping from
10// Stmt* to CFGBlock*
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_ANALYSIS_CFGSTMTMAP_H
15#define LLVM_CLANG_ANALYSIS_CFGSTMTMAP_H
16
17#include "clang/Analysis/CFG.h"
18#include "llvm/ADT/DenseMap.h"
19
20namespace clang {
21
22class ParentMap;
23class Stmt;
24
26 const ParentMap *PM;
27 llvm::DenseMap<const Stmt *, const CFGBlock *> M;
28
29public:
30 CFGStmtMap(const CFG &C, const ParentMap &PM);
31
32 /// Returns the CFGBlock the specified Stmt* appears in. For Stmt* that
33 /// are terminators, the CFGBlock is the block they appear as a terminator,
34 /// and not the block they appear as a block-level expression (e.g, '&&').
35 /// CaseStmts and LabelStmts map to the CFGBlock they label.
36 const CFGBlock *getBlock(const Stmt *S) const;
37};
38
39} // end clang namespace
40#endif
Represents a single basic block in a source-level CFG.
Definition CFG.h:605
const CFGBlock * getBlock(const Stmt *S) const
Returns the CFGBlock the specified Stmt* appears in.
CFGStmtMap(const CFG &C, const ParentMap &PM)
Represents a source-level, intra-procedural CFG that represents the control-flow of a Stmt.
Definition CFG.h:1218
Stmt - This represents one statement.
Definition Stmt.h:85
The JSON file list parser is used to communicate input to InstallAPI.