astyle formatting
This commit is contained in:
parent
7e02789d3f
commit
92d65a1824
|
@ -11,7 +11,7 @@
|
|||
struct ForwardTraversal {
|
||||
enum class Progress { Continue, Break, Skip };
|
||||
ForwardTraversal(const ValuePtr<ForwardAnalyzer>& analyzer, const Settings* settings)
|
||||
: analyzer(analyzer), settings(settings), actions(ForwardAnalyzer::Action::None), analyzeOnly(false)
|
||||
: analyzer(analyzer), settings(settings), actions(ForwardAnalyzer::Action::None), analyzeOnly(false)
|
||||
{}
|
||||
ValuePtr<ForwardAnalyzer> analyzer;
|
||||
const Settings* settings;
|
||||
|
@ -435,7 +435,7 @@ struct ForwardTraversal {
|
|||
return Progress::Break;
|
||||
} else if (thenAction.isModified() || elseAction.isModified()) {
|
||||
if (!hasElse && analyzer->isConditional() && stopUpdates())
|
||||
return Progress::Break;
|
||||
return Progress::Break;
|
||||
if (!analyzer->lowerToPossible())
|
||||
return Progress::Break;
|
||||
analyzer->assume(condTok, elseAction.isModified());
|
||||
|
@ -566,9 +566,9 @@ struct ForwardTraversal {
|
|||
};
|
||||
|
||||
ForwardAnalyzer::Action valueFlowGenericForward(Token* start,
|
||||
const Token* end,
|
||||
const ValuePtr<ForwardAnalyzer>& fa,
|
||||
const Settings* settings)
|
||||
const Token* end,
|
||||
const ValuePtr<ForwardAnalyzer>& fa,
|
||||
const Settings* settings)
|
||||
{
|
||||
ForwardTraversal ft{fa, settings};
|
||||
ft.updateRange(start, end);
|
||||
|
|
|
@ -114,8 +114,8 @@ struct ForwardAnalyzer {
|
|||
};
|
||||
|
||||
ForwardAnalyzer::Action valueFlowGenericForward(Token* start,
|
||||
const Token* end,
|
||||
const ValuePtr<ForwardAnalyzer>& fa,
|
||||
const Settings* settings);
|
||||
const Token* end,
|
||||
const ValuePtr<ForwardAnalyzer>& fa,
|
||||
const Settings* settings);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1711,11 +1711,11 @@ static void valueFlowGlobalStaticVar(TokenList *tokenList, const Settings *setti
|
|||
}
|
||||
|
||||
static ForwardAnalyzer::Action valueFlowForwardVariable(Token* const startToken,
|
||||
const Token* const endToken,
|
||||
const Variable* const var,
|
||||
std::list<ValueFlow::Value> values,
|
||||
TokenList* const tokenlist,
|
||||
const Settings* const settings);
|
||||
const Token* const endToken,
|
||||
const Variable* const var,
|
||||
std::list<ValueFlow::Value> values,
|
||||
TokenList* const tokenlist,
|
||||
const Settings* const settings);
|
||||
|
||||
// Old deprecated version
|
||||
static void valueFlowForward(Token* startToken,
|
||||
|
@ -2698,12 +2698,12 @@ static std::vector<const Variable*> getAliasesFromValues(std::list<ValueFlow::Va
|
|||
}
|
||||
|
||||
static ForwardAnalyzer::Action valueFlowForwardVariable(Token* const startToken,
|
||||
const Token* const endToken,
|
||||
const Variable* const var,
|
||||
std::list<ValueFlow::Value> values,
|
||||
std::vector<const Variable*> aliases,
|
||||
TokenList* const tokenlist,
|
||||
const Settings* const settings)
|
||||
const Token* const endToken,
|
||||
const Variable* const var,
|
||||
std::list<ValueFlow::Value> values,
|
||||
std::vector<const Variable*> aliases,
|
||||
TokenList* const tokenlist,
|
||||
const Settings* const settings)
|
||||
{
|
||||
ForwardAnalyzer::Action actions;
|
||||
for (ValueFlow::Value& v : values) {
|
||||
|
@ -2714,14 +2714,14 @@ static ForwardAnalyzer::Action valueFlowForwardVariable(Token* const startToken,
|
|||
}
|
||||
|
||||
static ForwardAnalyzer::Action valueFlowForwardVariable(Token* const startToken,
|
||||
const Token* const endToken,
|
||||
const Variable* const var,
|
||||
std::list<ValueFlow::Value> values,
|
||||
TokenList* const tokenlist,
|
||||
const Settings* const settings)
|
||||
const Token* const endToken,
|
||||
const Variable* const var,
|
||||
std::list<ValueFlow::Value> values,
|
||||
TokenList* const tokenlist,
|
||||
const Settings* const settings)
|
||||
{
|
||||
return valueFlowForwardVariable(
|
||||
startToken, endToken, var, std::move(values), getAliasesFromValues(values), tokenlist, settings);
|
||||
startToken, endToken, var, std::move(values), getAliasesFromValues(values), tokenlist, settings);
|
||||
}
|
||||
|
||||
// Old deprecated version
|
||||
|
@ -2809,11 +2809,11 @@ struct ExpressionForwardAnalyzer : SingleValueFlowForwardAnalyzer {
|
|||
};
|
||||
|
||||
static ForwardAnalyzer::Action valueFlowForwardExpression(Token* startToken,
|
||||
const Token* endToken,
|
||||
const Token* exprTok,
|
||||
const std::list<ValueFlow::Value>& values,
|
||||
const TokenList* const tokenlist,
|
||||
const Settings* settings)
|
||||
const Token* endToken,
|
||||
const Token* exprTok,
|
||||
const std::list<ValueFlow::Value>& values,
|
||||
const TokenList* const tokenlist,
|
||||
const Settings* settings)
|
||||
{
|
||||
ForwardAnalyzer::Action actions;
|
||||
for (const ValueFlow::Value& v : values) {
|
||||
|
@ -2885,11 +2885,11 @@ static const Token* solveExprValues(const Token* expr, std::list<ValueFlow::Valu
|
|||
}
|
||||
|
||||
static ForwardAnalyzer::Action valueFlowForward(Token* startToken,
|
||||
const Token* endToken,
|
||||
const Token* exprTok,
|
||||
std::list<ValueFlow::Value> values,
|
||||
TokenList* const tokenlist,
|
||||
const Settings* settings)
|
||||
const Token* endToken,
|
||||
const Token* exprTok,
|
||||
std::list<ValueFlow::Value> values,
|
||||
TokenList* const tokenlist,
|
||||
const Settings* settings)
|
||||
{
|
||||
const Token* expr = solveExprValues(exprTok, values);
|
||||
if (expr->variable()) {
|
||||
|
@ -4550,9 +4550,9 @@ static void valueFlowAfterCondition(TokenList *tokenlist,
|
|||
{
|
||||
ValueFlowConditionHandler handler;
|
||||
handler.forward =
|
||||
[&](Token* start, const Token* stop, const Token* vartok, const std::list<ValueFlow::Value>& values, bool) {
|
||||
return valueFlowForward(start->next(), stop, vartok, values, tokenlist, settings).isModified();
|
||||
};
|
||||
[&](Token* start, const Token* stop, const Token* vartok, const std::list<ValueFlow::Value>& values, bool) {
|
||||
return valueFlowForward(start->next(), stop, vartok, values, tokenlist, settings).isModified();
|
||||
};
|
||||
handler.parse = [&](const Token *tok) {
|
||||
ValueFlowConditionHandler::Condition cond;
|
||||
ValueFlow::Value true_value;
|
||||
|
@ -5883,18 +5883,18 @@ struct ContainerVariableForwardAnalyzer : VariableForwardAnalyzer {
|
|||
};
|
||||
|
||||
static ForwardAnalyzer::Action valueFlowContainerForward(Token* tok,
|
||||
const Token* endToken,
|
||||
const Variable* var,
|
||||
ValueFlow::Value value,
|
||||
TokenList* tokenlist)
|
||||
const Token* endToken,
|
||||
const Variable* var,
|
||||
ValueFlow::Value value,
|
||||
TokenList* tokenlist)
|
||||
{
|
||||
ContainerVariableForwardAnalyzer a(var, value, getAliasesFromValues({value}), tokenlist);
|
||||
return valueFlowGenericForward(tok, endToken, a, tokenlist->getSettings());
|
||||
}
|
||||
static ForwardAnalyzer::Action valueFlowContainerForward(Token* tok,
|
||||
const Variable* var,
|
||||
ValueFlow::Value value,
|
||||
TokenList* tokenlist)
|
||||
const Variable* var,
|
||||
ValueFlow::Value value,
|
||||
TokenList* tokenlist)
|
||||
{
|
||||
const Token * endOfVarScope = nullptr;
|
||||
if (var->isLocal() || var->isArgument())
|
||||
|
@ -6051,9 +6051,9 @@ static void valueFlowIteratorAfterCondition(TokenList *tokenlist,
|
|||
{
|
||||
ValueFlowConditionHandler handler;
|
||||
handler.forward =
|
||||
[&](Token* start, const Token* stop, const Token* vartok, const std::list<ValueFlow::Value>& values, bool) {
|
||||
return valueFlowForward(start->next(), stop, vartok, values, tokenlist, settings).isModified();
|
||||
};
|
||||
[&](Token* start, const Token* stop, const Token* vartok, const std::list<ValueFlow::Value>& values, bool) {
|
||||
return valueFlowForward(start->next(), stop, vartok, values, tokenlist, settings).isModified();
|
||||
};
|
||||
handler.parse = [&](const Token *tok) {
|
||||
ValueFlowConditionHandler::Condition cond;
|
||||
|
||||
|
|
Loading…
Reference in New Issue