data: fixes for parsing and logging
* readded Storage logs * turned type name resolver error logs to info logs * fixed inheritance not parsed in forward declarations * check file node id before saving source location * show errors in unparsed files again
This commit is contained in:
@@ -73,19 +73,17 @@ bool ASTVisitor::VisitCXXRecordDecl(clang::CXXRecordDecl* declaration)
|
||||
);
|
||||
}
|
||||
|
||||
if (declaration->isClass() || declaration->isStruct())
|
||||
if ((declaration->isClass() || declaration->isStruct()) &&
|
||||
declaration->hasBody() && declaration->hasDefinition() && declaration->getNumBases())
|
||||
{
|
||||
if (declaration->hasDefinition() && declaration->getNumBases())
|
||||
for (const clang::CXXBaseSpecifier& it : declaration->bases())
|
||||
{
|
||||
for (const clang::CXXBaseSpecifier& it : declaration->bases())
|
||||
{
|
||||
m_client->onInheritanceParsed(
|
||||
getParseLocation(it.getSourceRange()),
|
||||
utility::getDeclNameHierarchy(declaration),
|
||||
utility::qualTypeToDataType(it.getType())->getTypeNameHierarchy(),
|
||||
convertAccessType(it.getAccessSpecifier())
|
||||
);
|
||||
}
|
||||
m_client->onInheritanceParsed(
|
||||
getParseLocation(it.getSourceRange()),
|
||||
utility::getDeclNameHierarchy(declaration),
|
||||
utility::qualTypeToDataType(it.getType())->getTypeNameHierarchy(),
|
||||
convertAccessType(it.getAccessSpecifier())
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,8 @@ void CxxDiagnosticConsumer::HandleDiagnostic(clang::DiagnosticsEngine::Level lev
|
||||
column = presumedLocation.getColumn();
|
||||
}
|
||||
|
||||
if (m_fileManager->hasFilePath(filePath))
|
||||
// if (m_fileManager->hasFilePath(filePath))
|
||||
if (m_fileManager)
|
||||
{
|
||||
m_client->onError(ParseLocation(filePath, line, column), message);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ NameHierarchy CxxDeclNameResolver::getDeclNameHierarchy()
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR("unhandled declaration type: " + std::string(m_declaration->getDeclKindName()));
|
||||
LOG_INFO("unhandled declaration type: " + std::string(m_declaration->getDeclKindName()));
|
||||
}
|
||||
|
||||
contextNameHierarchy = getContextNameHierarchy(m_declaration->getDeclContext());
|
||||
@@ -117,7 +117,7 @@ std::string CxxDeclNameResolver::getDeclName()
|
||||
{
|
||||
//this if fixes the crash, but not the problem TODO
|
||||
const clang::SourceManager& sourceManager = declaration->getASTContext().getSourceManager();
|
||||
LOG_ERROR("Template getParam out of Range "+declaration->getLocation().printToString(sourceManager));
|
||||
LOG_INFO("Template getParam out of Range "+declaration->getLocation().printToString(sourceManager));
|
||||
}
|
||||
currentParameterIndex++;
|
||||
}
|
||||
@@ -209,7 +209,7 @@ std::string CxxDeclNameResolver::getTemplateParameterString(const clang::NamedDe
|
||||
templateParameterTypeString = getTemplateParameterTypeString(clang::dyn_cast<clang::TemplateTemplateParmDecl>(parameter));
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("Unhandled kind of template parameter.");
|
||||
LOG_INFO("Unhandled kind of template parameter.");
|
||||
}
|
||||
|
||||
std::string parameterName = parameter->getName();
|
||||
|
||||
@@ -58,7 +58,7 @@ std::shared_ptr<DataType> CxxTemplateArgumentNameResolver::getTemplateArgumentTy
|
||||
return std::make_shared<NamedDataType>(typeNameHerarchy);
|
||||
}
|
||||
case clang::TemplateArgument::Pack:
|
||||
LOG_ERROR("Type of template argument not handled: Pack");
|
||||
LOG_INFO("Type of template argument not handled: Pack");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ std::shared_ptr<DataType> CxxTypeNameResolver::typeToDataType(const clang::Type*
|
||||
}
|
||||
default:
|
||||
{
|
||||
LOG_ERROR(std::string("Unhandled kind of type encountered: ") + type->getTypeClassName());
|
||||
LOG_INFO(std::string("Unhandled kind of type encountered: ") + type->getTypeClassName());
|
||||
clang::PrintingPolicy pp = clang::PrintingPolicy(clang::LangOptions());
|
||||
pp.SuppressTagKeyword = true; // value "true": for a class A it prints "A" instead of "class A"
|
||||
pp.Bool = true; // value "true": prints bool type as "bool" instead of "_Bool"
|
||||
|
||||
Reference in New Issue
Block a user