summaryrefslogtreecommitdiff
path: root/ale_linters/llvm/llc.vim
diff options
context:
space:
mode:
authorBjorn Neergaard <bjorn@neersighted.com>2018-11-29 14:57:35 -0700
committerBjorn Neergaard <bjorn@neersighted.com>2018-11-29 14:57:35 -0700
commitd2b0ae8108b2ee395d4eb43c49d68b322a023a30 (patch)
treebb8145e69bf1bcb8968b29cb1a68c47ceb83674d /ale_linters/llvm/llc.vim
parentef641dda80f45cb979bc93c2513c6e10cbd8e42a (diff)
parent0a384a49d371838903d8401c5358ec60f3f4266d (diff)
downloadale-d2b0ae8108b2ee395d4eb43c49d68b322a023a30.zip
Merge branch 'master' into sridhars
Diffstat (limited to 'ale_linters/llvm/llc.vim')
-rw-r--r--ale_linters/llvm/llc.vim16
1 files changed, 3 insertions, 13 deletions
diff --git a/ale_linters/llvm/llc.vim b/ale_linters/llvm/llc.vim
index 15201cbe..044f8c44 100644
--- a/ale_linters/llvm/llc.vim
+++ b/ale_linters/llvm/llc.vim
@@ -3,21 +3,11 @@
call ale#Set('llvm_llc_executable', 'llc')
-function! ale_linters#llvm#llc#GetExecutable(buffer) abort
- return ale#Var(a:buffer, 'llvm_llc_executable')
-endfunction
-
-function! ale_linters#llvm#llc#GetCommand(buffer) abort
- return ale#Escape(ale_linters#llvm#llc#GetExecutable(a:buffer))
- \ . ' -filetype=null -o=' . g:ale#util#nul_file
-endfunction
-
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+): (.+)$'
- let l:matches = ale#util#GetMatches(a:lines, l:pattern)
- return map(l:matches, "{
+ return map(ale#util#GetMatches(a:lines, l:pattern), "{
\ 'lnum': str2nr(v:val[1]),
\ 'col': str2nr(v:val[2]),
\ 'text': v:val[3],
@@ -27,8 +17,8 @@ endfunction
call ale#linter#Define('llvm', {
\ 'name': 'llc',
-\ 'executable_callback': 'ale_linters#llvm#llc#GetExecutable',
+\ 'executable_callback': ale#VarFunc('llvm_llc_executable'),
\ 'output_stream': 'stderr',
-\ 'command_callback': 'ale_linters#llvm#llc#GetCommand',
+\ 'command_callback': {-> '%e -filetype=null -o=' . g:ale#util#nul_file},
\ 'callback': 'ale_linters#llvm#llc#HandleErrors',
\})