//===---- CFGMatchSwitch.h --------------------------------------*- C++ -*-===// // // 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 defines the `CFGMatchSwitch` abstraction for building a "switch" // statement for control flow graph elements. Each case of the switch is // defined by an ASTMatcher which is applied on the AST node contained in the // input `CFGElement`. // // Currently, the `CFGMatchSwitch` only handles `CFGElement`s of // `Kind::Statement` and `Kind::Initializer`. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_CFGMATCHSWITCH_H_ #define LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_CFGMATCHSWITCH_H_ #include "clang/AST/ASTContext.h" #include "clang/AST/Stmt.h" #include "clang/Analysis/CFG.h" #include "clang/Analysis/FlowSensitive/MatchSwitch.h" #include <functional> #include <utility> namespace clang { namespace dataflow { CFGMatchSwitch; /// Collects cases of a "match switch": a collection of matchers paired with /// callbacks, which together define a switch that can be applied to an AST node /// contained in a CFG element. template <typename State, typename Result = void> class CFGMatchSwitchBuilder { … }; } // namespace dataflow } // namespace clang #endif // LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_CFGMATCHSWITCH_H_