Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Dr. Michael Petter
LLVM-abstractinterpretation
Commits
cb45b8ed
Commit
cb45b8ed
authored
Nov 19, 2021
by
Administrator
Browse files
added a few more helpers
parent
c883ba2d
Changes
3
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
cb45b8ed
...
...
@@ -353,6 +353,8 @@ foreach(src ${CPPSAMPLES})
OUTPUT
${
CMAKE_SOURCE_DIR
}
/output/
${
src
}
.ll
COMMAND
${
PATH_TO_LLVM
}
/bin/clang++ -O0 -emit-llvm
${
CMAKE_SOURCE_DIR
}
/samples/
${
src
}
.cpp -Xclang -disable-O0-optnone -c -o
${
CMAKE_SOURCE_DIR
}
/output/
${
src
}
.bc
COMMAND
${
PATH_TO_LLVM
}
/bin/opt -S -mem2reg
${
CMAKE_SOURCE_DIR
}
/output/
${
src
}
.bc -o
${
CMAKE_SOURCE_DIR
}
/output/
${
src
}
.ll
COMMAND optdir=
${
PATH_TO_LLVM
}
/bin
${
CMAKE_SOURCE_DIR
}
/helpers/flowgraph.sh
${
CMAKE_SOURCE_DIR
}
/output/
${
src
}
.ll main
COMMAND optdir=
${
PATH_TO_LLVM
}
/bin
${
CMAKE_SOURCE_DIR
}
/helpers/callgraph.sh
${
CMAKE_SOURCE_DIR
}
/output/
${
src
}
.ll
DEPENDS clang opt
${
CMAKE_SOURCE_DIR
}
/samples/
${
src
}
.cpp
COMMENT
"Generating LLVM IR for example
${
src
}
.cpp"
)
...
...
helpers/callgraph.sh
0 → 100755
View file @
cb45b8ed
#!/bin/bash
if
[[
-z
$optdir
]]
then
echo
setting opt to default
optdir
=
$(
dirname
$(
which opt
))
fi
$optdir
/opt
-enable-new-pm
=
0
-dot-callgraph
-S
"
$1
"
-disable-output
cat
"
$1
"
.callgraph.dot | c++filt |
sed
's,>,\\>,g; s,-\\>,->,g; s,<,\\<,g'
| dot
-Tsvg
>
"
$1
.staticcallgraph.svg"
#dot -Tsvg output/classes.ll.callgraph.dot > classes.svg
\ No newline at end of file
helpers/flowgraph.sh
0 → 100755
View file @
cb45b8ed
#!/bin/bash
if
[[
-z
$optdir
]]
then
echo
setting opt to default
optdir
=
$(
dirname
$(
which opt
))
fi
$optdir
/opt
--dot-cfg
-cfg-func-name
=
"
$2
"
"
$1
"
-disable-output
cat
".
$2
"
.dot | c++filt | dot
-Tsvg
>
"
$1
.
$2
.svg"
rm
".
$2
"
.dot
\ No newline at end of file
Write
Preview
Supports
Markdown
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