cce
cce copied to clipboard
Proposal: Add local option from compile commands
Hi @ethanhs,
for myself, implemented in Python, I wrote a little script to open a C++ source file on a locally running instance of Compiler Explorer. The benefit is that you can use Compiler Explorer on a real source file of a real project. All flags will be passed to CE, so the resulting assembly is the same as in the project.
I would like to know whether you would like to see this as part of cce. Would you accept a patch to that effect?
How does it work?
Prerequisite:
- A local instance of compiler explorer is running. (Clone CE and run
make
). - A
compile_commands.json
file exists in one of the parent directories of the target file. - The target file can be in any language supported by CE and compile_commands.
Usage:
- Given some source file of interest (
myfile.cc
), callcce myfile.cc
. - The default browser is opened with a new tab, with myfile loaded in Compiler Explorer. The compile flags will be set correctly. This means you can open files that are part of a much bigger project and see the assembly output.
If this sounds like something you would like to see in CCE, please let me know and I'll prepare a new version in Rust.
I think this could be handy. I've been meaning to set up my own CE instance, but haven't gotten around to it, so sure, I think I'd accept this!