summaryrefslogtreecommitdiffstats
path: root/src/Options.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-01-10 18:24:56 (GMT)
committerBrad King <brad.king@kitware.com>2014-02-26 16:54:30 (GMT)
commitf2efefcde133208c355f235baf5dee4d4287e466 (patch)
treef75b6cb2a49fe587cdfc4c0871a23c2ceebb5c52 /src/Options.h
parent0c62ed33c937ccb101fcb6f30306626da1c312e5 (diff)
downloadCastXML-f2efefcde133208c355f235baf5dee4d4287e466.zip
CastXML-f2efefcde133208c355f235baf5dee4d4287e466.tar.gz
CastXML-f2efefcde133208c355f235baf5dee4d4287e466.tar.bz2
Add API to run Clang internally
Use the Clang Driver API to construct an invocation of Clang like the main "clang" compiler tool would for syntax-only or preprocess-only actions. Add two front-end actions, one for the '-E' preprocess-only option and one for our syntax-only AST traversal. Implement a syntax-only action that falls back to the Clang syntax-only action unless xml output is requested. Leave xml output unimplemented for now. Capture the '-o <output-file>' option ourselves since the Clang Driver API will ignore it when using a syntax-only action. Forward it to the compiler invocation frontend options just before constructing the frontend action implementation. When '--castxml-cc-<id>' is given tell the driver to suppress its own standard include path detection. Give the driver options to configure it to match the detected target triple and header search path. Tell it to suppress its builtin definitions. Hook in to the front-end action for each input source file to put the detected predefines into the preprocessor configuration.
Diffstat (limited to 'src/Options.h')
-rw-r--r--src/Options.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Options.h b/src/Options.h
index 84c1fa6..58ba3b5 100644
--- a/src/Options.h
+++ b/src/Options.h
@@ -22,9 +22,11 @@
struct Options
{
- Options(): GccXml(false), HaveCC(false) {}
+ Options(): PPOnly(false), GccXml(false), HaveCC(false) {}
+ bool PPOnly;
bool GccXml;
bool HaveCC;
+ std::string OutputFile;
std::vector<std::string> Includes;
std::string Predefines;
std::string Triple;