data: basic template parsing
* Implemented basic parsing and storage of template parameter types, template classes and template functions * Added template specialization edge. * Implemented handling of partial specializations. Needs some more tweaking. * Added a lot of test code for template stuff (still needs some cases to be tested) * Removed the isTemplateParameterType from DataType, since it shouldn't be needed * Function qualTypeToDataType uses clang PrintingPolicy to fetch the desired format. * Merged a lot of code for getting the correct names and name hierarchies of definitions * Removed TokenComponentDataType * Merged both of the Storage::addTypeEdge(...) functions * Added "-fno-delayed-template-parsing" flag to parser for parsing test code.
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
|
||||
#include "data/graph/Node.h"
|
||||
#include "data/graph/token_component/TokenComponentAccess.h"
|
||||
#include "data/graph/token_component/TokenComponentDataType.h"
|
||||
#include "utility/logging/logging.h"
|
||||
|
||||
Edge::Edge(EdgeType type, Node* from, Node* to)
|
||||
@@ -93,24 +92,6 @@ void Edge::addComponentAccess(std::shared_ptr<TokenComponentAccess> component)
|
||||
}
|
||||
}
|
||||
|
||||
void Edge::addComponentDataType(std::shared_ptr<TokenComponentDataType> component)
|
||||
{
|
||||
if (getComponent<TokenComponentDataType>())
|
||||
{
|
||||
LOG_ERROR("TokenComponentDataType has been set before!");
|
||||
}
|
||||
else if (m_type != EDGE_TYPEDEF_OF && m_type != EDGE_TYPE_OF &&
|
||||
m_type != EDGE_RETURN_TYPE_OF && m_type != EDGE_PARAMETER_TYPE_OF &&
|
||||
m_type != EDGE_TYPE_USAGE)
|
||||
{
|
||||
LOG_ERROR("TokenComponentDataType can't be set on edge of type: " + getTypeString());
|
||||
}
|
||||
else
|
||||
{
|
||||
addComponent(component);
|
||||
}
|
||||
}
|
||||
|
||||
std::string Edge::getTypeString(EdgeType type) const
|
||||
{
|
||||
switch (type)
|
||||
@@ -133,6 +114,10 @@ std::string Edge::getTypeString(EdgeType type) const
|
||||
return "usage";
|
||||
case EDGE_TYPEDEF_OF:
|
||||
return "typedef";
|
||||
case EDGE_TEMPLATE_PARAMETER_OF:
|
||||
return "template parameter";
|
||||
case EDGE_TEMPLATE_SPECIALIZATION_OF:
|
||||
return "template specialization";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user