10 ms·
It looks like this doesn't really understand the code... If I have a bunch of functions in different files all called "print", it won't be able to determine
by londons_explore 5y ago
It looks like this doesn't really understand the code... If I have a bunch of functions in different files all called "print", it won't be able to determine exactly which one is linked in and called at runtime.
Googles codesearch tool[1] actually compiles the code and uses the compilers parse tree to make the search index. The only time it doesn't work is if you are looking for code that has been "#ifdef 0"'d, when it falls back to regular string matching, and the difference is night and day.
Please github... please try to make a search index by compiling everyones files. Plenty of projects have CI buildbots which have all the info to automatically compile millions of projects, and at the same time generate the necessary parse trees. Even for interpreted languages like javascript/npm, python/pip, you can use heuristics to make a cross-module function call graph accurately most of the time.
[1]: Example URL from it: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_element.cc;drc=eb5094ebb2c2a4128d36d27806b286d288965746;bpv=1;bpt=1;l=1659?q=html_ele https://source.chromium.org/chromium/chromium/src/+/main:thi...
- dcreager 5y agoWe’ve been working on a framework called “stack graphs” that lets us extract exactly this kind of information without having to build anything. More details in my Strange Loop talk from October: https://dcreager.net/talks/2021-strange-loop/ https://dcreager.net/talks/2021-strange-loop/ Stay tuned for more!