rustc_codegen_llvm: remove more unused functions.
This commit is contained in:
parent
f224441ed5
commit
ebec156abf
4 changed files with 21 additions and 401 deletions
|
@ -8,10 +8,8 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![allow(dead_code)] // FFI wrappers
|
|
||||||
|
|
||||||
use llvm::{AtomicRmwBinOp, AtomicOrdering, SynchronizationScope, AsmDialect};
|
use llvm::{AtomicRmwBinOp, AtomicOrdering, SynchronizationScope, AsmDialect};
|
||||||
use llvm::{Opcode, IntPredicate, RealPredicate, False, OperandBundleDef};
|
use llvm::{IntPredicate, RealPredicate, False, OperandBundleDef};
|
||||||
use llvm::{self, BasicBlock};
|
use llvm::{self, BasicBlock};
|
||||||
use common::*;
|
use common::*;
|
||||||
use type_::Type;
|
use type_::Type;
|
||||||
|
@ -26,7 +24,6 @@ use std::ffi::CString;
|
||||||
use std::ops::Range;
|
use std::ops::Range;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
use std::ptr::NonNull;
|
use std::ptr::NonNull;
|
||||||
use syntax_pos::Span;
|
|
||||||
|
|
||||||
// All Builders must have an llfn associated with them
|
// All Builders must have an llfn associated with them
|
||||||
#[must_use]
|
#[must_use]
|
||||||
|
@ -128,12 +125,6 @@ impl Builder<'a, 'll, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn position_before(&self, insn: &'ll Value) {
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMPositionBuilderBefore(self.llbuilder, insn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn position_at_end(&self, llbb: &'ll BasicBlock) {
|
pub fn position_at_end(&self, llbb: &'ll BasicBlock) {
|
||||||
unsafe {
|
unsafe {
|
||||||
llvm::LLVMPositionBuilderAtEnd(self.llbuilder, llbb);
|
llvm::LLVMPositionBuilderAtEnd(self.llbuilder, llbb);
|
||||||
|
@ -160,14 +151,6 @@ impl Builder<'a, 'll, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn aggregate_ret(&self, ret_vals: &[&'ll Value]) {
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildAggregateRet(self.llbuilder,
|
|
||||||
ret_vals.as_ptr(),
|
|
||||||
ret_vals.len() as c_uint);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn br(&self, dest: &'ll BasicBlock) {
|
pub fn br(&self, dest: &'ll BasicBlock) {
|
||||||
self.count_insn("br");
|
self.count_insn("br");
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -188,13 +171,6 @@ impl Builder<'a, 'll, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn indirect_br(&self, addr: &'ll Value, num_dests: usize) {
|
|
||||||
self.count_insn("indirectbr");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildIndirectBr(self.llbuilder, addr, num_dests as c_uint);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn invoke(&self,
|
pub fn invoke(&self,
|
||||||
llfn: &'ll Value,
|
llfn: &'ll Value,
|
||||||
args: &[&'ll Value],
|
args: &[&'ll Value],
|
||||||
|
@ -237,20 +213,6 @@ impl Builder<'a, 'll, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn nswadd(&self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
|
||||||
self.count_insn("nswadd");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildNSWAdd(self.llbuilder, lhs, rhs, noname())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn nuwadd(&self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
|
||||||
self.count_insn("nuwadd");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildNUWAdd(self.llbuilder, lhs, rhs, noname())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn fadd(&self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
pub fn fadd(&self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
||||||
self.count_insn("fadd");
|
self.count_insn("fadd");
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -274,20 +236,6 @@ impl Builder<'a, 'll, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn nswsub(&self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
|
||||||
self.count_insn("nswsub");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildNSWSub(self.llbuilder, lhs, rhs, noname())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn nuwsub(&self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
|
||||||
self.count_insn("nuwsub");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildNUWSub(self.llbuilder, lhs, rhs, noname())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn fsub(&self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
pub fn fsub(&self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
||||||
self.count_insn("fsub");
|
self.count_insn("fsub");
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -311,20 +259,6 @@ impl Builder<'a, 'll, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn nswmul(&self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
|
||||||
self.count_insn("nswmul");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildNSWMul(self.llbuilder, lhs, rhs, noname())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn nuwmul(&self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
|
||||||
self.count_insn("nuwmul");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildNUWMul(self.llbuilder, lhs, rhs, noname())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn fmul(&self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
pub fn fmul(&self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
||||||
self.count_insn("fmul");
|
self.count_insn("fmul");
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -458,14 +392,6 @@ impl Builder<'a, 'll, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn binop(&self, op: Opcode, lhs: &'ll Value, rhs: &'ll Value)
|
|
||||||
-> &'ll Value {
|
|
||||||
self.count_insn("binop");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildBinOp(self.llbuilder, op, lhs, rhs, noname())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn neg(&self, v: &'ll Value) -> &'ll Value {
|
pub fn neg(&self, v: &'ll Value) -> &'ll Value {
|
||||||
self.count_insn("neg");
|
self.count_insn("neg");
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -473,19 +399,6 @@ impl Builder<'a, 'll, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn nswneg(&self, v: &'ll Value) -> &'ll Value {
|
|
||||||
self.count_insn("nswneg");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildNSWNeg(self.llbuilder, v, noname())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn nuwneg(&self, v: &'ll Value) -> &'ll Value {
|
|
||||||
self.count_insn("nuwneg");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildNUWNeg(self.llbuilder, v, noname())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pub fn fneg(&self, v: &'ll Value) -> &'ll Value {
|
pub fn fneg(&self, v: &'ll Value) -> &'ll Value {
|
||||||
self.count_insn("fneg");
|
self.count_insn("fneg");
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -523,13 +436,6 @@ impl Builder<'a, 'll, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn free(&self, ptr: &'ll Value) {
|
|
||||||
self.count_insn("free");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildFree(self.llbuilder, ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn load(&self, ptr: &'ll Value, align: Align) -> &'ll Value {
|
pub fn load(&self, ptr: &'ll Value, align: Align) -> &'ll Value {
|
||||||
self.count_insn("load");
|
self.count_insn("load");
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -658,20 +564,6 @@ impl Builder<'a, 'll, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn global_string(&self, _str: *const c_char) -> &'ll Value {
|
|
||||||
self.count_insn("globalstring");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildGlobalString(self.llbuilder, _str, noname())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn global_string_ptr(&self, _str: *const c_char) -> &'ll Value {
|
|
||||||
self.count_insn("globalstringptr");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildGlobalStringPtr(self.llbuilder, _str, noname())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Casts */
|
/* Casts */
|
||||||
pub fn trunc(&self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value {
|
pub fn trunc(&self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value {
|
||||||
self.count_insn("trunc");
|
self.count_insn("trunc");
|
||||||
|
@ -757,34 +649,6 @@ impl Builder<'a, 'll, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn zext_or_bitcast(&self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value {
|
|
||||||
self.count_insn("zextorbitcast");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildZExtOrBitCast(self.llbuilder, val, dest_ty, noname())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn sext_or_bitcast(&self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value {
|
|
||||||
self.count_insn("sextorbitcast");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildSExtOrBitCast(self.llbuilder, val, dest_ty, noname())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn trunc_or_bitcast(&self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value {
|
|
||||||
self.count_insn("truncorbitcast");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildTruncOrBitCast(self.llbuilder, val, dest_ty, noname())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn cast(&self, op: Opcode, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value {
|
|
||||||
self.count_insn("cast");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildCast(self.llbuilder, op, val, dest_ty, noname())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn pointercast(&self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value {
|
pub fn pointercast(&self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value {
|
||||||
self.count_insn("pointercast");
|
self.count_insn("pointercast");
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -799,14 +663,6 @@ impl Builder<'a, 'll, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fpcast(&self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value {
|
|
||||||
self.count_insn("fpcast");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildFPCast(self.llbuilder, val, dest_ty, noname())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Comparisons */
|
/* Comparisons */
|
||||||
pub fn icmp(&self, op: IntPredicate, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
pub fn icmp(&self, op: IntPredicate, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
||||||
self.count_insn("icmp");
|
self.count_insn("icmp");
|
||||||
|
@ -842,32 +698,6 @@ impl Builder<'a, 'll, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_span_comment(&self, sp: Span, text: &str) {
|
|
||||||
if self.cx.sess().asm_comments() {
|
|
||||||
let s = format!("{} ({})",
|
|
||||||
text,
|
|
||||||
self.cx.sess().codemap().span_to_string(sp));
|
|
||||||
debug!("{}", s);
|
|
||||||
self.add_comment(&s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn add_comment(&self, text: &str) {
|
|
||||||
if self.cx.sess().asm_comments() {
|
|
||||||
let sanitized = text.replace("$", "");
|
|
||||||
let comment_text = format!("{} {}", "#",
|
|
||||||
sanitized.replace("\n", "\n\t# "));
|
|
||||||
self.count_insn("inlineasm");
|
|
||||||
let comment_text = CString::new(comment_text).unwrap();
|
|
||||||
let asm = unsafe {
|
|
||||||
llvm::LLVMConstInlineAsm(Type::func(&[], Type::void(self.cx)),
|
|
||||||
comment_text.as_ptr(), noname(), False,
|
|
||||||
False)
|
|
||||||
};
|
|
||||||
self.call(asm, &[], None);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn inline_asm_call(&self, asm: *const c_char, cons: *const c_char,
|
pub fn inline_asm_call(&self, asm: *const c_char, cons: *const c_char,
|
||||||
inputs: &[&'ll Value], output: &'ll Type,
|
inputs: &[&'ll Value], output: &'ll Type,
|
||||||
volatile: bool, alignstack: bool,
|
volatile: bool, alignstack: bool,
|
||||||
|
@ -936,6 +766,7 @@ impl Builder<'a, 'll, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
pub fn va_arg(&self, list: &'ll Value, ty: &'ll Type) -> &'ll Value {
|
pub fn va_arg(&self, list: &'ll Value, ty: &'ll Type) -> &'ll Value {
|
||||||
self.count_insn("vaarg");
|
self.count_insn("vaarg");
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -1102,27 +933,6 @@ impl Builder<'a, 'll, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_null(&self, val: &'ll Value) -> &'ll Value {
|
|
||||||
self.count_insn("isnull");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildIsNull(self.llbuilder, val, noname())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn is_not_null(&self, val: &'ll Value) -> &'ll Value {
|
|
||||||
self.count_insn("isnotnull");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildIsNotNull(self.llbuilder, val, noname())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn ptrdiff(&self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
|
||||||
self.count_insn("ptrdiff");
|
|
||||||
unsafe {
|
|
||||||
llvm::LLVMBuildPtrDiff(self.llbuilder, lhs, rhs, noname())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn landing_pad(&self, ty: &'ll Type, pers_fn: &'ll Value,
|
pub fn landing_pad(&self, ty: &'ll Type, pers_fn: &'ll Value,
|
||||||
num_clauses: usize) -> &'ll Value {
|
num_clauses: usize) -> &'ll Value {
|
||||||
self.count_insn("landingpad");
|
self.count_insn("landingpad");
|
||||||
|
|
|
@ -22,13 +22,12 @@ use super::debuginfo::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use libc::{c_uint, c_int, size_t, c_char};
|
use libc::{c_uint, c_int, size_t, c_char};
|
||||||
use libc::{c_longlong, c_ulonglong, c_void};
|
use libc::{c_ulonglong, c_void};
|
||||||
|
|
||||||
use std::ptr::NonNull;
|
use std::ptr::NonNull;
|
||||||
|
|
||||||
use super::RustStringRef;
|
use super::RustStringRef;
|
||||||
|
|
||||||
pub type Opcode = u32;
|
|
||||||
pub type Bool = c_uint;
|
pub type Bool = c_uint;
|
||||||
|
|
||||||
pub const True: Bool = 1 as Bool;
|
pub const True: Bool = 1 as Bool;
|
||||||
|
@ -36,6 +35,7 @@ pub const False: Bool = 0 as Bool;
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq)]
|
#[derive(Copy, Clone, PartialEq)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
|
#[allow(dead_code)] // Variants constructed by C++.
|
||||||
pub enum LLVMRustResult {
|
pub enum LLVMRustResult {
|
||||||
Success,
|
Success,
|
||||||
Failure,
|
Failure,
|
||||||
|
@ -88,22 +88,14 @@ pub enum Visibility {
|
||||||
Protected = 2,
|
Protected = 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// LLVMDiagnosticSeverity
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
|
||||||
#[repr(C)]
|
|
||||||
pub enum DiagnosticSeverity {
|
|
||||||
Error = 0,
|
|
||||||
Warning = 1,
|
|
||||||
Remark = 2,
|
|
||||||
Note = 3,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// LLVMDLLStorageClass
|
/// LLVMDLLStorageClass
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub enum DLLStorageClass {
|
pub enum DLLStorageClass {
|
||||||
|
#[allow(dead_code)]
|
||||||
Default = 0,
|
Default = 0,
|
||||||
DllImport = 1, // Function to be imported from DLL.
|
DllImport = 1, // Function to be imported from DLL.
|
||||||
|
#[allow(dead_code)]
|
||||||
DllExport = 2, // Function to be accessible from DLL.
|
DllExport = 2, // Function to be accessible from DLL.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,6 +212,7 @@ pub enum AtomicRmwBinOp {
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub enum AtomicOrdering {
|
pub enum AtomicOrdering {
|
||||||
|
#[allow(dead_code)]
|
||||||
NotAtomic = 0,
|
NotAtomic = 0,
|
||||||
Unordered = 1,
|
Unordered = 1,
|
||||||
Monotonic = 2,
|
Monotonic = 2,
|
||||||
|
@ -234,6 +227,8 @@ pub enum AtomicOrdering {
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub enum SynchronizationScope {
|
pub enum SynchronizationScope {
|
||||||
|
// FIXME: figure out if this variant is needed at all.
|
||||||
|
#[allow(dead_code)]
|
||||||
Other,
|
Other,
|
||||||
SingleThread,
|
SingleThread,
|
||||||
CrossThread,
|
CrossThread,
|
||||||
|
@ -243,6 +238,8 @@ pub enum SynchronizationScope {
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub enum FileType {
|
pub enum FileType {
|
||||||
|
// FIXME: figure out if this variant is needed at all.
|
||||||
|
#[allow(dead_code)]
|
||||||
Other,
|
Other,
|
||||||
AssemblyFile,
|
AssemblyFile,
|
||||||
ObjectFile,
|
ObjectFile,
|
||||||
|
@ -270,6 +267,8 @@ pub enum MetadataType {
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub enum AsmDialect {
|
pub enum AsmDialect {
|
||||||
|
// FIXME: figure out if this variant is needed at all.
|
||||||
|
#[allow(dead_code)]
|
||||||
Other,
|
Other,
|
||||||
Att,
|
Att,
|
||||||
Intel,
|
Intel,
|
||||||
|
@ -279,6 +278,8 @@ pub enum AsmDialect {
|
||||||
#[derive(Copy, Clone, PartialEq)]
|
#[derive(Copy, Clone, PartialEq)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub enum CodeGenOptLevel {
|
pub enum CodeGenOptLevel {
|
||||||
|
// FIXME: figure out if this variant is needed at all.
|
||||||
|
#[allow(dead_code)]
|
||||||
Other,
|
Other,
|
||||||
None,
|
None,
|
||||||
Less,
|
Less,
|
||||||
|
@ -303,6 +304,8 @@ pub enum RelocMode {
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub enum CodeModel {
|
pub enum CodeModel {
|
||||||
|
// FIXME: figure out if this variant is needed at all.
|
||||||
|
#[allow(dead_code)]
|
||||||
Other,
|
Other,
|
||||||
Small,
|
Small,
|
||||||
Kernel,
|
Kernel,
|
||||||
|
@ -314,6 +317,7 @@ pub enum CodeModel {
|
||||||
/// LLVMRustDiagnosticKind
|
/// LLVMRustDiagnosticKind
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
|
#[allow(dead_code)] // Variants constructed by C++.
|
||||||
pub enum DiagnosticKind {
|
pub enum DiagnosticKind {
|
||||||
Other,
|
Other,
|
||||||
InlineAsm,
|
InlineAsm,
|
||||||
|
@ -334,6 +338,8 @@ pub enum DiagnosticKind {
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub enum ArchiveKind {
|
pub enum ArchiveKind {
|
||||||
|
// FIXME: figure out if this variant is needed at all.
|
||||||
|
#[allow(dead_code)]
|
||||||
Other,
|
Other,
|
||||||
K_GNU,
|
K_GNU,
|
||||||
K_BSD,
|
K_BSD,
|
||||||
|
@ -343,6 +349,7 @@ pub enum ArchiveKind {
|
||||||
/// LLVMRustPassKind
|
/// LLVMRustPassKind
|
||||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
|
#[allow(dead_code)] // Variants constructed by C++.
|
||||||
pub enum PassKind {
|
pub enum PassKind {
|
||||||
Other,
|
Other,
|
||||||
Function,
|
Function,
|
||||||
|
@ -406,8 +413,6 @@ extern { pub type Twine; }
|
||||||
pub type TwineRef = *mut Twine;
|
pub type TwineRef = *mut Twine;
|
||||||
extern { pub type DiagnosticInfo; }
|
extern { pub type DiagnosticInfo; }
|
||||||
pub type DiagnosticInfoRef = *mut DiagnosticInfo;
|
pub type DiagnosticInfoRef = *mut DiagnosticInfo;
|
||||||
extern { pub type DebugLoc; }
|
|
||||||
pub type DebugLocRef = *mut DebugLoc;
|
|
||||||
extern { pub type SMDiagnostic; }
|
extern { pub type SMDiagnostic; }
|
||||||
pub type SMDiagnosticRef = *mut SMDiagnostic;
|
pub type SMDiagnosticRef = *mut SMDiagnostic;
|
||||||
extern { pub type RustArchiveMember; }
|
extern { pub type RustArchiveMember; }
|
||||||
|
@ -492,9 +497,6 @@ extern "C" {
|
||||||
pub fn LLVMGetDataLayout(M: &Module) -> *const c_char;
|
pub fn LLVMGetDataLayout(M: &Module) -> *const c_char;
|
||||||
pub fn LLVMSetDataLayout(M: &Module, Triple: *const c_char);
|
pub fn LLVMSetDataLayout(M: &Module, Triple: *const c_char);
|
||||||
|
|
||||||
/// See Module::dump.
|
|
||||||
pub fn LLVMDumpModule(M: &Module);
|
|
||||||
|
|
||||||
/// See Module::setModuleInlineAsm.
|
/// See Module::setModuleInlineAsm.
|
||||||
pub fn LLVMSetModuleInlineAsm(M: &Module, Asm: *const c_char);
|
pub fn LLVMSetModuleInlineAsm(M: &Module, Asm: *const c_char);
|
||||||
pub fn LLVMRustAppendModuleInlineAsm(M: &Module, Asm: *const c_char);
|
pub fn LLVMRustAppendModuleInlineAsm(M: &Module, Asm: *const c_char);
|
||||||
|
@ -522,7 +524,6 @@ extern "C" {
|
||||||
ParamCount: c_uint,
|
ParamCount: c_uint,
|
||||||
IsVarArg: Bool)
|
IsVarArg: Bool)
|
||||||
-> &'a Type;
|
-> &'a Type;
|
||||||
pub fn LLVMGetReturnType(FunctionTy: &Type) -> &Type;
|
|
||||||
pub fn LLVMCountParamTypes(FunctionTy: &Type) -> c_uint;
|
pub fn LLVMCountParamTypes(FunctionTy: &Type) -> c_uint;
|
||||||
pub fn LLVMGetParamTypes(FunctionTy: &'a Type, Dest: *mut &'a Type);
|
pub fn LLVMGetParamTypes(FunctionTy: &'a Type, Dest: *mut &'a Type);
|
||||||
|
|
||||||
|
@ -532,7 +533,6 @@ extern "C" {
|
||||||
ElementCount: c_uint,
|
ElementCount: c_uint,
|
||||||
Packed: Bool)
|
Packed: Bool)
|
||||||
-> &'a Type;
|
-> &'a Type;
|
||||||
pub fn LLVMIsPackedStruct(StructTy: &Type) -> Bool;
|
|
||||||
|
|
||||||
// Operations on array, pointer, and vector types (sequence types)
|
// Operations on array, pointer, and vector types (sequence types)
|
||||||
pub fn LLVMRustArrayType(ElementType: &Type, ElementCount: u64) -> &Type;
|
pub fn LLVMRustArrayType(ElementType: &Type, ElementCount: u64) -> &Type;
|
||||||
|
@ -554,13 +554,8 @@ extern "C" {
|
||||||
pub fn LLVMReplaceAllUsesWith(OldVal: &'a Value, NewVal: &'a Value);
|
pub fn LLVMReplaceAllUsesWith(OldVal: &'a Value, NewVal: &'a Value);
|
||||||
pub fn LLVMSetMetadata(Val: &'a Value, KindID: c_uint, Node: &'a Value);
|
pub fn LLVMSetMetadata(Val: &'a Value, KindID: c_uint, Node: &'a Value);
|
||||||
|
|
||||||
// Operations on Users
|
|
||||||
pub fn LLVMGetOperand(Val: &Value, Index: c_uint) -> &Value;
|
|
||||||
|
|
||||||
// Operations on constants of any type
|
// Operations on constants of any type
|
||||||
pub fn LLVMConstNull(Ty: &Type) -> &Value;
|
pub fn LLVMConstNull(Ty: &Type) -> &Value;
|
||||||
pub fn LLVMConstICmp(Pred: IntPredicate, V1: &'a Value, V2: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMConstFCmp(Pred: RealPredicate, V1: &'a Value, V2: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMGetUndef(Ty: &Type) -> &Value;
|
pub fn LLVMGetUndef(Ty: &Type) -> &Value;
|
||||||
|
|
||||||
// Operations on metadata
|
// Operations on metadata
|
||||||
|
@ -572,7 +567,6 @@ extern "C" {
|
||||||
pub fn LLVMConstInt(IntTy: &Type, N: c_ulonglong, SignExtend: Bool) -> &Value;
|
pub fn LLVMConstInt(IntTy: &Type, N: c_ulonglong, SignExtend: Bool) -> &Value;
|
||||||
pub fn LLVMConstIntOfArbitraryPrecision(IntTy: &Type, Wn: c_uint, Ws: *const u64) -> &Value;
|
pub fn LLVMConstIntOfArbitraryPrecision(IntTy: &Type, Wn: c_uint, Ws: *const u64) -> &Value;
|
||||||
pub fn LLVMConstIntGetZExtValue(ConstantVal: &Value) -> c_ulonglong;
|
pub fn LLVMConstIntGetZExtValue(ConstantVal: &Value) -> c_ulonglong;
|
||||||
pub fn LLVMConstIntGetSExtValue(ConstantVal: &Value) -> c_longlong;
|
|
||||||
pub fn LLVMRustConstInt128Get(ConstantVal: &Value, SExt: bool,
|
pub fn LLVMRustConstInt128Get(ConstantVal: &Value, SExt: bool,
|
||||||
high: *mut u64, low: *mut u64) -> bool;
|
high: *mut u64, low: *mut u64) -> bool;
|
||||||
pub fn LLVMConstRealGetDouble (ConstantVal: &Value, losesInfo: *mut Bool) -> f64;
|
pub fn LLVMConstRealGetDouble (ConstantVal: &Value, losesInfo: *mut Bool) -> f64;
|
||||||
|
@ -597,67 +591,25 @@ extern "C" {
|
||||||
pub fn LLVMConstVector(ScalarConstantVals: *const &Value, Size: c_uint) -> &Value;
|
pub fn LLVMConstVector(ScalarConstantVals: *const &Value, Size: c_uint) -> &Value;
|
||||||
|
|
||||||
// Constant expressions
|
// Constant expressions
|
||||||
pub fn LLVMSizeOf(Ty: &Type) -> &Value;
|
|
||||||
pub fn LLVMConstNeg(ConstantVal: &Value) -> &Value;
|
|
||||||
pub fn LLVMConstFNeg(ConstantVal: &Value) -> &Value;
|
|
||||||
pub fn LLVMConstNot(ConstantVal: &Value) -> &Value;
|
|
||||||
pub fn LLVMConstAdd(LHSConstant: &'a Value, RHSConstant: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMConstFAdd(LHSConstant: &'a Value, RHSConstant: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMConstSub(LHSConstant: &'a Value, RHSConstant: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMConstFSub(LHSConstant: &'a Value, RHSConstant: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMConstMul(LHSConstant: &'a Value, RHSConstant: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMConstFMul(LHSConstant: &'a Value, RHSConstant: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMConstUDiv(LHSConstant: &'a Value, RHSConstant: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMConstSDiv(LHSConstant: &'a Value, RHSConstant: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMConstFDiv(LHSConstant: &'a Value, RHSConstant: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMConstURem(LHSConstant: &'a Value, RHSConstant: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMConstSRem(LHSConstant: &'a Value, RHSConstant: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMConstFRem(LHSConstant: &'a Value, RHSConstant: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMConstAnd(LHSConstant: &'a Value, RHSConstant: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMConstOr(LHSConstant: &'a Value, RHSConstant: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMConstXor(LHSConstant: &'a Value, RHSConstant: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMConstShl(LHSConstant: &'a Value, RHSConstant: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMConstLShr(LHSConstant: &'a Value, RHSConstant: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMConstAShr(LHSConstant: &'a Value, RHSConstant: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMConstGEP(
|
|
||||||
ConstantVal: &'a Value,
|
|
||||||
ConstantIndices: *const &'a Value,
|
|
||||||
NumIndices: c_uint,
|
|
||||||
) -> &'a Value;
|
|
||||||
pub fn LLVMConstInBoundsGEP(
|
pub fn LLVMConstInBoundsGEP(
|
||||||
ConstantVal: &'a Value,
|
ConstantVal: &'a Value,
|
||||||
ConstantIndices: *const &'a Value,
|
ConstantIndices: *const &'a Value,
|
||||||
NumIndices: c_uint,
|
NumIndices: c_uint,
|
||||||
) -> &'a Value;
|
) -> &'a Value;
|
||||||
pub fn LLVMConstTrunc(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
|
||||||
pub fn LLVMConstZExt(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
pub fn LLVMConstZExt(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
||||||
pub fn LLVMConstUIToFP(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
|
||||||
pub fn LLVMConstSIToFP(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
|
||||||
pub fn LLVMConstFPToUI(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
|
||||||
pub fn LLVMConstFPToSI(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
|
||||||
pub fn LLVMConstPtrToInt(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
pub fn LLVMConstPtrToInt(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
||||||
pub fn LLVMConstIntToPtr(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
pub fn LLVMConstIntToPtr(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
||||||
pub fn LLVMConstBitCast(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
pub fn LLVMConstBitCast(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
||||||
pub fn LLVMConstPointerCast(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
pub fn LLVMConstPointerCast(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
||||||
pub fn LLVMConstIntCast(ConstantVal: &'a Value, ToType: &'a Type, isSigned: Bool) -> &'a Value;
|
|
||||||
pub fn LLVMConstFPCast(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
|
||||||
pub fn LLVMConstExtractValue(AggConstant: &Value,
|
pub fn LLVMConstExtractValue(AggConstant: &Value,
|
||||||
IdxList: *const c_uint,
|
IdxList: *const c_uint,
|
||||||
NumIdx: c_uint)
|
NumIdx: c_uint)
|
||||||
-> &Value;
|
-> &Value;
|
||||||
pub fn LLVMConstInlineAsm(Ty: &Type,
|
|
||||||
AsmString: *const c_char,
|
|
||||||
Constraints: *const c_char,
|
|
||||||
HasSideEffects: Bool,
|
|
||||||
IsAlignStack: Bool)
|
|
||||||
-> &Value;
|
|
||||||
|
|
||||||
|
|
||||||
// Operations on global variables, functions, and aliases (globals)
|
// Operations on global variables, functions, and aliases (globals)
|
||||||
pub fn LLVMIsDeclaration(Global: &Value) -> Bool;
|
pub fn LLVMIsDeclaration(Global: &Value) -> Bool;
|
||||||
pub fn LLVMRustGetLinkage(Global: &Value) -> Linkage;
|
pub fn LLVMRustGetLinkage(Global: &Value) -> Linkage;
|
||||||
pub fn LLVMRustSetLinkage(Global: &Value, RustLinkage: Linkage);
|
pub fn LLVMRustSetLinkage(Global: &Value, RustLinkage: Linkage);
|
||||||
pub fn LLVMGetSection(Global: &Value) -> *const c_char;
|
|
||||||
pub fn LLVMSetSection(Global: &Value, Section: *const c_char);
|
pub fn LLVMSetSection(Global: &Value, Section: *const c_char);
|
||||||
pub fn LLVMRustGetVisibility(Global: &Value) -> Visibility;
|
pub fn LLVMRustGetVisibility(Global: &Value) -> Visibility;
|
||||||
pub fn LLVMRustSetVisibility(Global: &Value, Viz: Visibility);
|
pub fn LLVMRustSetVisibility(Global: &Value, Viz: Visibility);
|
||||||
|
@ -684,10 +636,6 @@ extern "C" {
|
||||||
pub fn LLVMSetTailCall(CallInst: &Value, IsTailCall: Bool);
|
pub fn LLVMSetTailCall(CallInst: &Value, IsTailCall: Bool);
|
||||||
|
|
||||||
// Operations on functions
|
// Operations on functions
|
||||||
pub fn LLVMAddFunction(M: &'a Module, Name: *const c_char, FunctionTy: &'a Type) -> &'a Value;
|
|
||||||
pub fn LLVMGetNamedFunction(M: &Module, Name: *const c_char) -> &Value;
|
|
||||||
pub fn LLVMGetFirstFunction(M: &Module) -> &Value;
|
|
||||||
pub fn LLVMGetNextFunction(Fn: &Value) -> &Value;
|
|
||||||
pub fn LLVMRustGetOrInsertFunction(M: &'a Module,
|
pub fn LLVMRustGetOrInsertFunction(M: &'a Module,
|
||||||
Name: *const c_char,
|
Name: *const c_char,
|
||||||
FunctionTy: &'a Type)
|
FunctionTy: &'a Type)
|
||||||
|
@ -708,7 +656,6 @@ extern "C" {
|
||||||
pub fn LLVMGetParam(Fn: &Value, Index: c_uint) -> &Value;
|
pub fn LLVMGetParam(Fn: &Value, Index: c_uint) -> &Value;
|
||||||
|
|
||||||
// Operations on basic blocks
|
// Operations on basic blocks
|
||||||
pub fn LLVMBasicBlockAsValue(BB: &BasicBlock) -> &Value;
|
|
||||||
pub fn LLVMGetBasicBlockParent(BB: &BasicBlock) -> &Value;
|
pub fn LLVMGetBasicBlockParent(BB: &BasicBlock) -> &Value;
|
||||||
pub fn LLVMAppendBasicBlockInContext(C: &'a Context,
|
pub fn LLVMAppendBasicBlockInContext(C: &'a Context,
|
||||||
Fn: &'a Value,
|
Fn: &'a Value,
|
||||||
|
@ -717,10 +664,7 @@ extern "C" {
|
||||||
pub fn LLVMDeleteBasicBlock(BB: &BasicBlock);
|
pub fn LLVMDeleteBasicBlock(BB: &BasicBlock);
|
||||||
|
|
||||||
// Operations on instructions
|
// Operations on instructions
|
||||||
pub fn LLVMGetInstructionParent(Inst: &Value) -> &BasicBlock;
|
|
||||||
pub fn LLVMGetFirstBasicBlock(Fn: &Value) -> &BasicBlock;
|
pub fn LLVMGetFirstBasicBlock(Fn: &Value) -> &BasicBlock;
|
||||||
pub fn LLVMGetFirstInstruction(BB: &BasicBlock) -> &'a Value;
|
|
||||||
pub fn LLVMInstructionEraseFromParent(Inst: &Value);
|
|
||||||
|
|
||||||
// Operations on call sites
|
// Operations on call sites
|
||||||
pub fn LLVMSetInstructionCallConv(Instr: &Value, CC: c_uint);
|
pub fn LLVMSetInstructionCallConv(Instr: &Value, CC: c_uint);
|
||||||
|
@ -742,8 +686,6 @@ extern "C" {
|
||||||
|
|
||||||
// Instruction builders
|
// Instruction builders
|
||||||
pub fn LLVMCreateBuilderInContext(C: &Context) -> &Builder;
|
pub fn LLVMCreateBuilderInContext(C: &Context) -> &Builder;
|
||||||
pub fn LLVMPositionBuilder(Builder: &'a Builder, Block: &'a BasicBlock, Instr: &'a Value);
|
|
||||||
pub fn LLVMPositionBuilderBefore(Builder: &'a Builder, Instr: &'a Value);
|
|
||||||
pub fn LLVMPositionBuilderAtEnd(Builder: &'a Builder, Block: &'a BasicBlock);
|
pub fn LLVMPositionBuilderAtEnd(Builder: &'a Builder, Block: &'a BasicBlock);
|
||||||
pub fn LLVMGetInsertBlock(Builder: &Builder) -> &BasicBlock;
|
pub fn LLVMGetInsertBlock(Builder: &Builder) -> &BasicBlock;
|
||||||
pub fn LLVMDisposeBuilder(Builder: &Builder);
|
pub fn LLVMDisposeBuilder(Builder: &Builder);
|
||||||
|
@ -756,7 +698,6 @@ extern "C" {
|
||||||
// Terminators
|
// Terminators
|
||||||
pub fn LLVMBuildRetVoid(B: &Builder) -> &Value;
|
pub fn LLVMBuildRetVoid(B: &Builder) -> &Value;
|
||||||
pub fn LLVMBuildRet(B: &'a Builder, V: &'a Value) -> &'a Value;
|
pub fn LLVMBuildRet(B: &'a Builder, V: &'a Value) -> &'a Value;
|
||||||
pub fn LLVMBuildAggregateRet(B: &'a Builder, RetVals: *const &'a Value, N: c_uint) -> &'a Value;
|
|
||||||
pub fn LLVMBuildBr(B: &'a Builder, Dest: &'a BasicBlock) -> &'a Value;
|
pub fn LLVMBuildBr(B: &'a Builder, Dest: &'a BasicBlock) -> &'a Value;
|
||||||
pub fn LLVMBuildCondBr(B: &'a Builder,
|
pub fn LLVMBuildCondBr(B: &'a Builder,
|
||||||
If: &'a Value,
|
If: &'a Value,
|
||||||
|
@ -768,7 +709,6 @@ extern "C" {
|
||||||
Else: &'a BasicBlock,
|
Else: &'a BasicBlock,
|
||||||
NumCases: c_uint)
|
NumCases: c_uint)
|
||||||
-> &'a Value;
|
-> &'a Value;
|
||||||
pub fn LLVMBuildIndirectBr(B: &'a Builder, Addr: &'a Value, NumDests: c_uint) -> &'a Value;
|
|
||||||
pub fn LLVMRustBuildInvoke(B: &'a Builder,
|
pub fn LLVMRustBuildInvoke(B: &'a Builder,
|
||||||
Fn: &'a Value,
|
Fn: &'a Value,
|
||||||
Args: *const &'a Value,
|
Args: *const &'a Value,
|
||||||
|
@ -828,16 +768,6 @@ extern "C" {
|
||||||
RHS: &'a Value,
|
RHS: &'a Value,
|
||||||
Name: *const c_char)
|
Name: *const c_char)
|
||||||
-> &'a Value;
|
-> &'a Value;
|
||||||
pub fn LLVMBuildNSWAdd(B: &'a Builder,
|
|
||||||
LHS: &'a Value,
|
|
||||||
RHS: &'a Value,
|
|
||||||
Name: *const c_char)
|
|
||||||
-> &'a Value;
|
|
||||||
pub fn LLVMBuildNUWAdd(B: &'a Builder,
|
|
||||||
LHS: &'a Value,
|
|
||||||
RHS: &'a Value,
|
|
||||||
Name: *const c_char)
|
|
||||||
-> &'a Value;
|
|
||||||
pub fn LLVMBuildFAdd(B: &'a Builder,
|
pub fn LLVMBuildFAdd(B: &'a Builder,
|
||||||
LHS: &'a Value,
|
LHS: &'a Value,
|
||||||
RHS: &'a Value,
|
RHS: &'a Value,
|
||||||
|
@ -848,16 +778,6 @@ extern "C" {
|
||||||
RHS: &'a Value,
|
RHS: &'a Value,
|
||||||
Name: *const c_char)
|
Name: *const c_char)
|
||||||
-> &'a Value;
|
-> &'a Value;
|
||||||
pub fn LLVMBuildNSWSub(B: &'a Builder,
|
|
||||||
LHS: &'a Value,
|
|
||||||
RHS: &'a Value,
|
|
||||||
Name: *const c_char)
|
|
||||||
-> &'a Value;
|
|
||||||
pub fn LLVMBuildNUWSub(B: &'a Builder,
|
|
||||||
LHS: &'a Value,
|
|
||||||
RHS: &'a Value,
|
|
||||||
Name: *const c_char)
|
|
||||||
-> &'a Value;
|
|
||||||
pub fn LLVMBuildFSub(B: &'a Builder,
|
pub fn LLVMBuildFSub(B: &'a Builder,
|
||||||
LHS: &'a Value,
|
LHS: &'a Value,
|
||||||
RHS: &'a Value,
|
RHS: &'a Value,
|
||||||
|
@ -868,16 +788,6 @@ extern "C" {
|
||||||
RHS: &'a Value,
|
RHS: &'a Value,
|
||||||
Name: *const c_char)
|
Name: *const c_char)
|
||||||
-> &'a Value;
|
-> &'a Value;
|
||||||
pub fn LLVMBuildNSWMul(B: &'a Builder,
|
|
||||||
LHS: &'a Value,
|
|
||||||
RHS: &'a Value,
|
|
||||||
Name: *const c_char)
|
|
||||||
-> &'a Value;
|
|
||||||
pub fn LLVMBuildNUWMul(B: &'a Builder,
|
|
||||||
LHS: &'a Value,
|
|
||||||
RHS: &'a Value,
|
|
||||||
Name: *const c_char)
|
|
||||||
-> &'a Value;
|
|
||||||
pub fn LLVMBuildFMul(B: &'a Builder,
|
pub fn LLVMBuildFMul(B: &'a Builder,
|
||||||
LHS: &'a Value,
|
LHS: &'a Value,
|
||||||
RHS: &'a Value,
|
RHS: &'a Value,
|
||||||
|
@ -953,22 +863,13 @@ extern "C" {
|
||||||
RHS: &'a Value,
|
RHS: &'a Value,
|
||||||
Name: *const c_char)
|
Name: *const c_char)
|
||||||
-> &'a Value;
|
-> &'a Value;
|
||||||
pub fn LLVMBuildBinOp(B: &'a Builder,
|
|
||||||
Op: Opcode,
|
|
||||||
LHS: &'a Value,
|
|
||||||
RHS: &'a Value,
|
|
||||||
Name: *const c_char)
|
|
||||||
-> &'a Value;
|
|
||||||
pub fn LLVMBuildNeg(B: &'a Builder, V: &'a Value, Name: *const c_char) -> &'a Value;
|
pub fn LLVMBuildNeg(B: &'a Builder, V: &'a Value, Name: *const c_char) -> &'a Value;
|
||||||
pub fn LLVMBuildNSWNeg(B: &'a Builder, V: &'a Value, Name: *const c_char) -> &'a Value;
|
|
||||||
pub fn LLVMBuildNUWNeg(B: &'a Builder, V: &'a Value, Name: *const c_char) -> &'a Value;
|
|
||||||
pub fn LLVMBuildFNeg(B: &'a Builder, V: &'a Value, Name: *const c_char) -> &'a Value;
|
pub fn LLVMBuildFNeg(B: &'a Builder, V: &'a Value, Name: *const c_char) -> &'a Value;
|
||||||
pub fn LLVMBuildNot(B: &'a Builder, V: &'a Value, Name: *const c_char) -> &'a Value;
|
pub fn LLVMBuildNot(B: &'a Builder, V: &'a Value, Name: *const c_char) -> &'a Value;
|
||||||
pub fn LLVMRustSetHasUnsafeAlgebra(Instr: &Value);
|
pub fn LLVMRustSetHasUnsafeAlgebra(Instr: &Value);
|
||||||
|
|
||||||
// Memory
|
// Memory
|
||||||
pub fn LLVMBuildAlloca(B: &'a Builder, Ty: &'a Type, Name: *const c_char) -> &'a Value;
|
pub fn LLVMBuildAlloca(B: &'a Builder, Ty: &'a Type, Name: *const c_char) -> &'a Value;
|
||||||
pub fn LLVMBuildFree(B: &'a Builder, PointerVal: &'a Value) -> &'a Value;
|
|
||||||
pub fn LLVMBuildLoad(B: &'a Builder, PointerVal: &'a Value, Name: *const c_char) -> &'a Value;
|
pub fn LLVMBuildLoad(B: &'a Builder, PointerVal: &'a Value, Name: *const c_char) -> &'a Value;
|
||||||
|
|
||||||
pub fn LLVMBuildStore(B: &'a Builder, Val: &'a Value, Ptr: &'a Value) -> &'a Value;
|
pub fn LLVMBuildStore(B: &'a Builder, Val: &'a Value, Ptr: &'a Value) -> &'a Value;
|
||||||
|
@ -990,14 +891,6 @@ extern "C" {
|
||||||
Idx: c_uint,
|
Idx: c_uint,
|
||||||
Name: *const c_char)
|
Name: *const c_char)
|
||||||
-> &'a Value;
|
-> &'a Value;
|
||||||
pub fn LLVMBuildGlobalString(B: &Builder,
|
|
||||||
Str: *const c_char,
|
|
||||||
Name: *const c_char)
|
|
||||||
-> &Value;
|
|
||||||
pub fn LLVMBuildGlobalStringPtr(B: &Builder,
|
|
||||||
Str: *const c_char,
|
|
||||||
Name: *const c_char)
|
|
||||||
-> &Value;
|
|
||||||
|
|
||||||
// Casts
|
// Casts
|
||||||
pub fn LLVMBuildTrunc(B: &'a Builder,
|
pub fn LLVMBuildTrunc(B: &'a Builder,
|
||||||
|
@ -1060,27 +953,6 @@ extern "C" {
|
||||||
DestTy: &'a Type,
|
DestTy: &'a Type,
|
||||||
Name: *const c_char)
|
Name: *const c_char)
|
||||||
-> &'a Value;
|
-> &'a Value;
|
||||||
pub fn LLVMBuildZExtOrBitCast(B: &'a Builder,
|
|
||||||
Val: &'a Value,
|
|
||||||
DestTy: &'a Type,
|
|
||||||
Name: *const c_char)
|
|
||||||
-> &'a Value;
|
|
||||||
pub fn LLVMBuildSExtOrBitCast(B: &'a Builder,
|
|
||||||
Val: &'a Value,
|
|
||||||
DestTy: &'a Type,
|
|
||||||
Name: *const c_char)
|
|
||||||
-> &'a Value;
|
|
||||||
pub fn LLVMBuildTruncOrBitCast(B: &'a Builder,
|
|
||||||
Val: &'a Value,
|
|
||||||
DestTy: &'a Type,
|
|
||||||
Name: *const c_char)
|
|
||||||
-> &'a Value;
|
|
||||||
pub fn LLVMBuildCast(B: &'a Builder,
|
|
||||||
Op: Opcode,
|
|
||||||
Val: &'a Value,
|
|
||||||
DestTy: &'a Type,
|
|
||||||
Name: *const c_char)
|
|
||||||
-> &'a Value;
|
|
||||||
pub fn LLVMBuildPointerCast(B: &'a Builder,
|
pub fn LLVMBuildPointerCast(B: &'a Builder,
|
||||||
Val: &'a Value,
|
Val: &'a Value,
|
||||||
DestTy: &'a Type,
|
DestTy: &'a Type,
|
||||||
|
@ -1091,11 +963,6 @@ extern "C" {
|
||||||
DestTy: &'a Type,
|
DestTy: &'a Type,
|
||||||
IsSized: bool)
|
IsSized: bool)
|
||||||
-> &'a Value;
|
-> &'a Value;
|
||||||
pub fn LLVMBuildFPCast(B: &'a Builder,
|
|
||||||
Val: &'a Value,
|
|
||||||
DestTy: &'a Type,
|
|
||||||
Name: *const c_char)
|
|
||||||
-> &'a Value;
|
|
||||||
|
|
||||||
// Comparisons
|
// Comparisons
|
||||||
pub fn LLVMBuildICmp(B: &'a Builder,
|
pub fn LLVMBuildICmp(B: &'a Builder,
|
||||||
|
@ -1203,14 +1070,6 @@ extern "C" {
|
||||||
pub fn LLVMRustBuildMinNum(B: &'a Builder, LHS: &'a Value, LHS: &'a Value) -> Option<&'a Value>;
|
pub fn LLVMRustBuildMinNum(B: &'a Builder, LHS: &'a Value, LHS: &'a Value) -> Option<&'a Value>;
|
||||||
pub fn LLVMRustBuildMaxNum(B: &'a Builder, LHS: &'a Value, LHS: &'a Value) -> Option<&'a Value>;
|
pub fn LLVMRustBuildMaxNum(B: &'a Builder, LHS: &'a Value, LHS: &'a Value) -> Option<&'a Value>;
|
||||||
|
|
||||||
pub fn LLVMBuildIsNull(B: &'a Builder, Val: &'a Value, Name: *const c_char) -> &'a Value;
|
|
||||||
pub fn LLVMBuildIsNotNull(B: &'a Builder, Val: &'a Value, Name: *const c_char) -> &'a Value;
|
|
||||||
pub fn LLVMBuildPtrDiff(B: &'a Builder,
|
|
||||||
LHS: &'a Value,
|
|
||||||
RHS: &'a Value,
|
|
||||||
Name: *const c_char)
|
|
||||||
-> &'a Value;
|
|
||||||
|
|
||||||
// Atomic Operations
|
// Atomic Operations
|
||||||
pub fn LLVMRustBuildAtomicLoad(B: &'a Builder,
|
pub fn LLVMRustBuildAtomicLoad(B: &'a Builder,
|
||||||
PointerVal: &'a Value,
|
PointerVal: &'a Value,
|
||||||
|
@ -1245,11 +1104,6 @@ extern "C" {
|
||||||
Order: AtomicOrdering,
|
Order: AtomicOrdering,
|
||||||
Scope: SynchronizationScope);
|
Scope: SynchronizationScope);
|
||||||
|
|
||||||
|
|
||||||
// Selected entries from the downcasts.
|
|
||||||
pub fn LLVMIsATerminatorInst(Inst: &Value) -> &Value;
|
|
||||||
pub fn LLVMIsAStoreInst(Inst: &Value) -> &Value;
|
|
||||||
|
|
||||||
/// Writes a module to the specified path. Returns 0 on success.
|
/// Writes a module to the specified path. Returns 0 on success.
|
||||||
pub fn LLVMWriteBitcodeToFile(M: &Module, Path: *const c_char) -> c_int;
|
pub fn LLVMWriteBitcodeToFile(M: &Module, Path: *const c_char) -> c_int;
|
||||||
|
|
||||||
|
@ -1472,13 +1326,6 @@ extern "C" {
|
||||||
Subscripts: &'a DIArray)
|
Subscripts: &'a DIArray)
|
||||||
-> &'a DIType;
|
-> &'a DIType;
|
||||||
|
|
||||||
pub fn LLVMRustDIBuilderCreateVectorType(Builder: &'a DIBuilder,
|
|
||||||
Size: u64,
|
|
||||||
AlignInBits: u32,
|
|
||||||
Ty: &'a DIType,
|
|
||||||
Subscripts: &'a DIArray)
|
|
||||||
-> &'a DIType;
|
|
||||||
|
|
||||||
pub fn LLVMRustDIBuilderGetOrCreateSubrange(Builder: &DIBuilder,
|
pub fn LLVMRustDIBuilderGetOrCreateSubrange(Builder: &DIBuilder,
|
||||||
Lo: i64,
|
Lo: i64,
|
||||||
Count: i64)
|
Count: i64)
|
||||||
|
@ -1696,9 +1543,6 @@ extern "C" {
|
||||||
|
|
||||||
pub fn LLVMRustThinLTOAvailable() -> bool;
|
pub fn LLVMRustThinLTOAvailable() -> bool;
|
||||||
pub fn LLVMRustPGOAvailable() -> bool;
|
pub fn LLVMRustPGOAvailable() -> bool;
|
||||||
pub fn LLVMRustWriteThinBitcodeToFile(PMR: PassManagerRef,
|
|
||||||
M: &Module,
|
|
||||||
BC: *const c_char) -> bool;
|
|
||||||
pub fn LLVMRustThinLTOBufferCreate(M: &Module) -> *mut ThinLTOBuffer;
|
pub fn LLVMRustThinLTOBufferCreate(M: &Module) -> *mut ThinLTOBuffer;
|
||||||
pub fn LLVMRustThinLTOBufferFree(M: *mut ThinLTOBuffer);
|
pub fn LLVMRustThinLTOBufferFree(M: *mut ThinLTOBuffer);
|
||||||
pub fn LLVMRustThinLTOBufferPtr(M: *const ThinLTOBuffer) -> *const c_char;
|
pub fn LLVMRustThinLTOBufferPtr(M: *const ThinLTOBuffer) -> *const c_char;
|
||||||
|
@ -1732,7 +1576,6 @@ extern "C" {
|
||||||
len: usize,
|
len: usize,
|
||||||
Identifier: *const c_char,
|
Identifier: *const c_char,
|
||||||
) -> Option<&Module>;
|
) -> Option<&Module>;
|
||||||
pub fn LLVMGetModuleIdentifier(M: &Module, size: *mut usize) -> *const c_char;
|
|
||||||
pub fn LLVMRustThinLTOGetDICompileUnit(M: &Module,
|
pub fn LLVMRustThinLTOGetDICompileUnit(M: &Module,
|
||||||
CU1: *mut *mut c_void,
|
CU1: *mut *mut c_void,
|
||||||
CU2: *mut *mut c_void);
|
CU2: *mut *mut c_void);
|
||||||
|
|
|
@ -828,23 +828,6 @@ LLVMRustPGOAvailable() {
|
||||||
// and various online resources about ThinLTO to make heads or tails of all
|
// and various online resources about ThinLTO to make heads or tails of all
|
||||||
// this.
|
// this.
|
||||||
|
|
||||||
extern "C" bool
|
|
||||||
LLVMRustWriteThinBitcodeToFile(LLVMPassManagerRef PMR,
|
|
||||||
LLVMModuleRef M,
|
|
||||||
const char *BcFile) {
|
|
||||||
llvm::legacy::PassManager *PM = unwrap<llvm::legacy::PassManager>(PMR);
|
|
||||||
std::error_code EC;
|
|
||||||
llvm::raw_fd_ostream bc(BcFile, EC, llvm::sys::fs::F_None);
|
|
||||||
if (EC) {
|
|
||||||
LLVMRustSetLastError(EC.message().c_str());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
PM->add(createWriteThinLTOBitcodePass(bc));
|
|
||||||
PM->run(*unwrap(M));
|
|
||||||
delete PM;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// This is a shared data structure which *must* be threadsafe to share
|
// This is a shared data structure which *must* be threadsafe to share
|
||||||
// read-only amongst threads. This also corresponds basically to the arguments
|
// read-only amongst threads. This also corresponds basically to the arguments
|
||||||
// of the `ProcessThinLTOModule` function in the LLVM source.
|
// of the `ProcessThinLTOModule` function in the LLVM source.
|
||||||
|
@ -1259,13 +1242,6 @@ LLVMRustThinLTOPatchDICompileUnit(LLVMModuleRef Mod, DICompileUnit *Unit) {
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
extern "C" bool
|
|
||||||
LLVMRustWriteThinBitcodeToFile(LLVMPassManagerRef PMR,
|
|
||||||
LLVMModuleRef M,
|
|
||||||
const char *BcFile) {
|
|
||||||
report_fatal_error("ThinLTO not available");
|
|
||||||
}
|
|
||||||
|
|
||||||
struct LLVMRustThinLTOData {
|
struct LLVMRustThinLTOData {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -750,15 +750,6 @@ LLVMRustDIBuilderCreateArrayType(LLVMRustDIBuilderRef Builder, uint64_t Size,
|
||||||
DINodeArray(unwrapDI<MDTuple>(Subscripts))));
|
DINodeArray(unwrapDI<MDTuple>(Subscripts))));
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" LLVMMetadataRef
|
|
||||||
LLVMRustDIBuilderCreateVectorType(LLVMRustDIBuilderRef Builder, uint64_t Size,
|
|
||||||
uint32_t AlignInBits, LLVMMetadataRef Ty,
|
|
||||||
LLVMMetadataRef Subscripts) {
|
|
||||||
return wrap(
|
|
||||||
Builder->createVectorType(Size, AlignInBits, unwrapDI<DIType>(Ty),
|
|
||||||
DINodeArray(unwrapDI<MDTuple>(Subscripts))));
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" LLVMMetadataRef
|
extern "C" LLVMMetadataRef
|
||||||
LLVMRustDIBuilderGetOrCreateSubrange(LLVMRustDIBuilderRef Builder, int64_t Lo,
|
LLVMRustDIBuilderGetOrCreateSubrange(LLVMRustDIBuilderRef Builder, int64_t Lo,
|
||||||
int64_t Count) {
|
int64_t Count) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue