summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm-c
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-c] Remove dead typedefPeter Zotov2013-11-111-1/+0
| | | | llvm-svn: 194379
* This exposes the new calling conventions (WebKit_JS and AnyReg) via the C ↵Filip Pizlo2013-11-091-0/+2
| | | | | | API by adding them to the enumeration in Core.h. llvm-svn: 194323
* llvm-c/Support.h: Add a newline at eof.NAKAMURA Takumi2013-11-071-1/+1
| | | | llvm-svn: 194203
* [llvm-c] Add parameter names in Target.h for C99 compliancePeter Zotov2013-11-061-21/+23
| | | | llvm-svn: 194146
* [llvm-c] Improve TargetMachine bindingsPeter Zotov2013-11-061-0/+20
| | | | | | Original patch by Chris Wailes llvm-svn: 194143
* [llvm-c] Correctly check for existence of native AsmParser, AsmPrinter, ↵Peter Zotov2013-11-061-6/+6
| | | | | | | | Disassembler Also, properly name the functions. llvm-svn: 194141
* [llvm-c] Add functions for initializing native AsmPrinter, AsmParser & ↵Peter Zotov2013-11-061-0/+36
| | | | | | | | Disassembler Original patch by Chris Wailes llvm-svn: 194140
* [llvm-c] Expose LLVMLoadLibraryPermanentlyPeter Zotov2013-11-061-0/+36
| | | | | | Original patch by Chris Wailes llvm-svn: 194139
* [llvm-c] Expose IRReader interfacePeter Zotov2013-11-061-0/+40
| | | | | | Original patch by Chris Wailes llvm-svn: 194137
* [llvm-c] Implement LLVMPrintValueToStringPeter Zotov2013-11-061-0/+8
| | | | | | Original patch by Chris Wailes llvm-svn: 194135
* [llvm-c] (PR16190) Add LLVMIsA* functions for ConstantDataSequential and ↵Peter Zotov2013-11-051-0/+3
| | | | | | | | subclasses Original patch by David Monniaux llvm-svn: 194074
* Make the pretty stack trace be an opt-in, rather than opt-out, facility. ↵Filip Pizlo2013-11-041-6/+4
| | | | | | | | | Enable pretty stack traces by default if you use PrettyStackTraceProgram, so that existing LLVM-based tools will continue to get it without any changes. llvm-svn: 193971
* Add a comment to note that LLVMDisablePrettyStackTrace() is likely not a ↵Filip Pizlo2013-11-031-0/+3
| | | | | | good long-term solution. llvm-svn: 193939
* When LLVM is embedded in a larger application, it's not OK for LLVM to ↵Filip Pizlo2013-11-031-0/+6
| | | | | | | | intercept crashes. LLVM already has the ability to disable this functionality. This patch exposes it via the C API. llvm-svn: 193937
* Remove linkonce_odr_auto_hide.Rafael Espindola2013-11-011-1/+1
| | | | | | | | | | | | | | | linkonce_odr_auto_hide was in incomplete attempt to implement a way for the linker to hide symbols that are known to be available in every TU and whose addresses are not relevant for a particular DSO. It was redundant in that it all its uses are equivalent to linkonce_odr+unnamed_addr. Unlike those, it has never been connected to clang or llvm's optimizers, so it was effectively dead. Given that nothing produces it, this patch just nukes it (other than the llvm-c enum value). llvm-svn: 193865
* Add to the disassembler C API output reference types forKevin Enderby2013-11-011-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Objective-C data structures. This is allows tools such as darwin's otool(1) that uses the LLVM disassembler take a pointer value being loaded by an instruction and add a comment to what it is being referenced to make following disassembly of Objective-C programs more readable. For example disassembling the Mac OS X TextEdit app one will see comments like the following: movq 0x20684(%rip), %rsi ## Objc selector ref: standardUserDefaults movq 0x21985(%rip), %rdi ## Objc class ref: _OBJC_CLASS_$_NSUserDefaults movq 0x1d156(%rip), %r14 ## Objc message: +[NSUserDefaults standardUserDefaults] leaq 0x23615(%rip), %rdx ## Objc cfstring ref: @"SelectLinePanel" callq 0x10001386c ## Objc message: -[[%rdi super] initWithWindowNibName:] These diffs also include putting quotes around C strings in literal pools and uses "symbol address" in the comment when adding a symbol name to the comment to tell these types of references apart: leaq 0x4f(%rip), %rax ## literal pool for: "Hello world" movq 0x1c3ea(%rip), %rax ## literal pool symbol address: ___stack_chk_guard Of course the easy changes are in the LLVM disassembler and the hard work is up to the implementer of the SymbolLookUp() call back. rdar://10602439 llvm-svn: 193833
* Use LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN instead of the "dso list".Rafael Espindola2013-10-311-9/+0
| | | | | | | | | | | | | | | | | | | | | | There are two ways one could implement hiding of linkonce_odr symbols in LTO: * LLVM tells the linker which symbols can be hidden if not used from native files. * The linker tells LLVM which symbols are not used from other object files, but will be put in the dso symbol table if present. GOLD's API is the second option. It was implemented almost 1:1 in llvm by passing the list down to internalize. LLVM already had partial support for the first option. It is also very similar to how ld64 handles hiding these symbols when *not* doing LTO. This patch then * removes the APIs for the DSO list. * marks LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN all linkonce_odr unnamed_addr global values and other linkonce_odr whose address is not used. * makes the gold plugin responsible for handling the API mismatch. llvm-svn: 193800
* llvm-c: Make LLVM{Get,Set}Alignment work on {Load,Store}Inst tooAnders Waldenborg2013-10-291-2/+27
| | | | | | | | Patch by Peter Zotov Differential Revision: http://llvm-reviews.chandlerc.com/D1910 llvm-svn: 193597
* Use c comments.Rafael Espindola2013-10-251-3/+3
| | | | llvm-svn: 193404
* lto.h: Use lto_bool_t instead of int to restore the ABIReid Kleckner2013-10-241-9/+23
| | | | | | | | | | | | This reverts commit r193255 and instead creates an lto_bool_t typedef that points to bool, _Bool, or unsigned char depending on what is available. Only recent versions of MSVC provide a stdbool.h header. Reviewers: rafael.espindola Differential Revision: http://llvm-reviews.chandlerc.com/D2019 llvm-svn: 193377
* llvm-c/Target.h: Tweak "inline" for msvc to use __inline instead.NAKAMURA Takumi2013-10-231-0/+4
| | | | | FIXME: I don't think it'd be smart. llvm-svn: 193256
* llvm-c/lto.h: Avoid use of bool.NAKAMURA Takumi2013-10-231-12/+9
| | | | llvm-svn: 193255
* include/llvm-c: Whitespace.NAKAMURA Takumi2013-10-238-41/+40
| | | | llvm-svn: 193253
* Mark zero-argument functions explicitly in C headers.Benjamin Kramer2013-10-231-4/+4
| | | | | | Pacifies GCC's -Wstrict-prototypes. llvm-svn: 193249
* Speling fixes.Benjamin Kramer2013-10-221-1/+1
| | | | llvm-svn: 193165
* llvm-c: Add LLVMPrintTypeToStringAnders Waldenborg2013-10-221-0/+8
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1963 llvm-svn: 193149
* llvm-c: Add LLVMIntPtrType{,ForAS}InContextAnders Waldenborg2013-10-171-0/+9
| | | | | | | | | | | | All of the Core API functions have versions which accept explicit context, in addition to ones which work on global context. This commit adds functions which accept explicit context to the Target API for consistency. Patch by Peter Zotov Differential Revision: http://llvm-reviews.chandlerc.com/D1912 llvm-svn: 192913
* Expose install_fatal_error_handler() through the C API.Filip Pizlo2013-10-171-0/+16
| | | | | | | | | | | | | | | | | I expose the API with some caveats: - The C++ API involves a traditional void* opaque pointer for the fatal error callback. The C API doesn’t do this. I don’t think that the void* opaque pointer makes any sense since this is a global callback - there will only be one of them. So if you need to pass some data to your callback, just put it in a global variable. - The bindings will ignore the gen_crash_diag boolean. I ignore it because (1) I don’t know what it does, (2) it’s not documented AFAIK, and (3) I couldn’t imagine any use for it. I made the gut call that it probably wasn’t important enough to expose through the C API. llvm-svn: 192864
* llvm-c: Add LLVMDumpTypeAnders Waldenborg2013-10-161-0/+7
| | | | | | | | | | The C API currently allows to dump values (LLVMDumpValue), but a similar method for types was not exported. Patch by Peter Zotov Differential Revision: http://llvm-reviews.chandlerc.com/D1911 llvm-svn: 192852
* [llvm-c] Add LLVMPrintModuleToString.Anders Waldenborg2013-10-161-0/+8
| | | | | | | | | Like LLVMDumpModule but returns the string (that needs to be freed with LLVMDisposeMessage) instead of printing it to stderr. Differential Revision: http://llvm-reviews.chandlerc.com/D1941 llvm-svn: 192821
* Revert "Add AllTargetsBindings sublibrary" as it breaks cmake build on ↵Anders Waldenborg2013-10-151-11/+36
| | | | | | (atleast) windows and darwin. llvm-svn: 192697
* Add AllTargetsBindings sublibrary instead of having static inlines in the ↵Anders Waldenborg2013-10-151-36/+11
| | | | | | | | | | | | | llvm-c headers. This new library will be linked in when using the "all-targets" component and contains the LLVMInitializeAll* functions. This means that those functions will exist as real symbols in the shared library, and can therefore can be called from bindings that are using ffi the shared library. llvm-svn: 192690
* Revert "llvm-c: Make target initializer functions external functions in lib."Rui Ueyama2013-10-091-11/+36
| | | | | | | | This reverts commit r192316. The original change introduced circular dependencies between libTarget and backends. That would broke a build unless link everything into one big binary. llvm-svn: 192329
* llvm-c: Make target initializer functions external functions in lib.Anders Waldenborg2013-10-091-36/+11
| | | | | | | | | | | | | Making them proper functions defined in the (shared)lib instead of static inlines defined in the header files makes it possible to actually distribute a binary compiled against the shared library without having to worry about getting undefined symbol errors when calling e.g LLVMInitializeAllTargetInfos because the shared library on the other system was compiled with different targets. Differential Revision: http://llvm-reviews.chandlerc.com/D1714 llvm-svn: 192316
* Optimize linkonce_odr unnamed_addr functions during LTO.Rafael Espindola2013-10-031-4/+12
| | | | | | | | | | | Generalize the API so we can distinguish symbols that are needed just for a DSO symbol table from those that are used from some native .o. The symbols that are only wanted for the dso symbol table can be dropped if llvm can prove every other dso has a copy (linkonce_odr) and the address is not important (unnamed_addr). llvm-svn: 191922
* [llvm-c][Disassembler] Add an option to print latency information inQuentin Colombet2013-10-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | disassembled output alongside the instructions. E.g., on a vector shuffle operation with a memory operand, disassembled outputs are: * Without the option: vpshufd $-0x79, (%rsp), %xmm0 * With the option: vpshufd $-0x79, (%rsp), %xmm0 ## Latency: 5 The printed latency is extracted from the schedule model available in the disassembler context. Thus, this option has no effect if there is not a scheduling model for the target. This boils down to one may need to specify the CPU string, so that this option could have an effect. Note: Latency < 2 are not printed. This part of <rdar://problem/14687488>. llvm-svn: 191859
* This threads SectionName through the allocateCodeSection/allocateDataSection ↵Filip Pizlo2013-10-021-7/+8
| | | | | | | | | | | | | | | | | | APIs, both in C++ and C land. It's useful for the memory managers that are allocating a section to know what the name of the section is. At a minimum, this is useful for low-level debugging - it's customary for JITs to be able to tell you what memory they allocated, and as part of any such dump, they should be able to tell you some meta-data about what each allocation is for. This allows clients that supply their own memory managers to do this. Additionally, we also envision the SectionName being useful for passing meta-data from within LLVM to an LLVM client. This changes both the C and C++ APIs, and all of the clients of those APIs within LLVM. I'm assuming that it's safe to change the C++ API because that API is allowed to change. I'm assuming that it's safe to change the C API because we haven't shipped the API in a release yet (LLVM 3.3 doesn't include the MCJIT memory management C API). llvm-svn: 191804
* [llvm-c][Disassembler] Add an option to reproduce in disassembled output theQuentin Colombet2013-10-011-0/+2
| | | | | | | | | | | | | | comments issued with verbose assembly. E.g., on a vector shuffle operation, disassembled output are: * Without the option: vpshufd $-0x79, (%rsp), %xmm0 * With the option: vpshufd $-0x79, (%rsp), %xmm0 ## xmm0 = mem[3,1,0,2] This part of <rdar://problem/14687488>. llvm-svn: 191799
* llvm-c: use typedef for function pointersAnders Waldenborg2013-09-301-8/+13
| | | | | | | | This makes it consistent with other function pointers used in llvm-c Differential Revision: http://llvm-reviews.chandlerc.com/D1712 llvm-svn: 191693
* Try again to fix the MSVC build.Peter Collingbourne2013-09-251-1/+1
| | | | llvm-svn: 191359
* Wrap the #include of <stdbool.h> in an #ifndef __cplusplus.Peter Collingbourne2013-09-251-0/+2
| | | | | | This should fix the MSVC build. llvm-svn: 191357
* Revert "llvm-c: Add LLVMGetPointerToFunction"Anders Waldenborg2013-09-201-2/+0
| | | | | | This reverts r191030 llvm-svn: 191075
* llvm-c: Add LLVMGetPointerToFunctionAnders Waldenborg2013-09-191-0/+2
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1715 llvm-svn: 191030
* llvm-c: Make LLVMGetFirstTarget a proper prototypeAnders Waldenborg2013-09-191-1/+1
| | | | | | | | | This avoids warnings when included in a application that uses -Wstrict-prototypes. Differential Revision: http://llvm-reviews.chandlerc.com/D1713 llvm-svn: 191029
* Revert 189297, the original commit message is following. Shuxin Yang2013-08-271-17/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ---- Add new API lto_codegen_compile_parallel(). This API is proposed by Nick Kledzik. The semantic is: -------------------------------------------------------------------------- Generate code for merged module into an array of native object files. On success returns a pointer to an array of NativeObjectFile. The count parameter returns the number of elements in the array. Each element is a pointer/length for a generated mach-o/ELF buffer. The buffer is owned by the lto_code_gen_t and will be freed when lto_codegen_dispose() is called, or lto_codegen_compile() is called again. On failure, returns NULL (check lto_get_error_message() for details). extern const struct NativeObjectFile* lto_codegen_compile_parallel(lto_code_gen_t cg, size_t *count); --------------------------------------------------------------------------- This API is currently only called on OSX platform. Linux or other Unixes using GNU gold are not supposed to call this function, because on these systems, object files are fed back to linker via disk file instead of memory buffer. In this commit, lto_codegen_compile_parallel() simply calls lto_codegen_compile() to return a single object file. In the near future, this function is the entry point for compilation with partition. Linker can blindly call this function even if partition is turned off; in this case, compiler will return only one object file. llvm-svn: 189386
* Add new API lto_codegen_compile_parallel().Shuxin Yang2013-08-271-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This API is proposed by Nick Kledzik. The semantic is: -------------------------------------------------------------------------- Generate code for merged module into an array of native object files. On success returns a pointer to an array of NativeObjectFile. The count parameter returns the number of elements in the array. Each element is a pointer/length for a generated mach-o/ELF buffer. The buffer is owned by the lto_code_gen_t and will be freed when lto_codegen_dispose() is called, or lto_codegen_compile() is called again. On failure, returns NULL (check lto_get_error_message() for details). extern const struct NativeObjectFile* lto_codegen_compile_parallel(lto_code_gen_t cg, size_t *count); --------------------------------------------------------------------------- This API is currently only called on OSX platform. Linux or other Unixes using GNU gold are not supposed to call this function, because on these systems, object files are fed back to linker via disk file instead of memory buffer. In this commit, lto_codegen_compile_parallel() simply calls lto_codegen_compile() to return a single object file. In the near future, this function is the entry point for compilation with partition. Linker can blindly call this function even if partition is turned off; in this case, compiler will return only one object file. llvm-svn: 189297
* Add function attribute 'optnone'.Andrea Di Biagio2013-08-231-2/+3
| | | | | | | | This function attribute indicates that the function is not optimized by any optimization or code generator passes with the exception of interprocedural optimization passes. llvm-svn: 189101
* Turn MipsOptimizeMathLibCalls into a target-independent scalar transformRichard Sandiford2013-08-231-0/+3
| | | | | | | | | | ...so that it can be used for z too. Most of the code is the same. The only real change is to use TargetTransformInfo to test when a sqrt instruction is available. The pass is opt-in because at the moment it only handles sqrt. llvm-svn: 189097
* [typo] An LLVM.Daniel Dunbar2013-08-161-11/+11
| | | | llvm-svn: 188589
* Revert r188188 and r188200.Shuxin Yang2013-08-121-12/+0
| | | | | | | | In order to appease people (in Apple) who accuse me for committing "huge change" (?) without proper review. Thank Eric for fixing a compile-warning. llvm-svn: 188204
OpenPOWER on IntegriCloud