Addons: Fixed handling of noname arguments
This commit is contained in:
parent
d46e4c1df6
commit
1767fe525b
|
@ -471,6 +471,7 @@ class Configuration:
|
||||||
self.functions = []
|
self.functions = []
|
||||||
self.variables = []
|
self.variables = []
|
||||||
self.valueflow = []
|
self.valueflow = []
|
||||||
|
arguments = []
|
||||||
|
|
||||||
for element in confignode:
|
for element in confignode:
|
||||||
if element.tag == 'directivelist':
|
if element.tag == 'directivelist':
|
||||||
|
@ -497,7 +498,11 @@ class Configuration:
|
||||||
self.functions.append(Function(function))
|
self.functions.append(Function(function))
|
||||||
if element.tag == 'variables':
|
if element.tag == 'variables':
|
||||||
for variable in element:
|
for variable in element:
|
||||||
self.variables.append(Variable(variable))
|
var = Variable(variable)
|
||||||
|
if var.nameToken:
|
||||||
|
self.variables.append(var)
|
||||||
|
else:
|
||||||
|
arguments.append(var)
|
||||||
if element.tag == 'valueflow':
|
if element.tag == 'valueflow':
|
||||||
for values in element:
|
for values in element:
|
||||||
self.valueflow.append(ValueFlow(values))
|
self.valueflow.append(ValueFlow(values))
|
||||||
|
@ -511,6 +516,8 @@ class Configuration:
|
||||||
IdMap[function.Id] = function
|
IdMap[function.Id] = function
|
||||||
for variable in self.variables:
|
for variable in self.variables:
|
||||||
IdMap[variable.Id] = variable
|
IdMap[variable.Id] = variable
|
||||||
|
for variable in arguments:
|
||||||
|
IdMap[variable.Id] = variable
|
||||||
for values in self.valueflow:
|
for values in self.valueflow:
|
||||||
IdMap[values.Id] = values.values
|
IdMap[values.Id] = values.values
|
||||||
|
|
||||||
|
@ -522,6 +529,8 @@ class Configuration:
|
||||||
function.setId(IdMap)
|
function.setId(IdMap)
|
||||||
for variable in self.variables:
|
for variable in self.variables:
|
||||||
variable.setId(IdMap)
|
variable.setId(IdMap)
|
||||||
|
for variable in arguments:
|
||||||
|
variable.setId(IdMap)
|
||||||
|
|
||||||
|
|
||||||
class Platform:
|
class Platform:
|
||||||
|
|
|
@ -2973,6 +2973,9 @@ void SymbolDatabase::printOut(const char *title) const
|
||||||
void SymbolDatabase::printXml(std::ostream &out) const
|
void SymbolDatabase::printXml(std::ostream &out) const
|
||||||
{
|
{
|
||||||
out << std::setiosflags(std::ios::boolalpha);
|
out << std::setiosflags(std::ios::boolalpha);
|
||||||
|
|
||||||
|
std::set<const Variable *> variables;
|
||||||
|
|
||||||
// Scopes..
|
// Scopes..
|
||||||
out << " <scopes>" << std::endl;
|
out << " <scopes>" << std::endl;
|
||||||
for (std::list<Scope>::const_iterator scope = scopeList.begin(); scope != scopeList.end(); ++scope) {
|
for (std::list<Scope>::const_iterator scope = scopeList.begin(); scope != scopeList.end(); ++scope) {
|
||||||
|
@ -3004,6 +3007,7 @@ void SymbolDatabase::printXml(std::ostream &out) const
|
||||||
for (unsigned int argnr = 0; argnr < function->argCount(); ++argnr) {
|
for (unsigned int argnr = 0; argnr < function->argCount(); ++argnr) {
|
||||||
const Variable *arg = function->getArgumentVar(argnr);
|
const Variable *arg = function->getArgumentVar(argnr);
|
||||||
out << " <arg nr=\"" << argnr+1 << "\" variable=\"" << arg << "\"/>" << std::endl;
|
out << " <arg nr=\"" << argnr+1 << "\" variable=\"" << arg << "\"/>" << std::endl;
|
||||||
|
variables.insert(arg);
|
||||||
}
|
}
|
||||||
out << " </function>" << std::endl;
|
out << " </function>" << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -3022,9 +3026,10 @@ void SymbolDatabase::printXml(std::ostream &out) const
|
||||||
out << " </scopes>" << std::endl;
|
out << " </scopes>" << std::endl;
|
||||||
|
|
||||||
// Variables..
|
// Variables..
|
||||||
|
for (const Variable *var : _variableList)
|
||||||
|
variables.insert(var);
|
||||||
out << " <variables>" << std::endl;
|
out << " <variables>" << std::endl;
|
||||||
for (unsigned int i = 1U; i < _variableList.size(); i++) {
|
for (const Variable *var : variables) {
|
||||||
const Variable *var = _variableList[i];
|
|
||||||
if (!var)
|
if (!var)
|
||||||
continue;
|
continue;
|
||||||
out << " <var id=\"" << var << '\"';
|
out << " <var id=\"" << var << '\"';
|
||||||
|
|
Loading…
Reference in New Issue