[cfe-dev] Frontend class for handling common clang options and compiler flags

Trent Reed via cfe-dev cfe-dev at lists.llvm.org
Wed Mar 2 21:56:38 PST 2016

Hey All,

I'm trying to make a tool that needs to work an awful lot like the Clang
compiler itself. Things like -std=c++11 and -DMY_DEFINE=1 need to be able
to be parsed and handled. For cross-platform, I also need it to approximate
VS switches, which I believe Clang supports to some level (based on
documentation). Originally I was doing this all manually by constructing a
compiler instance, and configuring all the settings, but I thought it'd
make a whole lot of sense if there were already some boilerplate for this
some place.

At first I was cautious because from the code it didn't quite seem like
CommonOptionsParser and ClangTool were what I wanted, but I decided to try
it anyway. Unfortunately, after getting a sample application
up-and-running, the command-line did not handle such switches as I feared.

Is there any kind of helper class that handles all of these options? Or
should I just revert to a prior commit and attempt to continue from where I
left off?

- Trent Reed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160302/4f60cad5/attachment.html>

More information about the cfe-dev mailing list