summaryrefslogtreecommitdiffstats
path: root/clang/include/clang-c/Index.h
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-10-22 00:03:57 +0000
committerTed Kremenek <kremenek@apple.com>2009-10-22 00:03:57 +0000
commit649bf5c04b6010f8b1a4cf8fadab941cf0baf420 (patch)
treeddb720c1e3f77aff7da4d966578a5ad8abd6de46 /clang/include/clang-c/Index.h
parent27e0be274e6d6f320ce3f487f14b74903e17ba4e (diff)
downloadbcm5719-llvm-649bf5c04b6010f8b1a4cf8fadab941cf0baf420.tar.gz
bcm5719-llvm-649bf5c04b6010f8b1a4cf8fadab941cf0baf420.zip
Enhance 'clang_createTranslationUnitFromSourceFile()' in two ways:
(1) Allow the source file to be specified in the actual command line arguments by allowing the caller to set 'source_filename' to NULL. (2) Automatically strip off the arguments '-emit-ast', '-fsyntax-only', and '-c'. llvm-svn: 84802
Diffstat (limited to 'clang/include/clang-c/Index.h')
-rw-r--r--clang/include/clang-c/Index.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h
index 47cecd1c8cc..644b2e29412 100644
--- a/clang/include/clang-c/Index.h
+++ b/clang/include/clang-c/Index.h
@@ -159,12 +159,20 @@ void clang_disposeTranslationUnit(CXTranslationUnit);
* \brief Return the CXTranslationUnit for a given source file and the provided
* command line arguments one would pass to the compiler.
*
- * Note: If provided, this routine will strip the '-o <outputfile>' command
- * line arguments.
+ * Note: The 'source_filename' argument is optional. If the caller provides a NULL pointer,
+ * the name of the source file is expected to reside in the specified command line arguments.
+ *
+ * Note: When encountered in 'clang_command_line_args', the following options are ignored:
+ *
+ * '-c'
+ * '-emit-ast'
+ * '-fsyntax-only'
+ * '-o <output file>' (both '-o' and '<output file>' are ignored)
+ *
*/
CXTranslationUnit clang_createTranslationUnitFromSourceFile(
CXIndex CIdx,
- const char *source_filename,
+ const char *source_filename /* specify NULL if the source file is in clang_command_line_args */,
int num_clang_command_line_args,
const char **clang_command_line_args
);
OpenPOWER on IntegriCloud