clang API Documentation

Public Member Functions | Protected Attributes
clang::consumed::ConsumedStateMap Class Reference

#include <Consumed.h>

Collaboration diagram for clang::consumed::ConsumedStateMap:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ConsumedStateMap ()
 ConsumedStateMap (const ConsumedStateMap &Other)
void checkParamsForReturnTypestate (SourceLocation BlameLoc, ConsumedWarningsHandlerBase &WarningsHandler) const
 Warn if any of the parameters being tracked are not in the state they were declared to be in upon return from a function.
void clearTemporaries ()
 Clear the TmpMap.
ConsumedState getState (const VarDecl *Var) const
 Get the consumed state of a given variable.
ConsumedState getState (const CXXBindTemporaryExpr *Tmp) const
 Get the consumed state of a given temporary value.
void intersect (const ConsumedStateMap *Other)
 Merge this state map with another map.
void intersectAtLoopHead (const CFGBlock *LoopHead, const CFGBlock *LoopBack, const ConsumedStateMap *LoopBackStates, ConsumedWarningsHandlerBase &WarningsHandler)
bool isReachable () const
 Return true if this block is reachable.
void markUnreachable ()
 Mark the block as unreachable.
void setSource (const Stmt *Source)
 Set the source for a decision about the branching of states.
void setState (const VarDecl *Var, ConsumedState State)
 Set the consumed state of a given variable.
void setState (const CXXBindTemporaryExpr *Tmp, ConsumedState State)
 Set the consumed state of a given temporary value.
void remove (const CXXBindTemporaryExpr *Tmp)
 Remove the temporary value from our state map.
bool operator!= (const ConsumedStateMap *Other) const
 Tests to see if there is a mismatch in the states stored in two maps.

Protected Attributes

bool Reachable
const StmtFrom
VarMapType VarMap
TmpMapType TmpMap

Detailed Description

Definition at line 131 of file Consumed.h.


Constructor & Destructor Documentation

Definition at line 145 of file Consumed.h.

Definition at line 146 of file Consumed.h.


Member Function Documentation

Warn if any of the parameters being tracked are not in the state they were declared to be in upon return from a function.

Definition at line 1127 of file Consumed.cpp.

References clang::Decl::getAttr(), clang::NamedDecl::getNameAsString(), mapReturnTypestateAttrState(), stateToString(), and clang::consumed::ConsumedWarningsHandlerBase::warnParamReturnTypestateMismatch().

Clear the TmpMap.

Definition at line 1147 of file Consumed.cpp.

Get the consumed state of a given variable.

Definition at line 1151 of file Consumed.cpp.

References clang::consumed::CS_None.

Referenced by clang::consumed::PropagationInfo::getAsState(), clang::consumed::splitVarStateForIf(), and clang::consumed::splitVarStateForIfBinOp().

Get the consumed state of a given temporary value.

Definition at line 1161 of file Consumed.cpp.

References clang::consumed::CS_None.

Merge this state map with another map.

Definition at line 1170 of file Consumed.cpp.

References clang::consumed::CS_None, clang::consumed::CS_Unknown, From, Reachable, and VarMap.

Referenced by clang::consumed::ConsumedBlockInfo::addInfo().

void clang::consumed::ConsumedStateMap::intersectAtLoopHead ( const CFGBlock LoopHead,
const CFGBlock LoopBack,
const ConsumedStateMap LoopBackStates,
ConsumedWarningsHandlerBase WarningsHandler 
)

Return true if this block is reachable.

Definition at line 172 of file Consumed.h.

References Reachable.

Mark the block as unreachable.

Definition at line 1210 of file Consumed.cpp.

Referenced by clang::consumed::splitVarStateForIf(), and clang::consumed::splitVarStateForIfBinOp().

bool clang::consumed::ConsumedStateMap::operator!= ( const ConsumedStateMap Other) const

Tests to see if there is a mismatch in the states stored in two maps.

Parameters:
Other-- The second map to compare against.

Definition at line 1229 of file Consumed.cpp.

References VarMap.

Remove the temporary value from our state map.

Definition at line 1225 of file Consumed.cpp.

void clang::consumed::ConsumedStateMap::setSource ( const Stmt Source) [inline]

Set the source for a decision about the branching of states.

Parameters:
Source-- The statement that was the origin of a branching decision.

Definition at line 180 of file Consumed.h.

References From.

Set the consumed state of a given variable.

Definition at line 1216 of file Consumed.cpp.

References State.

Referenced by clang::consumed::setStateForVarOrTmp(), clang::consumed::splitVarStateForIf(), and clang::consumed::splitVarStateForIfBinOp().

Set the consumed state of a given temporary value.

Definition at line 1220 of file Consumed.cpp.

References State.


Member Data Documentation

Definition at line 140 of file Consumed.h.

Referenced by intersect(), and setSource().

Definition at line 139 of file Consumed.h.

Referenced by intersect(), and isReachable().

Definition at line 142 of file Consumed.h.

Definition at line 141 of file Consumed.h.

Referenced by intersect(), intersectAtLoopHead(), and operator!=().


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