[cfe-dev] RFC: Integrating clang-cc functionality into clang (the driver)

Török Edwin edwintorok at gmail.com
Fri Dec 4 08:50:41 PST 2009

On 2009-12-04 18:20, Daniel Dunbar wrote:
> Hello again,
> All the major pieces of the clang / clang-cc integration project are
> now in place, which means its time to put them to work! :)


So can I now invoke the driver directly (after forking, in case it
without the need for execve(), and have the ability to turn all the
clang-cc commandline flags on/off?
Is there a way now to get diagnostics directly, without the need to
redirect/parse the output?

Also will cl::ParseCommandLineOptions still work for LLVM commandline

I am currently using some rather low-level switches for clang-cc, so I
might as well ask now whether these are going away in the future or not:
-ffreestanding -nostdinc -disable-free -fdiagnostics-show-option
-fcolor-diagnostics -triple clambc-generic-generic -include bytecode.h
-Wall -warn-dead-stores  -warn-security-syntactic -analyzer-eagerly-assume
-v -g -E -S

Also I've been experimenting at some point with writing a simple editor
that uses clang for syntax highlighting/completion.
There were 2 issues:
 - creating the Preprocessor object involved setting lot of language
related stuff, like implicitint, accesscontrol, bool support, and so on.
Is there a way to just tell it to create with the language defaults that
the clang driver would use? (and eventually tell it about
-std=c99, and it automatically sets up whatever clang sets up for c99).

- This isn't necesarely related to your driver work, but I didn't see
any support for reusing previous parse results, like reparsing only the
portion of the
file/membuffer that changed. Can that somehow be accomplished with the
new driver infrastructure? (i.e. tell it that you've previously compiled
this file
with same driver, and now you only want to reparse/rebuild the AST for
the changed part).

Best regards,

More information about the cfe-dev mailing list