summaryrefslogtreecommitdiffstats
path: root/clang/include/clang-c/BuildSystem.h
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-02-25 03:59:23 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-02-25 03:59:23 +0000
commit0b9682efa42cbd2c3d4ee5cfd56b22f590aeaa8a (patch)
tree77866ecdcefdb675fc2e5559fbe799209b8c3ac6 /clang/include/clang-c/BuildSystem.h
parent09a439d3135d276a1b8b35bc50ff9603cb0f2755 (diff)
downloadbcm5719-llvm-0b9682efa42cbd2c3d4ee5cfd56b22f590aeaa8a.tar.gz
bcm5719-llvm-0b9682efa42cbd2c3d4ee5cfd56b22f590aeaa8a.zip
[libclang] Introduce libclang APIs for creating a buffer with a JSON virtual file overlay description.
The current API only supports adding 'virtual file path' -> 'real file path' mappings. rdar://15986708 llvm-svn: 202105
Diffstat (limited to 'clang/include/clang-c/BuildSystem.h')
-rw-r--r--clang/include/clang-c/BuildSystem.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/clang/include/clang-c/BuildSystem.h b/clang/include/clang-c/BuildSystem.h
index f8eff4257df..ab581fdcced 100644
--- a/clang/include/clang-c/BuildSystem.h
+++ b/clang/include/clang-c/BuildSystem.h
@@ -15,6 +15,7 @@
#define CLANG_C_BUILD_SYSTEM_H
#include "clang-c/Platform.h"
+#include "clang-c/CXErrorCode.h"
#include "clang-c/CXString.h"
#ifdef __cplusplus
@@ -33,6 +34,48 @@ extern "C" {
CINDEX_LINKAGE unsigned long long clang_getBuildSessionTimestamp(void);
/**
+ * \brief Object encapsulating information about overlaying virtual
+ * file/directories over the real file system.
+ */
+typedef struct CXVirtualFileOverlayImpl *CXVirtualFileOverlay;
+
+/**
+ * \brief Create a \c CXVirtualFileOverlay object.
+ * Must be disposed with \c clang_VirtualFileOverlay_dispose().
+ *
+ * \param options is reserved, always pass 0.
+ */
+CINDEX_LINKAGE CXVirtualFileOverlay
+clang_VirtualFileOverlay_create(unsigned options);
+
+/**
+ * \brief Map an absolute virtual file path to an absolute real one.
+ * The virtual path must be canonicalized (not contain "."/"..").
+ * \returns 0 for success, non-zero to indicate an error.
+ */
+CINDEX_LINKAGE enum CXErrorCode
+clang_VirtualFileOverlay_addFileMapping(CXVirtualFileOverlay,
+ const char *virtualPath,
+ const char *realPath);
+
+/**
+ * \brief Write out the \c CXVirtualFileOverlay object to a char buffer.
+ *
+ * \param options is reserved, always pass 0.
+ * \param out_buffer pointer to receive the CXString object, which should be
+ * disposed using \c clang_disposeString().
+ * \returns 0 for success, non-zero to indicate an error.
+ */
+CINDEX_LINKAGE enum CXErrorCode
+clang_VirtualFileOverlay_writeToBuffer(CXVirtualFileOverlay, unsigned options,
+ CXString *out_buffer);
+
+/**
+ * \brief Dispose a \c CXVirtualFileOverlay object.
+ */
+CINDEX_LINKAGE void clang_VirtualFileOverlay_dispose(CXVirtualFileOverlay);
+
+/**
* @}
*/
OpenPOWER on IntegriCloud