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
ab159c68
Commit
ab159c68
authored
Jan 04, 2019
by
Hiren Patel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'code-cleanup' into 'master'
Code cleanup See merge request !12
parents
ac1d4b98
331b6176
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
28 deletions
+58
-28
scripts/paths.sh
scripts/paths.sh
+35
-4
src/EntryFunctionContainer.cpp
src/EntryFunctionContainer.cpp
+9
-10
src/FindEntryFunctions.cpp
src/FindEntryFunctions.cpp
+8
-8
src/ModuleDecl.cpp
src/ModuleDecl.cpp
+3
-3
src/enums.h
src/enums.h
+3
-3
No files found.
scripts/paths.sh
View file @
ab159c68
export
LLVM_SRC_DIR
=
/home/
$HOME
/workspace/code/systemc-clang/llvm
export
LLVM_BUILD_DIR
=
/home/
$HOME
/workspace/code/systemc-clang/build
export
CLANG_SRC_DIR
=
/home/
$HOME
/workspace/code/systemc-clang/llvm/tools/clang
export
CLANG_BUILD_DIR
=
/home/
$HOME
/workspace/code/systemc-clang/build/tools/clang
#!/bin/bash
##===================================================================
##
## It is important to use this script to set all the necessary paths.
##
# Path for where the binaries are for clang
# SET this.
export
LLVM_BUILD_DIR
=
/home/
$USER
/bin/clang-7.0.0/
# Path where SystemC is installed
# SET this.
export
SYSTEMC
=
/home/
$USER
/code/systemc-2.3.3/systemc/
# Path for the systemc-clang build directory
# SET this.
export
SYSTEMC_CLANG_BUILD_DIR
=
/home/
$USER
/code/systemc-clang-build/
##===================================================================
LLVMCOMPONENT
=
cppbackend
RTTIFLAG
=
-fno-rtti
LLVMCONFIG
=
$LLVM_BUILD_DIR
/bin/llvm-config
# New llvm/clang uses flags that are different than GNU gcc's
# Alternatively, you can use gcc and g++, but some flags don't work.
export
CC
=
clang
export
CXX
=
clang++
export
LLVM_CXX_FLAGS
=
"
`
$LLVMCONFIG
--cxxflags
`
-fno-aligned-allocation"
# Generate all the flags.
export
LLVM_CXX_FLAGS
=
"
$LLVM_CXX_FLAGS
-fvisibility-inlines-hidden"
export
LLVM_LIBS
=
`
$LLVMCONFIG
--libs
`
export
LLVM_LD_FLAGS
=
`
$LLVMCONFIG
--ldflags
`
export
LLVM_LD_FLAGS
=
`
echo
$LLVM_LD_FLAGS
|
sed
's/ *$//g'
`
src/EntryFunctionContainer.cpp
View file @
ab159c68
...
...
@@ -8,20 +8,19 @@ EntryFunctionContainer::~EntryFunctionContainer ()
// DO NOT free anything.
}
EntryFunctionContainer
::
EntryFunctionContainer
()
:
_entryName
(
"NONE"
),
_procType
(
NONE
),
_entryMethodDecl
(
NULL
)
{
EntryFunctionContainer
::
EntryFunctionContainer
()
:
_entryName
(
"NONE"
),
_procType
(
PROCESS_TYPE
::
NONE
),
_entryMethodDecl
(
nullptr
)
{
}
EntryFunctionContainer
::
EntryFunctionContainer
(
string
n
,
PROCESS_TYPE
p
,
CXXMethodDecl
*
d
,
Stmt
*
s
)
:
_entryName
(
n
),
_procType
(
p
),
_entryMethodDecl
(
d
)
{
:
_entryName
(
n
),
_procType
(
p
),
_entryMethodDecl
(
d
)
{
}
EntryFunctionContainer
::
EntryFunctionContainer
(
const
EntryFunctionContainer
&
from
)
{
EntryFunctionContainer
::
EntryFunctionContainer
(
const
EntryFunctionContainer
&
from
)
{
_entryName
=
from
.
_entryName
;
_procType
=
from
.
_procType
;
_entryMethodDecl
=
from
.
_entryMethodDecl
;
...
...
@@ -187,13 +186,13 @@ void EntryFunctionContainer::dump (raw_ostream & os, int tabn)
os
<<
"EntryFunctionContainer '"
<<
getName
()
<<
"' processType '"
;
switch
(
getProcessType
())
{
case
THREAD
:
case
PROCESS_TYPE
::
THREAD
:
os
<<
"SC_THREAD' "
;
break
;
case
METHOD
:
case
PROCESS_TYPE
::
METHOD
:
os
<<
"SC_METHOD' "
;
break
;
case
CTHREAD
:
case
PROCESS_TYPE
::
CTHREAD
:
os
<<
"SC_CTHREAD' "
;
break
;
default:
...
...
src/FindEntryFunctions.cpp
View file @
ab159c68
...
...
@@ -6,7 +6,7 @@ FindEntryFunctions::FindEntryFunctions( CXXRecordDecl * d, llvm::raw_ostream & o
os_
{
os
},
_d
{
d
},
is_entry_function_
{
false
},
proc_type_
{
NONE
},
proc_type_
{
PROCESS_TYPE
::
NONE
},
entry_cxx_record_decl_
{
nullptr
},
entry_method_decl_
{
nullptr
},
found_entry_decl_
{
false
},
...
...
@@ -51,13 +51,13 @@ bool FindEntryFunctions::VisitMemberExpr (MemberExpr * e) {
//os_ << "####: MemberExpr -- " << memberName << "\n";
if
(
memberName
==
"create_method_process"
)
{
proc_type_
=
METHOD
;
proc_type_
=
PROCESS_TYPE
::
METHOD
;
}
else
if
(
memberName
==
"create_thread_process"
)
{
proc_type_
=
THREAD
;
proc_type_
=
PROCESS_TYPE
::
THREAD
;
}
else
if
(
memberName
==
"create_cthread_process"
)
{
proc_type_
=
CTHREAD
;
proc_type_
=
PROCESS_TYPE
::
CTHREAD
;
}
break
;
}
...
...
@@ -84,7 +84,7 @@ bool FindEntryFunctions::VisitStringLiteral( StringLiteral * s ) {
ef
->
setName
(
entry_name_
);
ef
->
setProcessType
(
proc_type_
);
if
(
proc_type_
!=
0
)
{
if
(
proc_type_
!=
PROCESS_TYPE
::
NONE
)
{
entry_function_list_
.
push_back
(
ef
);
}
/* ef->constructor_stmt_ = constructor_stmt_;
...
...
@@ -163,13 +163,13 @@ void FindEntryFunctions::dump() {
os_
<<
"
\n
:> Entry function name: "
<<
ef
->
getName
()
<<
", process type: "
;
switch
(
ef
->
getProcessType
()
)
{
case
THREAD
:
case
PROCESS_TYPE
::
THREAD
:
os_
<<
" SC_THREAD
\n
"
;
break
;
case
METHOD
:
case
PROCESS_TYPE
::
METHOD
:
os_
<<
" SC_METHOD
\n
"
;
break
;
case
CTHREAD
:
case
PROCESS_TYPE
::
CTHREAD
:
os_
<<
" SC_CTHREAD
\n
"
;
break
;
default:
...
...
src/ModuleDecl.cpp
View file @
ab159c68
...
...
@@ -136,15 +136,15 @@ void ModuleDecl::addProcess( FindEntryFunctions::entryFunctionVectorType * efv )
// Set the process type
switch
(
ef
->
_procType
)
{
case
THREAD
:
{
case
PROCESS_TYPE
::
THREAD
:
{
entryType
=
"SC_THREAD"
;
break
;
}
case
METHOD
:
{
case
PROCESS_TYPE
::
METHOD
:
{
entryType
=
"SC_METHOD"
;
break
;
}
case
CTHREAD
:
{
case
PROCESS_TYPE
::
CTHREAD
:
{
entryType
=
"SC_CTHREAD"
;
break
;
}
...
...
src/enums.h
View file @
ab159c68
...
...
@@ -15,16 +15,16 @@
#define _ENUM_H_
namespace
scpar
{
enum
ASTSTATE
{
enum
class
ASTSTATE
{
EMPTY
,
DECLSTMT
,
MEMBEREXPR
,
CXXOPERATORCALLEXPR
,
CXXCONSTRUCTEXPR
};
// End enum ASTSTATE
enum
ReadWrite
{
enum
class
ReadWrite
{
RWINIT
,
READ
,
WRITE
};
// End enum ReadWrite
enum
PROCESS_TYPE
{
enum
class
PROCESS_TYPE
{
NONE
,
THREAD
,
CTHREAD
,
METHOD
};
// End enum PROCESS_TYPE
}
// End namespace scpar
...
...
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