[cfe-dev] final distributed clang patch

Peter Neumark peter.neumark at gmail.com
Mon Jul 7 09:13:23 PDT 2008


Hi!
Here is the final patch for clang to support network distributed
compilation. (clang.patch file)
There is also the server part attached. (the tar.gz file)

There 3 new files added to Driver directory:
PrintPreprocessedOutputBuffer.cpp what is a modification of
PrintPreprocessedOutput.cpp to support print text to a std::ostream.
Other new files: NetSession.h and NetSession.cpp which handles and contains
all networking code (portable thin networking code).
There are some files changed, mostly to support saving its output to a
std::stream. I've used that way to pass clang ASTConsumers data to an other
computer via network.

There are 3 new option added to clang. The basic one is -distribute what
enables distributed compilation. The other two are: -dist-preprocesslocally
and -dist-serializelocally.
If the first one enabled then clang sends a preprocessed file for
clangserver (a process in an other machine) to compile. In the second case
the lexing and parsing is done locally and the built and serialized AST is
sent to clangserver.

You can play with this using -dist-preprocesslocally because it is working.

P.S.
There is some features left to implement like getting and sending full
diagnostics (currently only diagID is sended by clangserver), and handling
remote file requests (when clangserver (compile server) requires an include
file)
But what is currently is implemented is stable and final, there probably
will not be big change in this code later.


What is your opinion of this ?

Cheers,
Peter Neumark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080707/2f1eea89/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang.patch
Type: application/octet-stream
Size: 63108 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080707/2f1eea89/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clangserver.tar.gz
Type: application/x-gzip
Size: 6623 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080707/2f1eea89/attachment.bin>


More information about the cfe-dev mailing list