Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#!/bin/bash
set -e
#~/src/kninja/kninja.py
ninja -t compdb $(awk '/^rule /{print $2}' build.ninja) > compile_commands.json
#compdb -c compdb.complementers=headerdb -p . update
#compdb -c compdb.complementers=headerdb -p . list > compile_commands.json.new
#cp compile_commands.json.new compile_commands.json
DELETE_ARGS=(
'-falign-jumps=1'
'-falign-loops=1'
'-fconserve-stack'
'-fno-delete-null-pointer-checks'
'-fno-var-tracking-assignments'
'-mfentry'
'-mno-fp-ret-in-387'
'-mpreferred-stack-boundary=3'
'-mskip-rax-setup'
'--param=allow-store-data-races=0'
'-DCC_HAVE_ASM_GOTO'
'-Wno-frame-address'
'-Wno-unused-but-set-variable'
'-Werror=designated-init'
)
script=""
for x in ${DELETE_ARGS[@]};do
script="s/$x//;${script}"
done
sed -i -e "${script}" compile_commands.json
#eval $(grep -- '-o fs/btrfs/ctree.o' compile_commands.json | cut -d: -f2|
# sed 's/",$//;s/^ "gcc/clang -fsyntax-only/;s/-c -o fs\/btrfs\/ctree.o//;s/\\\\"/"/g')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment