Start FreeBSD:
vagrant up
vagrant ssh
clang --version
FreeBSD clang version 13.0.0 ([email protected]:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a303)
Target: x86_64-unknown-freebsd13.1
Thread model: posix
InstalledDir: /usr/bin
sudo pkg update -f
sudo pkg install git cmake ninja cscope
cd $HOME
git clone https://github.com/llvm/llvm-project.git
cat <<EOF | tee -a $HOME/.profile > /dev/null
alias ll='ls -alGFh'
alias vi='vim'
export CSCOPE_DB="$HOME/llvm-project/cscope.out"
EOF
cat /usr/local/share/vim/vim90/plugin/cscope_relative.vim
set cscope_relative
- tutorial: Vim/Cscope
- cscope_maps.vim
cd llvm-project
cscope -b -q -R
- b: just build the database without GUI
- q: create a inverted index file
- R: parse all subdirectories
output:
cscope.in.out
cscope.out
cscope.po.out
- Find
:cs find s <keyword>
: find this symbol:cs find 0 <keyword>
:cs f s <C-R><C-W>
: find the word under cursor<C + \>
+s
: find the word under cursor
- Jump
:[count]tn[ext][!]
: Jump to count next matching tag (default 1):[count]tp[revious][!]
: Jump to count preivious matching tag (default 1)
- src/helloworld
- src/sum: opt, llc, llvm-mc, lli, llvm-link, llvm-as, llvm-dis
- src/frontend
- vimrc by amix