Skip to content

rurumimic/llvm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLVM


FreeBSD 13

Start FreeBSD:

vagrant up
vagrant ssh

Built-in LLVM/Clang

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

Packages

sudo pkg update -f
sudo pkg install git cmake ninja cscope

llvm/llvm-project.git

cd $HOME
git clone https://github.com/llvm/llvm-project.git

Setup

$HOME/.profile

cat <<EOF | tee -a $HOME/.profile > /dev/null

alias ll='ls -alGFh'
alias vi='vim'

export CSCOPE_DB="$HOME/llvm-project/cscope.out"

EOF

plugin.vim

cat /usr/local/share/vim/vim90/plugin/cscope_relative.vim

set cscope_relative

Cscope

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

Finding

  • 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)

Source Code


Ref

vimrc

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Languages