Skip to content
Snippets Groups Projects
Commit caf1213e authored by Peter Wägemann's avatar Peter Wägemann
Browse files

Add script adding noinline attribute to function annotated by entrypoint Pragma

parent ac59724b
No related branches found
No related tags found
No related merge requests found
Pipeline #
#!/usr/bin/env bash
if [ $# -ne 1 ]; then
echo "usage: $0 <tacle-bench-root-dir>" >&2
exit 1
fi
TACLE_ROOT=$1
for i in $(grep -r "entrypoint" `find $TACLE_ROOT -name "*.c"` | cut -d: -f1) ;
do
# ugly workaround: run clang-format prior to the annotiation
# to have { at the end of the line
temp=$(tempfile)
clang-format $i > $temp
mv $temp $i
exists=$(grep -c '__attribute__((noinline))' $i )
if [ $exists -eq 0 ]; then
echo "annotating $i"
# get the line number:
line=$(grep -n "entrypoint" $i |cut -d: -f1)
echo "found in line $line"
sed -i "${line}s/{/__attribute__((noinline)){/g" $i
fi
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment