Commit 5869c8c9 authored by Mario Rodas's avatar Mario Rodas

Add llvm-llc checker

parent ed08ce36
......@@ -16,6 +16,7 @@
- CSS/SCSS/LESS with ``stylelint`` [GH-903]
- Ruby with ``reek`` [GH-1244]
- Go with ``megacheck`` [GH-1290]
- LLVM IR with ``llc`` [GH-1302]
- New features:
......
......@@ -29,6 +29,7 @@
(depends-on "rjsx-mode")
(depends-on "json-mode")
(depends-on "less-css-mode")
(depends-on "llvm-mode")
(depends-on "lua-mode")
(depends-on "markdown-mode")
(depends-on "mmm-mode")
......
......@@ -680,6 +680,12 @@ to view the docstring of the syntax checker. Likewise, you may use
Whether to run stylelint in quiet mode via ``--quiet``.
.. supported-language:: LLVM
.. syntax-checker:: llvm-llc
Check syntax with `llc <http://llvm.org/docs/CommandGuide/llc.html>`_.
.. supported-language:: Lua
Flycheck checks Lua with `lua-luacheck`, falling back to `lua`.
......
......@@ -205,6 +205,7 @@ attention to case differences."
json-python-json
less
less-stylelint
llvm-llc
lua-luacheck
lua
perl
......@@ -8216,6 +8217,24 @@ See URL `http://stylelint.io/'."
:error-parser flycheck-parse-stylelint
:modes (less-css-mode))
(flycheck-define-checker llvm-llc
"Flycheck LLVM IR checker using llc.
See URL `http://llvm.org/docs/CommandGuide/llc.html'."
:command ("llc" "-o" null-device source)
:error-patterns
((error line-start
;; llc prints the executable path
(zero-or-one (minimal-match (one-or-more not-newline)) ": ")
(file-name) ":" line ":" column ": error: " (message)
line-end))
:error-filter
(lambda (errors)
;; sanitize errors occurring in inline assembly
(flycheck-sanitize-errors
(flycheck-remove-error-file-names "<inline asm>" errors)))
:modes llvm-mode)
(flycheck-def-config-file-var flycheck-luacheckrc lua-luacheck ".luacheckrc"
:safe #'stringp)
......
......@@ -3519,6 +3519,11 @@ Why not:
"language/less/syntax-error.less" 'less-css-mode
'(1 1 error "Unrecognised input" :checker less)))
(flycheck-ert-def-checker-test llvm-llc llvm nil
(flycheck-ert-should-syntax-check
"language/llvm.ll" 'llvm-mode
'(4 19 error "'%tmp' defined with type 'i32'" :checker llvm-llc)))
(flycheck-ert-def-checker-test lua-luacheck lua syntax-error
(flycheck-ert-should-syntax-check
"language/lua/syntax-error.lua" 'lua-mode
......
define i32 @mul_add(i32 %x, i32 %y, i32 %z) {
entry:
%tmp = mul i32 %x, %y
%tmp2 = add i64 %tmp, %z
ret i32 %tmp2
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment