Commit d1888682 by rmrf

TemplateType object should not use pointers in containers

parent 6e5991b5
......@@ -43,7 +43,7 @@ bool FindPorts::VisitFieldDecl(FieldDecl *fd) {
if (args.size() == 0) {
return true;
}
string port_type{ (*ait)->getTypeName()};
string port_type{ ait->getTypeName()};
if (port_type == "sc_in") {
// os_ << "\n+ sc_in";
_inPorts.insert(kvType(fname, te));
......
......@@ -45,7 +45,7 @@ bool FindSensitivity::VisitMemberExpr(MemberExpr *e) {
return true;
/// Is it a port type
string port_type{ (*ait)->getTypeName() };
string port_type{ ait->getTypeName() };
if (!(port_type == "sc_in" || port_type == "sc_out" ||
port_type == "sc_inout")) {
return true;
......
......@@ -40,7 +40,7 @@ bool FindTLMInterfaces::VisitFieldDecl(FieldDecl *fd) {
}
// There could be more than one type though. Are you only referring to the first one?
string template_type_name { (*ait)->getTypeName() };
string template_type_name { ait->getTypeName() };
if ( template_type_name == "sc_fifo_in") {
_inInterfaces.insert(kvType(fname, te));
}
......
......@@ -20,7 +20,10 @@ namespace scpar {
class TemplateType {
public:
TemplateType( string, const Type* );
string getTypeName();
~TemplateType( );
TemplateType( const TemplateType& );
string getTypeName() const;
const Type* getTypePtr();
private:
......@@ -32,7 +35,7 @@ namespace scpar {
class FindTemplateTypes : public RecursiveASTVisitor<FindTemplateTypes> {
public:
/// Typedefs
typedef TemplateType* TemplateTypePtr;
typedef TemplateType TemplateTypePtr;
//typedef vector< TemplateTypePtr > type_vector_t_new;
//typedef vector<pair<string, const Type *>> type_vector_t;
typedef vector< TemplateTypePtr > type_vector_t;
......@@ -45,6 +48,8 @@ namespace scpar {
/// Copy constructor
FindTemplateTypes(const FindTemplateTypes &rhs);
FindTemplateTypes(const FindTemplateTypes *rhs);
~FindTemplateTypes();
string getTemplateType();
bool VisitType(Type *type);
bool VisitIntegerLiteral(IntegerLiteral *l);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment