All Projects → sourcegraph → lsif-clang

sourcegraph / lsif-clang

Licence: other
Language Server Indexing Format (LSIF) generator for C, C++ and Objective C

Programming Languages

C++
36643 projects - #6 most used programming language
LLVM
166 projects
c
50402 projects - #5 most used programming language
assembly
5116 projects
python
139335 projects - #7 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to lsif-clang

lldbg
A lightweight native GUI for LLDB.
Stars: ✭ 83 (+196.43%)
Mutual labels:  llvm, clang
opencilk-project
Monorepo for the OpenCilk compiler, forked from llvm/llvm-project. See the OpenCilk/infrastructure repository for build and installation instructions.
Stars: ✭ 42 (+50%)
Mutual labels:  llvm, clang
Chromium Clang
Chromium browser compiled with the Clang/LLVM compiler.
Stars: ✭ 77 (+175%)
Mutual labels:  llvm, clang
FPChecker
A dynamic analysis tool to detect floating-point errors in HPC applications.
Stars: ✭ 26 (-7.14%)
Mutual labels:  llvm, clang
lsif-py
Language Server Indexing Format (LSIF) generator for Python
Stars: ✭ 31 (+10.71%)
Mutual labels:  lsif, lsif-indexer
adorad
Fast, Expressive, & High-Performance Programming Language for those who dare
Stars: ✭ 54 (+92.86%)
Mutual labels:  llvm, clang
proton-clang-build
A set of scripts to build optimized LLVM and binutils toolchains. See https://github.com/kdrag0n/proton-clang for prebuilts.
Stars: ✭ 30 (+7.14%)
Mutual labels:  llvm, clang
MetaCG
MetaCG offers an annotated whole program call-graph tool for Clang/LLVM.
Stars: ✭ 21 (-25%)
Mutual labels:  llvm, clang
open-ops
Open Optimizing Parallelizing System
Stars: ✭ 21 (-25%)
Mutual labels:  llvm, clang
systemc-compiler
This tool translates synthesizable SystemC code to synthesizable SystemVerilog.
Stars: ✭ 128 (+357.14%)
Mutual labels:  llvm, clang
sycl
SYCL for Vitis: Experimental fusion of triSYCL with Intel SYCL oneAPI DPC++ up-streaming effort into Clang/LLVM
Stars: ✭ 80 (+185.71%)
Mutual labels:  llvm, clang
CastXMLSuperbuild
Build CastXML and its dependencies (LLVM/Clang)
Stars: ✭ 32 (+14.29%)
Mutual labels:  llvm, clang
flextool
C++ compile-time programming (serialization, reflection, code modification, enum to string, better enum, enum to json, extend or parse language, etc.)
Stars: ✭ 32 (+14.29%)
Mutual labels:  llvm, clang
los
Los是一个c/c++语言编译型的虚拟机。它使用llvm/clang作为其前端,losld做后端对源代码进行编译,生成los指令文件。Los is a c/c++-compiled virtual machine. It uses llvm/clang as its front end, losld does the backend to compile the source code, and generates the los directive file.
Stars: ✭ 46 (+64.29%)
Mutual labels:  llvm, clang
dumb-obfuscator
Tutorial on how to write the dumbest obfuscator I could think of.
Stars: ✭ 147 (+425%)
Mutual labels:  llvm, clang
CMLFS
Clang-Built Musl Linux From Scratch
Stars: ✭ 51 (+82.14%)
Mutual labels:  llvm, clang
EmbedSanitizer
EmbedSantizer is a runtime race detection tool which extends ThreadSanitizer to detect data races in 32-bit ARM applications.
Stars: ✭ 16 (-42.86%)
Mutual labels:  llvm, clang
lsif-node
Language Server Indexing Format (LSIF) generator for JavaScript and TypeScript
Stars: ✭ 37 (+32.14%)
Mutual labels:  lsif, lsif-indexer
OS-CFI
Origin-sensitive Control Flow Integrity (OS-CFI) - USENIX Security 2019
Stars: ✭ 27 (-3.57%)
Mutual labels:  llvm, clang
CFI-LB
Adaptive Callsite-sensitive Control Flow Integrity - EuroS&P'19
Stars: ✭ 13 (-53.57%)
Mutual labels:  llvm, clang

lsif-clang indexer Status: Development

GIF displaying usage on the linux kernel.

This project is a fork of clangd with patches to add support for outputting LSIF indexes. Specifically, a fork of the llvm-project repo with a new tool lsif-clang under the clang-tools-extra subdirectory and patches to files under clang-tools-extra/clangd. There's more info about the repo structure and its history in the Forking Strategy doc.

This project has only been tested extensively on C++ projects and C projects, but Objective C projects should both be supported as well following the same instructions. See the compatibility page for more detailed information about which kinds of projects are supported.

Alternatives for C++ Projects

If you can't get lsif-clang working with your project, first file an issue! We want this to work everywhere. But the C++ ecosystem is fragmented, and it's possible that your project simply won't play nice with the clang toolchain. lsif-cpp is also available, which acts as a plugin for arbitrary C++ compilers and might therefore be compatible. Unfortunately, it has several major defects compared to lsif-clang (it is much slower and does not provide hovers), and is not the recommended option.

Usage

Follow the installation instructions to get the tool set up, then the compilation database instructions to generate a compilation database. Then run

lsif-clang compile_commands.json

If you get missing header warnings (common on MacOS), you can try

lsif-clang --extra-arg="-resource-dir=$(clang -print-resource-dir)" compile_commands.json

If you are still missing headers, there's likely an error in the way the compilation database was set up, or some generated code that's necessary for C++ compilation hasn't been output yet.

See the examples of producing LSIF indexes for a variety of OSS repositories to help troubleshoot.

Testing the output

You can use the lsif-validate tool for basic sanity checking, or upload the index to a Sourcegraph instance to see the hovers, definitions, and references in action.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].