Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
S
systemc-clang
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
caesr-pub
systemc-clang
Commits
279077f9
Commit
279077f9
authored
Dec 29, 2018
by
rmrf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up template parameters printing
parent
edc9e2a4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
33 deletions
+30
-33
src/FindTemplateTypes.h
src/FindTemplateTypes.h
+7
-11
src/InterfaceDecl.cpp
src/InterfaceDecl.cpp
+1
-1
src/PortDecl.cpp
src/PortDecl.cpp
+19
-18
src/PortDecl.h
src/PortDecl.h
+2
-2
src/Signal.cpp
src/Signal.cpp
+1
-1
No files found.
src/FindTemplateTypes.h
View file @
279077f9
...
...
@@ -96,23 +96,19 @@ namespace scpar {
return
template_types_
;
}
void
printTemplateArguments
(
llvm
::
raw_ostream
&
os
,
int
tabn
=
0
)
{
vector
<
string
>
template_arguments
;
//{ getTemplateArguments() };
// type_vector_t::iterator
// for (auto mit = template_types_.begin(); mit != template_types_.end(); mit++) {
void
printTemplateArguments
(
llvm
::
raw_ostream
&
os
)
{
vector
<
string
>
template_arguments
;
for
(
auto
const
&
mit
:
template_types_
)
{
for
(
auto
i
{
0
};
i
<
tabn
;
++
i
)
{
os
<<
" "
;
}
os
<<
"- "
<<
mit
.
first
<<
", type ptr: "
<<
mit
.
second
;
os
<<
"
\n
"
;
//os << "\n port type: " << mit.first << " ";
//<< ", type ptr: " << mit.second;
//os << "\n";
template_arguments
.
push_back
(
mit
.
first
);
}
// Print the template arguments to the output stream
os
<<
"
=
"
;
os
<<
"
, "
<<
template_arguments
.
size
()
<<
" arguments,
"
;
for
(
auto
const
&
targ
:
template_arguments
)
{
os
<<
targ
<<
"
"
;
os
<<
targ
<<
" "
;
}
}
...
...
src/InterfaceDecl.cpp
View file @
279077f9
...
...
@@ -53,5 +53,5 @@ void InterfaceDecl::dump(raw_ostream & os, int tabn)
}
os
<<
"InterfaceDecl "
<<
this
<<
" '"
<<
_name
<<
"' FindTemplateTypes "
<<
_templateType
;
_templateType
->
printTemplateArguments
(
os
,
1
);
_templateType
->
printTemplateArguments
(
os
);
}
src/PortDecl.cpp
View file @
279077f9
...
...
@@ -5,41 +5,42 @@ using namespace scpar;
using
namespace
std
;
PortDecl
::~
PortDecl
()
{
if
(
_templateType
!=
nullptr
)
{
delete
_templateType
;
if
(
template_type_
!=
nullptr
)
{
delete
template_type_
;
}
}
PortDecl
::
PortDecl
()
:
_name
{
"NONE"
},
_templateType
{
nullptr
}
{
PortDecl
::
PortDecl
()
:
port_name_
{
"NONE"
},
template_type_
{
nullptr
}
{
}
PortDecl
::
PortDecl
(
const
string
&
name
,
FindTemplateTypes
*
tt
)
:
_name
{
name
},
_templateType
{
tt
}
{
PortDecl
::
PortDecl
(
const
string
&
name
,
FindTemplateTypes
*
tt
)
:
port_name_
{
name
},
template_type_
{
tt
}
{
}
PortDecl
::
PortDecl
(
const
PortDecl
&
from
)
{
_name
=
from
.
_name
;
PortDecl
::
PortDecl
(
const
PortDecl
&
from
)
{
port_name_
=
from
.
port_name_
;
// This is necessary to allow FindPorts to go out of scope.
_templateType
=
new
FindTemplateTypes
(
*
from
.
_templateType
)
;
template_type_
=
new
FindTemplateTypes
{
*
from
.
template_type_
}
;
}
void
PortDecl
::
setModuleName
(
const
string
&
name
)
{
_name
=
name
;
void
PortDecl
::
setModuleName
(
const
string
&
name
)
{
port_name_
=
name
;
}
string
PortDecl
::
getName
()
const
{
return
_name
;
return
port_name_
;
}
FindTemplateTypes
*
PortDecl
::
getTemplateType
()
{
return
_templateType
;
return
template_type_
;
}
void
PortDecl
::
dump
(
raw_ostream
&
os
,
int
tabn
)
{
for
(
auto
i
=
0
;
i
<
tabn
;
++
i
)
{
os
<<
" "
;
}
os
<<
"PortDecl "
<<
this
<<
" '"
<<
_name
<<
"' FindTemplateTypes "
<<
_templateType
;
_templateType
->
printTemplateArguments
(
os
,
1
);
void
PortDecl
::
dump
(
llvm
::
raw_ostream
&
os
,
int
tabn
)
{
//os << "PortDecl " << this << " '" << port_name_ << "' FindTemplateTypes " << template_type_;
os
<<
"Port name: "
<<
port_name_
<<
" "
;
template_type_
->
printTemplateArguments
(
os
);
}
src/PortDecl.h
View file @
279077f9
...
...
@@ -30,8 +30,8 @@ namespace scpar {
void
dump
(
raw_ostream
&
,
int
tabn
=
0
);
private:
string
_name
;
FindTemplateTypes
*
_templateType
;
string
port_name_
;
FindTemplateTypes
*
template_type_
;
};
}
#endif
src/Signal.cpp
View file @
279077f9
...
...
@@ -66,5 +66,5 @@ void
}
os
<<
"Signal "
<<
this
<<
" '"
<<
_name
<<
"' FindTemplateTypes "
<<
_sig
->
getTemplateTypes
()
<<
"' FieldDecl' "
<<
_sig
->
getASTNode
();
_sig
->
getTemplateTypes
()
->
printTemplateArguments
(
os
,
tabn
);
_sig
->
getTemplateTypes
()
->
printTemplateArguments
(
os
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment