announcing an *early preview* of a cross-referencing code search website for LLVM

Hi,

I’ve found that one of the most useful tools in the Chromium project is its code search website, http://cs.chromium.org/

At http://llvm-cs.pcc.me.uk/ you will find something similar for llvm. You can search the full text of the llvm/clang/lld/lldb repositories using regular expressions, search for declarations (which are prioritized above full-text results), and follow cross references between definitions and references.

The code behind this website is based on kythe [1] (Kythe itself uses the clang libraries to parse C++ code) and Russ Cox’s codesearch [2] library. I’m planning to open source it and contribute it to the kythe project.

Thanks,

Hi,
I like Kythe and this approach, but you may want to check DXR [0] that
is similar (with a little nicer interface). Browse Firefox's code with
DXR to feel what it's like [1].
The approach is basically building the project while building all the
information+references. It's adding plugins for more languages too
(other than C/C++).

[0] https://github.com/mozilla/dxr
[1] / - mozsearch

Thanks. I was aware of DXR, but I didn’t know that they were using Clang. Kythe uses a similar approach, but there’s no need to actually build the whole project, you just need a compilation database [1]. In LLVM’s case, I need to arrange to build all the tablegen’d files upfront, and I have a hacky script that does so by parsing the “ninja -t commands” output.

Peter

[1] http://clang.llvm.org/docs/JSONCompilationDatabase.html

Nice! Glad to see some work progressing on a UI :slight_smile:

–Shahms