clang 10.0.0git

Public Member Functions | Public Attributes | List of all members
clang::consumed::ConsumedAnalyzer Class Reference

A class that handles the analysis of uniqueness violations. More...

`#include "clang/Analysis/Analyses/Consumed.h"`

Collaboration diagram for clang::consumed::ConsumedAnalyzer:
[legend]

## Public Member Functions
| ConsumedAnalyzer (ConsumedWarningsHandlerBase &WarningsHandler)
ConsumedState | getExpectedReturnState () const
void | run (AnalysisDeclContext &AC)
| Check a function's CFG for consumed violations. More...

## Public Attributes
ConsumedWarningsHandlerBase & | WarningsHandler

## Detailed Description

A class that handles the analysis of uniqueness violations.

Definition at line 240 of file Consumed.h.

## Constructor & Destructor Documentation

## ◆ ConsumedAnalyzer()

clang::consumed::ConsumedAnalyzer::ConsumedAnalyzer | ( | ConsumedWarningsHandlerBase & | WarningsHandler | ) |
| inline

Definition at line 254 of file Consumed.h.

## Member Function Documentation

## ◆ getExpectedReturnState()

ConsumedState clang::consumed::ConsumedAnalyzer::getExpectedReturnState | ( |  | ) | const
| inline

Definition at line 257 of file Consumed.h.

References clang::transformer::run().

## ◆ run()

void ConsumedAnalyzer::run | ( | AnalysisDeclContext & | AC | ) |

Check a function's CFG for consumed violations.

We traverse the blocks in the CFG, keeping track of the state of each value who's type has uniquness annotations. If methods are invoked in the wrong state a warning is issued. Each block in the CFG is traversed exactly once.

Definition at line 1304 of file Consumed.cpp.

References clang::CFGElement::AutomaticObjectDtor, clang::CFGElement::castAs(), clang::consumed::ConsumedStmtVisitor::checkCallability(), clang::AnalysisDeclContext::getAnalysis(), clang::AnalysisDeclContext::getASTContext(), clang::CFGTemporaryDtor::getBindTemporaryExpr(), clang::FunctionDecl::getCallResultType(), clang::AnalysisDeclContext::getCFG(), clang::AnalysisDeclContext::getDecl(), clang::CFGImplicitDtor::getDestructorDecl(), clang::Stmt::getEndLoc(), clang::CFG::getExit(), clang::Decl::getLocation(), clang::CFG::getNumBlockIDs(), clang::CFGStmt::getStmt(), clang::CFGAutomaticObjDtor::getTriggerStmt(), clang::CFGAutomaticObjDtor::getVarDecl(), clang::Type::isVoidType(), clang::FunctionDecl::parameters(), clang::consumed::ConsumedStmtVisitor::reset(), clang::CFGElement::Statement, clang::CFGElement::TemporaryDtor, clang::StmtVisitorBase< Ptr, ImplClass, RetTy, ParamTys >::Visit(), and clang::consumed::ConsumedStmtVisitor::VisitParmVarDecl().

Referenced by clang::sema::AnalysisBasedWarnings::IssueWarnings().

## Member Data Documentation

## ◆ WarningsHandler

ConsumedWarningsHandlerBase& clang::consumed::ConsumedAnalyzer::WarningsHandler

Definition at line 252 of file Consumed.h.

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

- include/clang/Analysis/Analyses/Consumed.h
- lib/Analysis/Consumed.cpp