// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![allow(dead_code)] // FFI wrappers
-
use llvm::{AtomicRmwBinOp, AtomicOrdering, SynchronizationScope, AsmDialect};
-use llvm::{Opcode, IntPredicate, RealPredicate, False, OperandBundleDef};
+use llvm::{IntPredicate, RealPredicate, False, OperandBundleDef};
use llvm::{self, BasicBlock};
use common::*;
use type_::Type;
use std::ops::Range;
use std::ptr;
use std::ptr::NonNull;
-use syntax_pos::Span;
// All Builders must have an llfn associated with them
#[must_use]
}
}
- pub fn position_before(&self, insn: &'ll Value) {
- unsafe {
- llvm::LLVMPositionBuilderBefore(self.llbuilder, insn);
- }
- }
-
pub fn position_at_end(&self, llbb: &'ll BasicBlock) {
unsafe {
llvm::LLVMPositionBuilderAtEnd(self.llbuilder, llbb);
}
}
- 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) {
self.count_insn("br");
unsafe {
}
}
- 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,
llfn: &'ll Value,
args: &[&'ll Value],
}
}
- 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 {
self.count_insn("fadd");
unsafe {
}
}
- 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 {
self.count_insn("fsub");
unsafe {
}
}
- 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 {
self.count_insn("fmul");
unsafe {
}
}
- 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 {
self.count_insn("neg");
unsafe {
}
}
- 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 {
self.count_insn("fneg");
unsafe {
}
}
- 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 {
self.count_insn("load");
unsafe {
}
}
- 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 */
pub fn trunc(&self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value {
self.count_insn("trunc");
}
}
- 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 {
self.count_insn("pointercast");
unsafe {
}
}
- 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 */
pub fn icmp(&self, op: IntPredicate, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
self.count_insn("icmp");
}
}
- 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,
inputs: &[&'ll Value], output: &'ll Type,
volatile: bool, alignstack: bool,
}
}
+ #[allow(dead_code)]
pub fn va_arg(&self, list: &'ll Value, ty: &'ll Type) -> &'ll Value {
self.count_insn("vaarg");
unsafe {
}
}
- 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,
num_clauses: usize) -> &'ll Value {
self.count_insn("landingpad");
};
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 super::RustStringRef;
-pub type Opcode = u32;
pub type Bool = c_uint;
pub const True: Bool = 1 as Bool;
#[derive(Copy, Clone, PartialEq)]
#[repr(C)]
+#[allow(dead_code)] // Variants constructed by C++.
pub enum LLVMRustResult {
Success,
Failure,
Protected = 2,
}
-/// LLVMDiagnosticSeverity
-#[derive(Copy, Clone, Debug)]
-#[repr(C)]
-pub enum DiagnosticSeverity {
- Error = 0,
- Warning = 1,
- Remark = 2,
- Note = 3,
-}
-
/// LLVMDLLStorageClass
#[derive(Copy, Clone)]
#[repr(C)]
pub enum DLLStorageClass {
+ #[allow(dead_code)]
Default = 0,
DllImport = 1, // Function to be imported from DLL.
+ #[allow(dead_code)]
DllExport = 2, // Function to be accessible from DLL.
}
#[derive(Copy, Clone)]
#[repr(C)]
pub enum AtomicOrdering {
+ #[allow(dead_code)]
NotAtomic = 0,
Unordered = 1,
Monotonic = 2,
#[derive(Copy, Clone)]
#[repr(C)]
pub enum SynchronizationScope {
+ // FIXME: figure out if this variant is needed at all.
+ #[allow(dead_code)]
Other,
SingleThread,
CrossThread,
#[derive(Copy, Clone)]
#[repr(C)]
pub enum FileType {
+ // FIXME: figure out if this variant is needed at all.
+ #[allow(dead_code)]
Other,
AssemblyFile,
ObjectFile,
#[derive(Copy, Clone)]
#[repr(C)]
pub enum AsmDialect {
+ // FIXME: figure out if this variant is needed at all.
+ #[allow(dead_code)]
Other,
Att,
Intel,
#[derive(Copy, Clone, PartialEq)]
#[repr(C)]
pub enum CodeGenOptLevel {
+ // FIXME: figure out if this variant is needed at all.
+ #[allow(dead_code)]
Other,
None,
Less,
#[derive(Copy, Clone)]
#[repr(C)]
pub enum CodeModel {
+ // FIXME: figure out if this variant is needed at all.
+ #[allow(dead_code)]
Other,
Small,
Kernel,
/// LLVMRustDiagnosticKind
#[derive(Copy, Clone)]
#[repr(C)]
+#[allow(dead_code)] // Variants constructed by C++.
pub enum DiagnosticKind {
Other,
InlineAsm,
#[derive(Copy, Clone)]
#[repr(C)]
pub enum ArchiveKind {
+ // FIXME: figure out if this variant is needed at all.
+ #[allow(dead_code)]
Other,
K_GNU,
K_BSD,
/// LLVMRustPassKind
#[derive(Copy, Clone, PartialEq, Debug)]
#[repr(C)]
+#[allow(dead_code)] // Variants constructed by C++.
pub enum PassKind {
Other,
Function,
pub type TwineRef = *mut Twine;
extern { pub type DiagnosticInfo; }
pub type DiagnosticInfoRef = *mut DiagnosticInfo;
-extern { pub type DebugLoc; }
-pub type DebugLocRef = *mut DebugLoc;
extern { pub type SMDiagnostic; }
pub type SMDiagnosticRef = *mut SMDiagnostic;
extern { pub type RustArchiveMember; }
pub fn LLVMGetDataLayout(M: &Module) -> *const c_char;
pub fn LLVMSetDataLayout(M: &Module, Triple: *const c_char);
- /// See Module::dump.
- pub fn LLVMDumpModule(M: &Module);
-
/// See Module::setModuleInlineAsm.
pub fn LLVMSetModuleInlineAsm(M: &Module, Asm: *const c_char);
pub fn LLVMRustAppendModuleInlineAsm(M: &Module, Asm: *const c_char);
ParamCount: c_uint,
IsVarArg: Bool)
-> &'a Type;
- pub fn LLVMGetReturnType(FunctionTy: &Type) -> &Type;
pub fn LLVMCountParamTypes(FunctionTy: &Type) -> c_uint;
pub fn LLVMGetParamTypes(FunctionTy: &'a Type, Dest: *mut &'a Type);
ElementCount: c_uint,
Packed: Bool)
-> &'a Type;
- pub fn LLVMIsPackedStruct(StructTy: &Type) -> Bool;
// Operations on array, pointer, and vector types (sequence types)
pub fn LLVMRustArrayType(ElementType: &Type, ElementCount: u64) -> &Type;
pub fn LLVMReplaceAllUsesWith(OldVal: &'a Value, NewVal: &'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
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;
// Operations on metadata
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 LLVMConstIntGetZExtValue(ConstantVal: &Value) -> c_ulonglong;
- pub fn LLVMConstIntGetSExtValue(ConstantVal: &Value) -> c_longlong;
pub fn LLVMRustConstInt128Get(ConstantVal: &Value, SExt: bool,
high: *mut u64, low: *mut u64) -> bool;
pub fn LLVMConstRealGetDouble (ConstantVal: &Value, losesInfo: *mut Bool) -> f64;
pub fn LLVMConstVector(ScalarConstantVals: *const &Value, Size: c_uint) -> &Value;
// 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(
ConstantVal: &'a Value,
ConstantIndices: *const &'a Value,
NumIndices: c_uint,
) -> &'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 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 LLVMConstIntToPtr(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 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,
IdxList: *const c_uint,
NumIdx: c_uint)
-> &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)
pub fn LLVMIsDeclaration(Global: &Value) -> Bool;
pub fn LLVMRustGetLinkage(Global: &Value) -> 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 LLVMRustGetVisibility(Global: &Value) -> Visibility;
pub fn LLVMRustSetVisibility(Global: &Value, Viz: Visibility);
pub fn LLVMSetTailCall(CallInst: &Value, IsTailCall: Bool);
// 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,
Name: *const c_char,
FunctionTy: &'a Type)
pub fn LLVMGetParam(Fn: &Value, Index: c_uint) -> &Value;
// Operations on basic blocks
- pub fn LLVMBasicBlockAsValue(BB: &BasicBlock) -> &Value;
pub fn LLVMGetBasicBlockParent(BB: &BasicBlock) -> &Value;
pub fn LLVMAppendBasicBlockInContext(C: &'a Context,
Fn: &'a Value,
pub fn LLVMDeleteBasicBlock(BB: &BasicBlock);
// Operations on instructions
- pub fn LLVMGetInstructionParent(Inst: &Value) -> &BasicBlock;
pub fn LLVMGetFirstBasicBlock(Fn: &Value) -> &BasicBlock;
- pub fn LLVMGetFirstInstruction(BB: &BasicBlock) -> &'a Value;
- pub fn LLVMInstructionEraseFromParent(Inst: &Value);
// Operations on call sites
pub fn LLVMSetInstructionCallConv(Instr: &Value, CC: c_uint);
// Instruction builders
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 LLVMGetInsertBlock(Builder: &Builder) -> &BasicBlock;
pub fn LLVMDisposeBuilder(Builder: &Builder);
// Terminators
pub fn LLVMBuildRetVoid(B: &Builder) -> &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 LLVMBuildCondBr(B: &'a Builder,
If: &'a Value,
Else: &'a BasicBlock,
NumCases: c_uint)
-> &'a Value;
- pub fn LLVMBuildIndirectBr(B: &'a Builder, Addr: &'a Value, NumDests: c_uint) -> &'a Value;
pub fn LLVMRustBuildInvoke(B: &'a Builder,
Fn: &'a Value,
Args: *const &'a Value,
RHS: &'a Value,
Name: *const c_char)
-> &'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,
LHS: &'a Value,
RHS: &'a Value,
RHS: &'a Value,
Name: *const c_char)
-> &'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,
LHS: &'a Value,
RHS: &'a Value,
RHS: &'a Value,
Name: *const c_char)
-> &'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,
LHS: &'a Value,
RHS: &'a Value,
RHS: &'a Value,
Name: *const c_char)
-> &'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 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 LLVMBuildNot(B: &'a Builder, V: &'a Value, Name: *const c_char) -> &'a Value;
pub fn LLVMRustSetHasUnsafeAlgebra(Instr: &Value);
// Memory
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 LLVMBuildStore(B: &'a Builder, Val: &'a Value, Ptr: &'a Value) -> &'a Value;
Idx: c_uint,
Name: *const c_char)
-> &'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
pub fn LLVMBuildTrunc(B: &'a Builder,
DestTy: &'a Type,
Name: *const c_char)
-> &'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,
Val: &'a Value,
DestTy: &'a Type,
DestTy: &'a Type,
IsSized: bool)
-> &'a Value;
- pub fn LLVMBuildFPCast(B: &'a Builder,
- Val: &'a Value,
- DestTy: &'a Type,
- Name: *const c_char)
- -> &'a Value;
// Comparisons
pub fn LLVMBuildICmp(B: &'a Builder,
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 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
pub fn LLVMRustBuildAtomicLoad(B: &'a Builder,
PointerVal: &'a Value,
Order: AtomicOrdering,
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.
pub fn LLVMWriteBitcodeToFile(M: &Module, Path: *const c_char) -> c_int;
Subscripts: &'a DIArray)
-> &'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,
Lo: i64,
Count: i64)
pub fn LLVMRustThinLTOAvailable() -> 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 LLVMRustThinLTOBufferFree(M: *mut ThinLTOBuffer);
pub fn LLVMRustThinLTOBufferPtr(M: *const ThinLTOBuffer) -> *const c_char;
len: usize,
Identifier: *const c_char,
) -> Option<&Module>;
- pub fn LLVMGetModuleIdentifier(M: &Module, size: *mut usize) -> *const c_char;
pub fn LLVMRustThinLTOGetDICompileUnit(M: &Module,
CU1: *mut *mut c_void,
CU2: *mut *mut c_void);