Skip to content

Instantly share code, notes, and snippets.

@naota
Last active May 30, 2017 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naota/98134e02fc15a2c5be250f9d1efcf1d1 to your computer and use it in GitHub Desktop.
Save naota/98134e02fc15a2c5be250f9d1efcf1d1 to your computer and use it in GitHub Desktop.
#!/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