Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wasm-watermarker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nagayama15
wasm-watermarker
Commits
f279ce02
Verified
Commit
f279ce02
authored
Jan 03, 2021
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
count import functions
parent
62b48497
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
wasm-stat.cpp
src/wasm-stat.cpp
+14
-4
No files found.
src/wasm-stat.cpp
View file @
f279ce02
...
@@ -48,17 +48,27 @@ int main(int argc, char* argv[]) {
...
@@ -48,17 +48,27 @@ int main(int argc, char* argv[]) {
wasm
::
Module
module
{};
wasm
::
Module
module
{};
wasm
::
ModuleReader
{}.
read
(
input
,
module
);
wasm
::
ModuleReader
{}.
read
(
input
,
module
);
std
::
size_t
num_imports
=
0
;
for
(
const
auto
&
f
:
module
.
functions
)
{
if
(
f
->
body
==
nullptr
)
{
num_imports
+=
1
;
}
}
if
(
!
quiet
)
{
if
(
!
quiet
)
{
fmt
::
print
(
fmt
::
print
(
"functions: {}
\n
"
"functions: {}
\n
"
"exports: {}
\n
"
,
"exports: {}
\n
"
"imports: {}
\n
"
,
module
.
functions
.
size
(),
module
.
functions
.
size
(),
module
.
exports
.
size
());
module
.
exports
.
size
(),
num_imports
);
}
else
{
}
else
{
fmt
::
print
(
fmt
::
print
(
"{}
\t
{}
\n
"
,
"{}
\t
{}
\
t
{}
\
n
"
,
module
.
functions
.
size
(),
module
.
functions
.
size
(),
module
.
exports
.
size
());
module
.
exports
.
size
(),
num_imports
);
}
}
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
fmt
::
print
(
std
::
cerr
,
"error: {}
\n
"
,
e
.
what
());
fmt
::
print
(
std
::
cerr
,
"error: {}
\n
"
,
e
.
what
());
...
...
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