//===--- VarBypassDetector.cpp - Bypass jumps detector ------------*- 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 // //===----------------------------------------------------------------------===// #include "VarBypassDetector.h" #include "clang/AST/Decl.h" #include "clang/AST/Expr.h" #include "clang/AST/Stmt.h" usingnamespaceclang; usingnamespaceCodeGen; /// Clear the object and pre-process for the given statement, usually function /// body statement. void VarBypassDetector::Init(const Stmt *Body) { … } /// Build scope information for a declaration that is part of a DeclStmt. /// Returns false if we failed to build scope information and can't tell for /// which vars are being bypassed. bool VarBypassDetector::BuildScopeInformation(const Decl *D, unsigned &ParentScope) { … } /// Walk through the statements, adding any labels or gotos to /// LabelAndGotoScopes and recursively walking the AST as needed. /// Returns false if we failed to build scope information and can't tell for /// which vars are being bypassed. bool VarBypassDetector::BuildScopeInformation(const Stmt *S, unsigned &origParentScope) { … } /// Checks each jump and stores each variable declaration they bypass. void VarBypassDetector::Detect() { … } /// Checks the jump and stores each variable declaration it bypasses. void VarBypassDetector::Detect(unsigned From, unsigned To) { … }