summaryrefslogtreecommitdiff
path: root/ale_linters/llvm/llc.vim
diff options
context:
space:
mode:
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',
\})