clang 8.0.0

Public Member Functions | List of all members
clang::CodeGen::VarBypassDetector Class Reference

The class detects jumps which bypass local variables declaration: goto L; int a; L: More...

`#include "/work/www-prereleases/8.0.0/rc2/builddocs/llvm.src/tools/clang/lib/CodeGen/VarBypassDetector.h"`

## Public Member Functions
void | Init (const Stmt *Body)
| Clear the object and pre-process for the given statement, usually function body statement. More...
bool | IsBypassed (const VarDecl *D) const
| Returns true if the variable declaration was by bypassed by any goto or switch statement. More...

## Detailed Description

The class detects jumps which bypass local variables declaration: goto L; int a; L:

This is simplified version of JumpScopeChecker. Primary differences:

- Detects only jumps into the scope local variables.
- Does not detect jumps out of the scope of local variables.
- Not limited to variables with initializers, JumpScopeChecker is limited.

Definition at line 40 of file VarBypassDetector.h.

## Member Function Documentation

## ◆ Init()

void VarBypassDetector::Init | ( | const Stmt * | Body | ) |

Clear the object and pre-process for the given statement, usually function body statement.

Definition at line 21 of file VarBypassDetector.cpp.

References clang::VarDecl::getInit(), and clang::VarDecl::hasLocalStorage().

Referenced by clang::CodeGen::CodeGenFunction::GenerateCode().

## ◆ IsBypassed()

bool clang::CodeGen::VarBypassDetector::IsBypassed | ( | const VarDecl * | D | ) | const
| inline

Returns true if the variable declaration was by bypassed by any goto or switch statement.

Definition at line 58 of file VarBypassDetector.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca().

The documentation for this class was generated from the following files:

- lib/CodeGen/VarBypassDetector.h
- lib/CodeGen/VarBypassDetector.cpp