1
1
/*==-- clang-c/BuildSystem.h - Utilities for use by build systems -*- C -*-===*\
2
2
|* *|
3
- |* The LLVM Compiler Infrastructure *|
4
- |* *|
5
- |* This file is distributed under the University of Illinois Open Source *|
6
- |* License. See LICENSE.TXT for details. *|
3
+ |* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
4
+ |* Exceptions. *|
5
+ |* See https://llvm.org/LICENSE.txt for license information. *|
6
+ |* SPDX- License-Identifier: Apache-2.0 WITH LLVM-exception *|
7
7
|* *|
8
8
|*===----------------------------------------------------------------------===*|
9
9
|* *|
10
10
|* This header provides various utilities for use by build systems. *|
11
11
|* *|
12
12
\*===----------------------------------------------------------------------===*/
13
13
14
- #ifndef CLANG_C_BUILD_SYSTEM_H
15
- #define CLANG_C_BUILD_SYSTEM_H
14
+ #ifndef LLVM_CLANG_C_BUILDSYSTEM_H
15
+ #define LLVM_CLANG_C_BUILDSYSTEM_H
16
16
17
- #include "clang-c/Platform.h"
18
17
#include "clang-c/CXErrorCode.h"
19
18
#include "clang-c/CXString.h"
19
+ #include "clang-c/ExternC.h"
20
+ #include "clang-c/Platform.h"
20
21
21
- #ifdef __cplusplus
22
- extern "C" {
23
- #endif
22
+ LLVM_CLANG_C_EXTERN_C_BEGIN
24
23
25
24
/**
26
25
* \defgroup BUILD_SYSTEM Build system utilities
27
26
* @{
28
27
*/
29
28
30
29
/**
31
- * \brief Return the timestamp for use with Clang's
30
+ * Return the timestamp for use with Clang's
32
31
* \c -fbuild-session-timestamp= option.
33
32
*/
34
33
CINDEX_LINKAGE unsigned long long clang_getBuildSessionTimestamp (void );
35
34
36
35
/**
37
- * \brief Object encapsulating information about overlaying virtual
36
+ * Object encapsulating information about overlaying virtual
38
37
* file/directories over the real file system.
39
38
*/
40
39
typedef struct CXVirtualFileOverlayImpl * CXVirtualFileOverlay ;
41
40
42
41
/**
43
- * \brief Create a \c CXVirtualFileOverlay object.
42
+ * Create a \c CXVirtualFileOverlay object.
44
43
* Must be disposed with \c clang_VirtualFileOverlay_dispose().
45
44
*
46
45
* \param options is reserved, always pass 0.
@@ -49,7 +48,7 @@ CINDEX_LINKAGE CXVirtualFileOverlay
49
48
clang_VirtualFileOverlay_create (unsigned options );
50
49
51
50
/**
52
- * \brief Map an absolute virtual file path to an absolute real one.
51
+ * Map an absolute virtual file path to an absolute real one.
53
52
* The virtual path must be canonicalized (not contain "."/"..").
54
53
* \returns 0 for success, non-zero to indicate an error.
55
54
*/
@@ -59,21 +58,21 @@ clang_VirtualFileOverlay_addFileMapping(CXVirtualFileOverlay,
59
58
const char * realPath );
60
59
61
60
/**
62
- * \brief Set the case sensitivity for the \c CXVirtualFileOverlay object.
61
+ * Set the case sensitivity for the \c CXVirtualFileOverlay object.
63
62
* The \c CXVirtualFileOverlay object is case-sensitive by default, this
64
63
* option can be used to override the default.
65
64
* \returns 0 for success, non-zero to indicate an error.
66
65
*/
67
66
CINDEX_LINKAGE enum CXErrorCode
68
67
clang_VirtualFileOverlay_setCaseSensitivity (CXVirtualFileOverlay ,
69
- int caseSensitive );
68
+ int caseSensitive );
70
69
71
70
/**
72
- * \brief Write out the \c CXVirtualFileOverlay object to a char buffer.
71
+ * Write out the \c CXVirtualFileOverlay object to a char buffer.
73
72
*
74
73
* \param options is reserved, always pass 0.
75
74
* \param out_buffer_ptr pointer to receive the buffer pointer, which should be
76
- * disposed using \c free ().
75
+ * disposed using \c clang_free ().
77
76
* \param out_buffer_size pointer to receive the buffer size.
78
77
* \returns 0 for success, non-zero to indicate an error.
79
78
*/
@@ -83,17 +82,25 @@ clang_VirtualFileOverlay_writeToBuffer(CXVirtualFileOverlay, unsigned options,
83
82
unsigned * out_buffer_size );
84
83
85
84
/**
86
- * \brief Dispose a \c CXVirtualFileOverlay object.
85
+ * free memory allocated by libclang, such as the buffer returned by
86
+ * \c CXVirtualFileOverlay() or \c clang_ModuleMapDescriptor_writeToBuffer().
87
+ *
88
+ * \param buffer memory pointer to free.
89
+ */
90
+ CINDEX_LINKAGE void clang_free (void * buffer );
91
+
92
+ /**
93
+ * Dispose a \c CXVirtualFileOverlay object.
87
94
*/
88
95
CINDEX_LINKAGE void clang_VirtualFileOverlay_dispose (CXVirtualFileOverlay );
89
96
90
97
/**
91
- * \brief Object encapsulating information about a module.map file.
98
+ * Object encapsulating information about a module.map file.
92
99
*/
93
100
typedef struct CXModuleMapDescriptorImpl * CXModuleMapDescriptor ;
94
101
95
102
/**
96
- * \brief Create a \c CXModuleMapDescriptor object.
103
+ * Create a \c CXModuleMapDescriptor object.
97
104
* Must be disposed with \c clang_ModuleMapDescriptor_dispose().
98
105
*
99
106
* \param options is reserved, always pass 0.
@@ -102,27 +109,27 @@ CINDEX_LINKAGE CXModuleMapDescriptor
102
109
clang_ModuleMapDescriptor_create (unsigned options );
103
110
104
111
/**
105
- * \brief Sets the framework module name that the module.map describes.
112
+ * Sets the framework module name that the module.map describes.
106
113
* \returns 0 for success, non-zero to indicate an error.
107
114
*/
108
115
CINDEX_LINKAGE enum CXErrorCode
109
116
clang_ModuleMapDescriptor_setFrameworkModuleName (CXModuleMapDescriptor ,
110
117
const char * name );
111
118
112
119
/**
113
- * \brief Sets the umbrealla header name that the module.map describes.
120
+ * Sets the umbrealla header name that the module.map describes.
114
121
* \returns 0 for success, non-zero to indicate an error.
115
122
*/
116
123
CINDEX_LINKAGE enum CXErrorCode
117
124
clang_ModuleMapDescriptor_setUmbrellaHeader (CXModuleMapDescriptor ,
118
125
const char * name );
119
126
120
127
/**
121
- * \brief Write out the \c CXModuleMapDescriptor object to a char buffer.
128
+ * Write out the \c CXModuleMapDescriptor object to a char buffer.
122
129
*
123
130
* \param options is reserved, always pass 0.
124
131
* \param out_buffer_ptr pointer to receive the buffer pointer, which should be
125
- * disposed using \c free ().
132
+ * disposed using \c clang_free ().
126
133
* \param out_buffer_size pointer to receive the buffer size.
127
134
* \returns 0 for success, non-zero to indicate an error.
128
135
*/
@@ -132,17 +139,15 @@ clang_ModuleMapDescriptor_writeToBuffer(CXModuleMapDescriptor, unsigned options,
132
139
unsigned * out_buffer_size );
133
140
134
141
/**
135
- * \brief Dispose a \c CXModuleMapDescriptor object.
142
+ * Dispose a \c CXModuleMapDescriptor object.
136
143
*/
137
144
CINDEX_LINKAGE void clang_ModuleMapDescriptor_dispose (CXModuleMapDescriptor );
138
145
139
146
/**
140
147
* @}
141
148
*/
142
149
143
- #ifdef __cplusplus
144
- }
145
- #endif
150
+ LLVM_CLANG_C_EXTERN_C_END
146
151
147
152
#endif /* CLANG_C_BUILD_SYSTEM_H */
148
153
0 commit comments