[cfe-dev] Integrating "-distribute" into clang's Driver

Mike Miller michael.g.miller at gmail.com
Thu May 13 16:27:02 PDT 2010


Hi cfe-dev,

I've added an option to -cc1: -distribute. The option takes as input a
single source file, and produces object code, by distributing the
source to slaves. I'm now trying to make '-distribute' a
non-cc1-option as well, so that a user can use -distribute in their
CFLAGS to get projects to build in a distributed manner without much
hassle. I have several questions regarding this:

1. Since I'm skipping the assembler(I'm doing assembly on slaves), but
still going on to the linker, I'm confused about how to integrate the
-distribute option into the Action pipeline in Driver.cpp. What's the
best way to do this? I'd like to be able to smartly handle a user
typing "clang -distribute -E  myFile.c" by not invoking -distribute in
-cc1 if no object code is required.

2. Since I'm skipping the assembler, I need to know where to save the
object code to on disk. Is there an easy way to get clang to pass -cc1
the expected location of the object file, so that the linker will be
able to find the object file?

3. Is there any way (or does clang already) invoke multiple -cc1s in
parallel where possible? If not, would this be easy to add in? When
called with -distribute, clang will just connect via a UNIX socket to
another process, send over the source+args, and receive the diags, and
the object file will be written out to disk by the process at the
other end of the socket, so I'm not worried about thread safety at
all.

Thanks,
Mike



More information about the cfe-dev mailing list