|
clang
3.8.0
|
#include <Consumed.h>
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. More... | |
| void | clearTemporaries () |
| Clear the TmpMap. More... | |
| ConsumedState | getState (const VarDecl *Var) const |
| Get the consumed state of a given variable. More... | |
| ConsumedState | getState (const CXXBindTemporaryExpr *Tmp) const |
| Get the consumed state of a given temporary value. More... | |
| void | intersect (const ConsumedStateMap &Other) |
| Merge this state map with another map. More... | |
| void | intersectAtLoopHead (const CFGBlock *LoopHead, const CFGBlock *LoopBack, const ConsumedStateMap *LoopBackStates, ConsumedWarningsHandlerBase &WarningsHandler) |
| bool | isReachable () const |
| Return true if this block is reachable. More... | |
| void | markUnreachable () |
| Mark the block as unreachable. More... | |
| void | setSource (const Stmt *Source) |
| Set the source for a decision about the branching of states. More... | |
| void | setState (const VarDecl *Var, ConsumedState State) |
| Set the consumed state of a given variable. More... | |
| void | setState (const CXXBindTemporaryExpr *Tmp, ConsumedState State) |
| Set the consumed state of a given temporary value. More... | |
| void | remove (const CXXBindTemporaryExpr *Tmp) |
| Remove the temporary value from our state map. More... | |
| bool | operator!= (const ConsumedStateMap *Other) const |
| Tests to see if there is a mismatch in the states stored in two maps. More... | |
Protected Attributes | |
| bool | Reachable |
| const Stmt * | From |
| VarMapType | VarMap |
| TmpMapType | TmpMap |
Definition at line 131 of file Consumed.h.
|
inline |
Definition at line 145 of file Consumed.h.
|
inline |
Definition at line 146 of file Consumed.h.
| void clang::consumed::ConsumedStateMap::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.
Definition at line 1115 of file Consumed.cpp.
References clang::Decl::getAttr(), clang::NamedDecl::getNameAsString(), mapReturnTypestateAttrState(), stateToString(), and clang::consumed::ConsumedWarningsHandlerBase::warnParamReturnTypestateMismatch().
| void clang::consumed::ConsumedStateMap::clearTemporaries | ( | ) |
Clear the TmpMap.
Definition at line 1135 of file Consumed.cpp.
| ConsumedState clang::consumed::ConsumedStateMap::getState | ( | const VarDecl * | Var | ) | const |
Get the consumed state of a given variable.
Definition at line 1139 of file Consumed.cpp.
References clang::consumed::CS_None.
Referenced by clang::consumed::PropagationInfo::getAsState(), clang::consumed::splitVarStateForIf(), and clang::consumed::splitVarStateForIfBinOp().
| ConsumedState clang::consumed::ConsumedStateMap::getState | ( | const CXXBindTemporaryExpr * | Tmp | ) | const |
Get the consumed state of a given temporary value.
Definition at line 1149 of file Consumed.cpp.
References clang::consumed::CS_None.
| void clang::consumed::ConsumedStateMap::intersect | ( | const ConsumedStateMap & | Other | ) |
Merge this state map with another map.
Definition at line 1158 of file Consumed.cpp.
References clang::consumed::CS_None, clang::consumed::CS_Unknown, From, Reachable, and VarMap.
| void clang::consumed::ConsumedStateMap::intersectAtLoopHead | ( | const CFGBlock * | LoopHead, |
| const CFGBlock * | LoopBack, | ||
| const ConsumedStateMap * | LoopBackStates, | ||
| ConsumedWarningsHandlerBase & | WarningsHandler | ||
| ) |
Definition at line 1177 of file Consumed.cpp.
References clang::consumed::CS_None, clang::consumed::CS_Unknown, getLastStmtLoc(), VarMap, and clang::consumed::ConsumedWarningsHandlerBase::warnLoopStateMismatch().
|
inline |
Return true if this block is reachable.
Definition at line 172 of file Consumed.h.
References Reachable.
| void clang::consumed::ConsumedStateMap::markUnreachable | ( | ) |
Mark the block as unreachable.
Definition at line 1198 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.
| Other | – The second map to compare against. |
Definition at line 1217 of file Consumed.cpp.
References VarMap.
| void clang::consumed::ConsumedStateMap::remove | ( | const CXXBindTemporaryExpr * | Tmp | ) |
Remove the temporary value from our state map.
Definition at line 1213 of file Consumed.cpp.
|
inline |
Set the source for a decision about the branching of states.
| Source | – The statement that was the origin of a branching decision. |
Definition at line 180 of file Consumed.h.
References From.
| void clang::consumed::ConsumedStateMap::setState | ( | const VarDecl * | Var, |
| ConsumedState | State | ||
| ) |
Set the consumed state of a given variable.
Definition at line 1204 of file Consumed.cpp.
References State.
Referenced by clang::consumed::setStateForVarOrTmp(), clang::consumed::splitVarStateForIf(), and clang::consumed::splitVarStateForIfBinOp().
| void clang::consumed::ConsumedStateMap::setState | ( | const CXXBindTemporaryExpr * | Tmp, |
| ConsumedState | State | ||
| ) |
Set the consumed state of a given temporary value.
Definition at line 1208 of file Consumed.cpp.
References State.
|
protected |
Definition at line 140 of file Consumed.h.
Referenced by intersect(), and setSource().
|
protected |
Definition at line 139 of file Consumed.h.
Referenced by intersect(), and isReachable().
|
protected |
Definition at line 142 of file Consumed.h.
|
protected |
Definition at line 141 of file Consumed.h.
Referenced by intersect(), intersectAtLoopHead(), and operator!=().
1.8.6