X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/0ee596c5c5e11fc79598407eaf22f83d279f7e9e..5a4872f466ebd76ddd532bdf2798554421c53df4:/.vim/bundle/ale/ale_linters/llvm/llc.vim?ds=sidebyside diff --git a/.vim/bundle/ale/ale_linters/llvm/llc.vim b/.vim/bundle/ale/ale_linters/llvm/llc.vim new file mode 100644 index 00000000..594be063 --- /dev/null +++ b/.vim/bundle/ale/ale_linters/llvm/llc.vim @@ -0,0 +1,24 @@ +" Author: rhysd +" Description: Support for checking LLVM IR with llc + +call ale#Set('llvm_llc_executable', 'llc') + +function! ale_linters#llvm#llc#HandleErrors(buffer, lines) abort + " Handle '{path}: {file}:{line}:{col}: error: {message}' format + let l:pattern = '\v^[a-zA-Z]?:?[^:]+: [^:]+:(\d+):(\d+): (.+)$' + + return map(ale#util#GetMatches(a:lines, l:pattern), "{ + \ 'lnum': str2nr(v:val[1]), + \ 'col': str2nr(v:val[2]), + \ 'text': v:val[3], + \ 'type': 'E', + \}") +endfunction + +call ale#linter#Define('llvm', { +\ 'name': 'llc', +\ 'executable': {b -> ale#Var(b, 'llvm_llc_executable')}, +\ 'output_stream': 'stderr', +\ 'command': {-> '%e -filetype=null -o=' . g:ale#util#nul_file}, +\ 'callback': 'ale_linters#llvm#llc#HandleErrors', +\})