llvm.org GIT mirror llvm / 10e9fb1
lto: Clean up C libLTO interfaces pertaining to linker flags. Specifically, remove the dependent library interface and replace the existing linker option interface with a new one that returns a single list of flags. Differential Revision: http://reviews.llvm.org/D10820 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241018 91177308-0d34-0410-b5e6-96231b3b80d8 Peter Collingbourne 4 years ago
3 changed file(s) with 10 addition(s) and 61 deletion(s). Raw diff Collapse all Expand all
3939 * @{
4040 */
4141
42 #define LTO_API_VERSION 15
42 #define LTO_API_VERSION 16
4343
4444 /**
4545 * \since prior to LTO_API_VERSION=3
279279
280280
281281 /**
282 * Returns the number of dependent libraries in the object module.
283 *
284 * Deprecated. Now returns an empty list.
285 *
286 * \since LTO_API_VERSION=8
287 */
288 extern unsigned int
289 lto_module_get_num_deplibs(lto_module_t mod);
290
291
292 /**
293 * Returns the ith dependent library in the module.
294 *
295 * Deprecated. Now always returns null.
296 *
297 * \since LTO_API_VERSION=8
282 * Returns the module's linker options.
283 *
284 * The linker options may consist of multiple flags. It is the linker's
285 * responsibility to split the flags using a platform-specific mechanism.
286 *
287 * \since LTO_API_VERSION=16
298288 */
299289 extern const char*
300 lto_module_get_deplib(lto_module_t mod, unsigned int index);
301
302
303 /**
304 * Returns the number of linker options in the object module.
305 *
306 * Each linker option may consist of multiple flags. It is the linker's
307 * responsibility to split the flags using a platform-specific mechanism.
308 *
309 * \since LTO_API_VERSION=8
310 */
311 extern unsigned int
312 lto_module_get_num_linkeropts(lto_module_t mod);
313
314
315 /**
316 * Returns the ith linker option in the module.
317 *
318 * Each linker option may consist of multiple flags. It is the linker's
319 * responsibility to split the flags using a platform-specific mechanism.
320 *
321 * \since LTO_API_VERSION=8
322 */
323 extern const char*
324 lto_module_get_linkeropt(lto_module_t mod, unsigned int index);
290 lto_module_get_linkeropts(lto_module_t mod);
325291
326292
327293 /**
222222 return unwrap(mod)->getSymbolAttributes(index);
223223 }
224224
225 unsigned int lto_module_get_num_deplibs(lto_module_t mod) {
226 return 0;
227 }
228
229 const char* lto_module_get_deplib(lto_module_t mod, unsigned int index) {
230 return nullptr;
231 }
232
233 unsigned int lto_module_get_num_linkeropts(lto_module_t mod) {
234 return 1;
235 }
236
237 const char* lto_module_get_linkeropt(lto_module_t mod, unsigned int index) {
238 if (index != 0)
239 return nullptr;
225 const char* lto_module_get_linkeropts(lto_module_t mod) {
240226 return unwrap(mod)->getLinkerOpts();
241227 }
242228
77 lto_module_create_from_memory_with_path
88 lto_module_create_in_local_context
99 lto_module_create_in_codegen_context
10 lto_module_get_deplib
11 lto_module_get_linkeropt
12 lto_module_get_num_deplibs
13 lto_module_get_num_linkeropts
10 lto_module_get_linkeropts
1411 lto_module_get_num_symbols
1512 lto_module_get_symbol_attribute
1613 lto_module_get_symbol_name