Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 24 additions & 16 deletions lib/symboldatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3808,6 +3808,28 @@ static std::string accessControlToString(AccessControl access)
return "Unknown";
}

static const char* functionTypeToString(Function::Type type)
{
switch (type) {
case Function::eConstructor:
return "Constructor";
case Function::eCopyConstructor:
return "CopyConstructor";
case Function::eMoveConstructor:
return "MoveConstructor";
case Function::eOperatorEqual:
return "OperatorEqual";
case Function::eDestructor:
return "Destructor";
case Function::eFunction:
return "Function";
case Function::eLambda:
return "Lambda";
default:
return "Unknown";
}
}

static std::string tokenToString(const Token* tok, const Tokenizer& tokenizer)
{
std::ostringstream oss;
Expand Down Expand Up @@ -3937,14 +3959,7 @@ void SymbolDatabase::printOut(const char *title) const
for (auto func = scope->functionList.cbegin(); func != scope->functionList.cend(); ++func) {
std::cout << " Function: " << &*func << std::endl;
std::cout << " name: " << tokenToString(func->tokenDef, mTokenizer) << std::endl;
std::cout << " type: " << (func->type == Function::eConstructor? "Constructor" :
func->type == Function::eCopyConstructor ? "CopyConstructor" :
func->type == Function::eMoveConstructor ? "MoveConstructor" :
func->type == Function::eOperatorEqual ? "OperatorEqual" :
func->type == Function::eDestructor ? "Destructor" :
func->type == Function::eFunction ? "Function" :
func->type == Function::eLambda ? "Lambda" :
"Unknown") << std::endl;
std::cout << " type: " << functionTypeToString(func->type) << std::endl;
std::cout << " access: " << accessControlToString(func->access) << std::endl;
std::cout << " hasBody: " << func->hasBody() << std::endl;
std::cout << " isInline: " << func->isInline() << std::endl;
Expand Down Expand Up @@ -4218,14 +4233,7 @@ void SymbolDatabase::printXml(std::ostream &out) const
outs += ErrorLogger::toxml(function->name());
outs += '\"';
outs += " type=\"";
outs += (function->type == Function::eConstructor? "Constructor" :
function->type == Function::eCopyConstructor ? "CopyConstructor" :
function->type == Function::eMoveConstructor ? "MoveConstructor" :
function->type == Function::eOperatorEqual ? "OperatorEqual" :
function->type == Function::eDestructor ? "Destructor" :
function->type == Function::eFunction ? "Function" :
function->type == Function::eLambda ? "Lambda" :
"Unknown");
outs += functionTypeToString(function->type);
outs += '\"';
if (function->nestedIn->definedType) {
if (function->hasVirtualSpecifier())
Expand Down