This is an small Language Server to work with LLVM IR in textual form - the .ll files produced by compiler frontends.
It's not designed for editing, just supporting basic parsing and navigation, assuming read only mode. Should be useful for compiler engineers targeting LLVM IR in text form.
- document symbols (metadata and functions)
- workspace symbols (functions)
- find references (functions from call instructions)
- go to definition (functions)
- hover
Homebrew:
brew install indoorvivants/tap/llvm-ir-lsp
Manual:
Download the binary for your platform from Github releases
Put this in your init.lua config:
vim.api.nvim_create_autocmd('FileType', {
pattern = 'llvm',
callback = function(args)
vim.lsp.start({
name = 'llvm_ir_lsp',
cmd = {'llvm-ir-lsp'}, -- change this path if you have a different installation location
root_dir = vim.fs.root(args.buf, { '.git' }) or vim.fn.getcwd(),
filetypes = { 'llvm' },
})
end,
})
-- associate .ll files with llvm language
vim.filetype.add({ extension = { ll = 'llvm' } })The recommended way is to install Langoustine VSCode extension and then configure in your user settings:
"langoustine-vscode.servers": [
{
"name": "LLVM IR LSP",
"extension": "ll",
"command": "llvm-ir-lsp",
}
],