Remove unused functions from rustc_llvm

This commit is contained in:
Robin Kruppe 2016-11-28 17:31:42 +01:00
parent 0b399e5e99
commit 6e35cc94de

View File

@ -486,10 +486,6 @@ extern "C" {
pub fn LLVMGetDataLayout(M: ModuleRef) -> *const c_char;
pub fn LLVMSetDataLayout(M: ModuleRef, Triple: *const c_char);
/// Target triple. See Module::getTargetTriple.
pub fn LLVMGetTarget(M: ModuleRef) -> *const c_char;
pub fn LLVMSetTarget(M: ModuleRef, Triple: *const c_char);
/// See Module::dump.
pub fn LLVMDumpModule(M: ModuleRef);
@ -499,9 +495,6 @@ extern "C" {
/// See llvm::LLVMTypeKind::getTypeID.
pub fn LLVMRustGetTypeKind(Ty: TypeRef) -> TypeKind;
/// See llvm::LLVMType::getContext.
pub fn LLVMGetTypeContext(Ty: TypeRef) -> ContextRef;
/// See llvm::Value::getContext
pub fn LLVMRustGetValueContext(V: ValueRef) -> ContextRef;
@ -518,9 +511,6 @@ extern "C" {
// Operations on real types
pub fn LLVMFloatTypeInContext(C: ContextRef) -> TypeRef;
pub fn LLVMDoubleTypeInContext(C: ContextRef) -> TypeRef;
pub fn LLVMX86FP80TypeInContext(C: ContextRef) -> TypeRef;
pub fn LLVMFP128TypeInContext(C: ContextRef) -> TypeRef;
pub fn LLVMPPCFP128TypeInContext(C: ContextRef) -> TypeRef;
// Operations on function types
pub fn LLVMFunctionType(ReturnType: TypeRef,
@ -528,7 +518,6 @@ extern "C" {
ParamCount: c_uint,
IsVarArg: Bool)
-> TypeRef;
pub fn LLVMIsFunctionVarArg(FunctionTy: TypeRef) -> Bool;
pub fn LLVMGetReturnType(FunctionTy: TypeRef) -> TypeRef;
pub fn LLVMCountParamTypes(FunctionTy: TypeRef) -> c_uint;
pub fn LLVMGetParamTypes(FunctionTy: TypeRef, Dest: *mut TypeRef);
@ -550,20 +539,16 @@ extern "C" {
pub fn LLVMGetElementType(Ty: TypeRef) -> TypeRef;
pub fn LLVMGetArrayLength(ArrayTy: TypeRef) -> c_uint;
pub fn LLVMGetPointerAddressSpace(PointerTy: TypeRef) -> c_uint;
pub fn LLVMGetPointerToGlobal(EE: ExecutionEngineRef, V: ValueRef) -> *const c_void;
pub fn LLVMGetVectorSize(VectorTy: TypeRef) -> c_uint;
// Operations on other types
pub fn LLVMVoidTypeInContext(C: ContextRef) -> TypeRef;
pub fn LLVMLabelTypeInContext(C: ContextRef) -> TypeRef;
pub fn LLVMRustMetadataTypeInContext(C: ContextRef) -> TypeRef;
// Operations on all values
pub fn LLVMTypeOf(Val: ValueRef) -> TypeRef;
pub fn LLVMGetValueName(Val: ValueRef) -> *const c_char;
pub fn LLVMSetValueName(Val: ValueRef, Name: *const c_char);
pub fn LLVMDumpValue(Val: ValueRef);
pub fn LLVMReplaceAllUsesWith(OldVal: ValueRef, NewVal: ValueRef);
pub fn LLVMSetMetadata(Val: ValueRef, KindID: c_uint, Node: ValueRef);
@ -571,45 +556,25 @@ extern "C" {
pub fn LLVMGetFirstUse(Val: ValueRef) -> UseRef;
pub fn LLVMGetNextUse(U: UseRef) -> UseRef;
pub fn LLVMGetUser(U: UseRef) -> ValueRef;
pub fn LLVMGetUsedValue(U: UseRef) -> ValueRef;
// Operations on Users
pub fn LLVMGetNumOperands(Val: ValueRef) -> c_int;
pub fn LLVMGetOperand(Val: ValueRef, Index: c_uint) -> ValueRef;
pub fn LLVMSetOperand(Val: ValueRef, Index: c_uint, Op: ValueRef);
// Operations on constants of any type
pub fn LLVMConstNull(Ty: TypeRef) -> ValueRef;
// all zeroes
pub fn LLVMConstAllOnes(Ty: TypeRef) -> ValueRef;
pub fn LLVMConstICmp(Pred: IntPredicate, V1: ValueRef, V2: ValueRef) -> ValueRef;
pub fn LLVMConstFCmp(Pred: RealPredicate, V1: ValueRef, V2: ValueRef) -> ValueRef;
// only for isize/vector
pub fn LLVMGetUndef(Ty: TypeRef) -> ValueRef;
pub fn LLVMIsConstant(Val: ValueRef) -> Bool;
pub fn LLVMIsNull(Val: ValueRef) -> Bool;
pub fn LLVMIsUndef(Val: ValueRef) -> Bool;
pub fn LLVMConstPointerNull(Ty: TypeRef) -> ValueRef;
// Operations on metadata
pub fn LLVMMDStringInContext(C: ContextRef, Str: *const c_char, SLen: c_uint) -> ValueRef;
pub fn LLVMMDNodeInContext(C: ContextRef, Vals: *const ValueRef, Count: c_uint) -> ValueRef;
pub fn LLVMAddNamedMetadataOperand(M: ModuleRef, Str: *const c_char, Val: ValueRef);
// Operations on scalar constants
pub fn LLVMConstInt(IntTy: TypeRef, N: c_ulonglong, SignExtend: Bool) -> ValueRef;
pub fn LLVMConstIntOfString(IntTy: TypeRef, Text: *const c_char, Radix: u8) -> ValueRef;
pub fn LLVMConstIntOfStringAndSize(IntTy: TypeRef,
Text: *const c_char,
SLen: c_uint,
Radix: u8)
-> ValueRef;
pub fn LLVMConstReal(RealTy: TypeRef, N: f64) -> ValueRef;
pub fn LLVMConstRealOfString(RealTy: TypeRef, Text: *const c_char) -> ValueRef;
pub fn LLVMConstRealOfStringAndSize(RealTy: TypeRef,
Text: *const c_char,
SLen: c_uint)
-> ValueRef;
pub fn LLVMConstIntGetZExtValue(ConstantVal: ValueRef) -> c_ulonglong;
pub fn LLVMConstIntGetSExtValue(ConstantVal: ValueRef) -> c_longlong;
@ -633,28 +598,18 @@ extern "C" {
pub fn LLVMConstVector(ScalarConstantVals: *const ValueRef, Size: c_uint) -> ValueRef;
// Constant expressions
pub fn LLVMAlignOf(Ty: TypeRef) -> ValueRef;
pub fn LLVMSizeOf(Ty: TypeRef) -> ValueRef;
pub fn LLVMConstNeg(ConstantVal: ValueRef) -> ValueRef;
pub fn LLVMConstNSWNeg(ConstantVal: ValueRef) -> ValueRef;
pub fn LLVMConstNUWNeg(ConstantVal: ValueRef) -> ValueRef;
pub fn LLVMConstFNeg(ConstantVal: ValueRef) -> ValueRef;
pub fn LLVMConstNot(ConstantVal: ValueRef) -> ValueRef;
pub fn LLVMConstAdd(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
pub fn LLVMConstNSWAdd(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
pub fn LLVMConstNUWAdd(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
pub fn LLVMConstFAdd(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
pub fn LLVMConstSub(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
pub fn LLVMConstNSWSub(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
pub fn LLVMConstNUWSub(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
pub fn LLVMConstFSub(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
pub fn LLVMConstMul(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
pub fn LLVMConstNSWMul(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
pub fn LLVMConstNUWMul(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
pub fn LLVMConstFMul(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
pub fn LLVMConstUDiv(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
pub fn LLVMConstSDiv(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
pub fn LLVMConstExactSDiv(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
pub fn LLVMConstFDiv(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
pub fn LLVMConstURem(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
pub fn LLVMConstSRem(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
@ -665,19 +620,8 @@ extern "C" {
pub fn LLVMConstShl(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
pub fn LLVMConstLShr(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
pub fn LLVMConstAShr(LHSConstant: ValueRef, RHSConstant: ValueRef) -> ValueRef;
pub fn LLVMConstGEP(ConstantVal: ValueRef,
ConstantIndices: *const ValueRef,
NumIndices: c_uint)
-> ValueRef;
pub fn LLVMConstInBoundsGEP(ConstantVal: ValueRef,
ConstantIndices: *const ValueRef,
NumIndices: c_uint)
-> ValueRef;
pub fn LLVMConstTrunc(ConstantVal: ValueRef, ToType: TypeRef) -> ValueRef;
pub fn LLVMConstSExt(ConstantVal: ValueRef, ToType: TypeRef) -> ValueRef;
pub fn LLVMConstZExt(ConstantVal: ValueRef, ToType: TypeRef) -> ValueRef;
pub fn LLVMConstFPTrunc(ConstantVal: ValueRef, ToType: TypeRef) -> ValueRef;
pub fn LLVMConstFPExt(ConstantVal: ValueRef, ToType: TypeRef) -> ValueRef;
pub fn LLVMConstUIToFP(ConstantVal: ValueRef, ToType: TypeRef) -> ValueRef;
pub fn LLVMConstSIToFP(ConstantVal: ValueRef, ToType: TypeRef) -> ValueRef;
pub fn LLVMConstFPToUI(ConstantVal: ValueRef, ToType: TypeRef) -> ValueRef;
@ -685,42 +629,19 @@ extern "C" {
pub fn LLVMConstPtrToInt(ConstantVal: ValueRef, ToType: TypeRef) -> ValueRef;
pub fn LLVMConstIntToPtr(ConstantVal: ValueRef, ToType: TypeRef) -> ValueRef;
pub fn LLVMConstBitCast(ConstantVal: ValueRef, ToType: TypeRef) -> ValueRef;
pub fn LLVMConstZExtOrBitCast(ConstantVal: ValueRef, ToType: TypeRef) -> ValueRef;
pub fn LLVMConstSExtOrBitCast(ConstantVal: ValueRef, ToType: TypeRef) -> ValueRef;
pub fn LLVMConstTruncOrBitCast(ConstantVal: ValueRef, ToType: TypeRef) -> ValueRef;
pub fn LLVMConstPointerCast(ConstantVal: ValueRef, ToType: TypeRef) -> ValueRef;
pub fn LLVMConstIntCast(ConstantVal: ValueRef, ToType: TypeRef, isSigned: Bool) -> ValueRef;
pub fn LLVMConstFPCast(ConstantVal: ValueRef, ToType: TypeRef) -> ValueRef;
pub fn LLVMConstSelect(ConstantCondition: ValueRef,
ConstantIfTrue: ValueRef,
ConstantIfFalse: ValueRef)
-> ValueRef;
pub fn LLVMConstExtractElement(VectorConstant: ValueRef, IndexConstant: ValueRef) -> ValueRef;
pub fn LLVMConstInsertElement(VectorConstant: ValueRef,
ElementValueConstant: ValueRef,
IndexConstant: ValueRef)
-> ValueRef;
pub fn LLVMConstShuffleVector(VectorAConstant: ValueRef,
VectorBConstant: ValueRef,
MaskConstant: ValueRef)
-> ValueRef;
pub fn LLVMConstExtractValue(AggConstant: ValueRef,
IdxList: *const c_uint,
NumIdx: c_uint)
-> ValueRef;
pub fn LLVMConstInsertValue(AggConstant: ValueRef,
ElementValueConstant: ValueRef,
IdxList: *const c_uint,
NumIdx: c_uint)
-> ValueRef;
pub fn LLVMConstInlineAsm(Ty: TypeRef,
AsmString: *const c_char,
Constraints: *const c_char,
HasSideEffects: Bool,
IsAlignStack: Bool)
-> ValueRef;
pub fn LLVMBlockAddress(F: ValueRef, BB: BasicBlockRef) -> ValueRef;
// Operations on global variables, functions, and aliases (globals)
@ -730,7 +651,6 @@ extern "C" {
pub fn LLVMRustSetLinkage(Global: ValueRef, RustLinkage: Linkage);
pub fn LLVMGetSection(Global: ValueRef) -> *const c_char;
pub fn LLVMSetSection(Global: ValueRef, Section: *const c_char);
pub fn LLVMGetVisibility(Global: ValueRef) -> Visibility;
pub fn LLVMSetVisibility(Global: ValueRef, Viz: Visibility);
pub fn LLVMGetAlignment(Global: ValueRef) -> c_uint;
pub fn LLVMSetAlignment(Global: ValueRef, Bytes: c_uint);
@ -740,50 +660,28 @@ extern "C" {
// Operations on global variables
pub fn LLVMIsAGlobalVariable(GlobalVar: ValueRef) -> ValueRef;
pub fn LLVMAddGlobal(M: ModuleRef, Ty: TypeRef, Name: *const c_char) -> ValueRef;
pub fn LLVMAddGlobalInAddressSpace(M: ModuleRef,
Ty: TypeRef,
Name: *const c_char,
AddressSpace: c_uint)
-> ValueRef;
pub fn LLVMGetNamedGlobal(M: ModuleRef, Name: *const c_char) -> ValueRef;
pub fn LLVMRustGetOrInsertGlobal(M: ModuleRef, Name: *const c_char, T: TypeRef) -> ValueRef;
pub fn LLVMGetFirstGlobal(M: ModuleRef) -> ValueRef;
pub fn LLVMGetLastGlobal(M: ModuleRef) -> ValueRef;
pub fn LLVMGetNextGlobal(GlobalVar: ValueRef) -> ValueRef;
pub fn LLVMGetPreviousGlobal(GlobalVar: ValueRef) -> ValueRef;
pub fn LLVMDeleteGlobal(GlobalVar: ValueRef);
pub fn LLVMGetInitializer(GlobalVar: ValueRef) -> ValueRef;
pub fn LLVMSetInitializer(GlobalVar: ValueRef, ConstantVal: ValueRef);
pub fn LLVMIsThreadLocal(GlobalVar: ValueRef) -> Bool;
pub fn LLVMSetThreadLocal(GlobalVar: ValueRef, IsThreadLocal: Bool);
pub fn LLVMIsGlobalConstant(GlobalVar: ValueRef) -> Bool;
pub fn LLVMSetGlobalConstant(GlobalVar: ValueRef, IsConstant: Bool);
pub fn LLVMRustGetNamedValue(M: ModuleRef, Name: *const c_char) -> ValueRef;
// Operations on aliases
pub fn LLVMAddAlias(M: ModuleRef,
Ty: TypeRef,
Aliasee: ValueRef,
Name: *const c_char)
-> ValueRef;
// Operations on functions
pub fn LLVMAddFunction(M: ModuleRef, Name: *const c_char, FunctionTy: TypeRef) -> ValueRef;
pub fn LLVMGetNamedFunction(M: ModuleRef, Name: *const c_char) -> ValueRef;
pub fn LLVMGetFirstFunction(M: ModuleRef) -> ValueRef;
pub fn LLVMGetLastFunction(M: ModuleRef) -> ValueRef;
pub fn LLVMGetNextFunction(Fn: ValueRef) -> ValueRef;
pub fn LLVMGetPreviousFunction(Fn: ValueRef) -> ValueRef;
pub fn LLVMDeleteFunction(Fn: ValueRef);
pub fn LLVMRustGetOrInsertFunction(M: ModuleRef,
Name: *const c_char,
FunctionTy: TypeRef)
-> ValueRef;
pub fn LLVMGetIntrinsicID(Fn: ValueRef) -> c_uint;
pub fn LLVMGetFunctionCallConv(Fn: ValueRef) -> c_uint;
pub fn LLVMSetFunctionCallConv(Fn: ValueRef, CC: c_uint);
pub fn LLVMGetGC(Fn: ValueRef) -> *const c_char;
pub fn LLVMSetGC(Fn: ValueRef, Name: *const c_char);
pub fn LLVMRustAddDereferenceableAttr(Fn: ValueRef, index: c_uint, bytes: u64);
pub fn LLVMRustAddFunctionAttribute(Fn: ValueRef, index: c_uint, attr: Attribute);
pub fn LLVMRustAddFunctionAttrStringValue(Fn: ValueRef,
@ -794,65 +692,28 @@ extern "C" {
// Operations on parameters
pub fn LLVMCountParams(Fn: ValueRef) -> c_uint;
pub fn LLVMGetParams(Fn: ValueRef, Params: *const ValueRef);
pub fn LLVMGetParam(Fn: ValueRef, Index: c_uint) -> ValueRef;
pub fn LLVMGetParamParent(Inst: ValueRef) -> ValueRef;
pub fn LLVMGetFirstParam(Fn: ValueRef) -> ValueRef;
pub fn LLVMGetLastParam(Fn: ValueRef) -> ValueRef;
pub fn LLVMGetNextParam(Arg: ValueRef) -> ValueRef;
pub fn LLVMGetPreviousParam(Arg: ValueRef) -> ValueRef;
pub fn LLVMSetParamAlignment(Arg: ValueRef, align: c_uint);
// Operations on basic blocks
pub fn LLVMBasicBlockAsValue(BB: BasicBlockRef) -> ValueRef;
pub fn LLVMValueIsBasicBlock(Val: ValueRef) -> Bool;
pub fn LLVMValueAsBasicBlock(Val: ValueRef) -> BasicBlockRef;
pub fn LLVMGetBasicBlockParent(BB: BasicBlockRef) -> ValueRef;
pub fn LLVMCountBasicBlocks(Fn: ValueRef) -> c_uint;
pub fn LLVMGetBasicBlocks(Fn: ValueRef, BasicBlocks: *const ValueRef);
pub fn LLVMGetFirstBasicBlock(Fn: ValueRef) -> BasicBlockRef;
pub fn LLVMGetLastBasicBlock(Fn: ValueRef) -> BasicBlockRef;
pub fn LLVMGetNextBasicBlock(BB: BasicBlockRef) -> BasicBlockRef;
pub fn LLVMGetPreviousBasicBlock(BB: BasicBlockRef) -> BasicBlockRef;
pub fn LLVMGetEntryBasicBlock(Fn: ValueRef) -> BasicBlockRef;
pub fn LLVMAppendBasicBlockInContext(C: ContextRef,
Fn: ValueRef,
Name: *const c_char)
-> BasicBlockRef;
pub fn LLVMInsertBasicBlockInContext(C: ContextRef,
BB: BasicBlockRef,
Name: *const c_char)
-> BasicBlockRef;
pub fn LLVMDeleteBasicBlock(BB: BasicBlockRef);
pub fn LLVMMoveBasicBlockAfter(BB: BasicBlockRef, MoveAfter: BasicBlockRef);
pub fn LLVMMoveBasicBlockBefore(BB: BasicBlockRef, MoveBefore: BasicBlockRef);
// Operations on instructions
pub fn LLVMGetInstructionParent(Inst: ValueRef) -> BasicBlockRef;
pub fn LLVMGetFirstInstruction(BB: BasicBlockRef) -> ValueRef;
pub fn LLVMGetLastInstruction(BB: BasicBlockRef) -> ValueRef;
pub fn LLVMGetNextInstruction(Inst: ValueRef) -> ValueRef;
pub fn LLVMGetPreviousInstruction(Inst: ValueRef) -> ValueRef;
pub fn LLVMInstructionEraseFromParent(Inst: ValueRef);
// Operations on call sites
pub fn LLVMSetInstructionCallConv(Instr: ValueRef, CC: c_uint);
pub fn LLVMGetInstructionCallConv(Instr: ValueRef) -> c_uint;
pub fn LLVMAddInstrAttribute(Instr: ValueRef, index: c_uint, IA: c_uint);
pub fn LLVMRemoveInstrAttribute(Instr: ValueRef, index: c_uint, IA: c_uint);
pub fn LLVMSetInstrParamAlignment(Instr: ValueRef, index: c_uint, align: c_uint);
pub fn LLVMRustAddCallSiteAttribute(Instr: ValueRef, index: c_uint, attr: Attribute);
pub fn LLVMRustAddDereferenceableCallSiteAttr(Instr: ValueRef, index: c_uint, bytes: u64);
// Operations on call instructions (only)
pub fn LLVMIsTailCall(CallInst: ValueRef) -> Bool;
pub fn LLVMSetTailCall(CallInst: ValueRef, IsTailCall: Bool);
// Operations on load/store instructions (only)
pub fn LLVMGetVolatile(MemoryAccessInst: ValueRef) -> Bool;
pub fn LLVMSetVolatile(MemoryAccessInst: ValueRef, volatile: Bool);
// Operations on phi nodes
@ -860,9 +721,6 @@ extern "C" {
IncomingValues: *const ValueRef,
IncomingBlocks: *const BasicBlockRef,
Count: c_uint);
pub fn LLVMCountIncoming(PhiNode: ValueRef) -> c_uint;
pub fn LLVMGetIncomingValue(PhiNode: ValueRef, Index: c_uint) -> ValueRef;
pub fn LLVMGetIncomingBlock(PhiNode: ValueRef, Index: c_uint) -> BasicBlockRef;
// Instruction builders
pub fn LLVMCreateBuilderInContext(C: ContextRef) -> BuilderRef;
@ -870,11 +728,6 @@ extern "C" {
pub fn LLVMPositionBuilderBefore(Builder: BuilderRef, Instr: ValueRef);
pub fn LLVMPositionBuilderAtEnd(Builder: BuilderRef, Block: BasicBlockRef);
pub fn LLVMGetInsertBlock(Builder: BuilderRef) -> BasicBlockRef;
pub fn LLVMClearInsertionPosition(Builder: BuilderRef);
pub fn LLVMInsertIntoBuilder(Builder: BuilderRef, Instr: ValueRef);
pub fn LLVMInsertIntoBuilderWithName(Builder: BuilderRef,
Instr: ValueRef,
Name: *const c_char);
pub fn LLVMDisposeBuilder(Builder: BuilderRef);
// Metadata
@ -946,9 +799,6 @@ extern "C" {
// Add a case to the switch instruction
pub fn LLVMAddCase(Switch: ValueRef, OnVal: ValueRef, Dest: BasicBlockRef);
// Add a destination to the indirectbr instruction
pub fn LLVMAddDestination(IndirectBr: ValueRef, Dest: BasicBlockRef);
// Add a clause to the landing pad instruction
pub fn LLVMAddClause(LandingPad: ValueRef, ClauseVal: ValueRef);
@ -1342,9 +1192,6 @@ extern "C" {
/// Creates target data from a target layout string.
pub fn LLVMCreateTargetData(StringRep: *const c_char) -> TargetDataRef;
/// Number of bytes clobbered when doing a Store to *T.
pub fn LLVMStoreSizeOfType(TD: TargetDataRef, Ty: TypeRef) -> c_ulonglong;
/// Number of bytes clobbered when doing a Store to *T.
pub fn LLVMSizeOfTypeInBits(TD: TargetDataRef, Ty: TypeRef) -> c_ulonglong;
@ -1363,9 +1210,6 @@ extern "C" {
Element: c_uint)
-> c_ulonglong;
/// Returns the minimum alignment of a type when part of a call frame.
pub fn LLVMCallFrameAlignmentOfType(TD: TargetDataRef, Ty: TypeRef) -> c_uint;
/// Disposes target data.
pub fn LLVMDisposeTargetData(TD: TargetDataRef);
@ -1381,65 +1225,12 @@ extern "C" {
/// Runs a pass manager on a module.
pub fn LLVMRunPassManager(PM: PassManagerRef, M: ModuleRef) -> Bool;
/// Runs the function passes on the provided function.
pub fn LLVMRunFunctionPassManager(FPM: PassManagerRef, F: ValueRef) -> Bool;
/// Initializes all the function passes scheduled in the manager
pub fn LLVMInitializeFunctionPassManager(FPM: PassManagerRef) -> Bool;
/// Finalizes all the function passes scheduled in the manager
pub fn LLVMFinalizeFunctionPassManager(FPM: PassManagerRef) -> Bool;
pub fn LLVMInitializePasses();
/// Adds a verification pass.
pub fn LLVMAddVerifierPass(PM: PassManagerRef);
pub fn LLVMAddGlobalOptimizerPass(PM: PassManagerRef);
pub fn LLVMAddIPSCCPPass(PM: PassManagerRef);
pub fn LLVMAddDeadArgEliminationPass(PM: PassManagerRef);
pub fn LLVMAddInstructionCombiningPass(PM: PassManagerRef);
pub fn LLVMAddCFGSimplificationPass(PM: PassManagerRef);
pub fn LLVMAddFunctionInliningPass(PM: PassManagerRef);
pub fn LLVMAddFunctionAttrsPass(PM: PassManagerRef);
pub fn LLVMAddScalarReplAggregatesPass(PM: PassManagerRef);
pub fn LLVMAddScalarReplAggregatesPassSSA(PM: PassManagerRef);
pub fn LLVMAddJumpThreadingPass(PM: PassManagerRef);
pub fn LLVMAddConstantPropagationPass(PM: PassManagerRef);
pub fn LLVMAddReassociatePass(PM: PassManagerRef);
pub fn LLVMAddLoopRotatePass(PM: PassManagerRef);
pub fn LLVMAddLICMPass(PM: PassManagerRef);
pub fn LLVMAddLoopUnswitchPass(PM: PassManagerRef);
pub fn LLVMAddLoopDeletionPass(PM: PassManagerRef);
pub fn LLVMAddLoopUnrollPass(PM: PassManagerRef);
pub fn LLVMAddGVNPass(PM: PassManagerRef);
pub fn LLVMAddMemCpyOptPass(PM: PassManagerRef);
pub fn LLVMAddSCCPPass(PM: PassManagerRef);
pub fn LLVMAddDeadStoreEliminationPass(PM: PassManagerRef);
pub fn LLVMAddStripDeadPrototypesPass(PM: PassManagerRef);
pub fn LLVMAddConstantMergePass(PM: PassManagerRef);
pub fn LLVMAddArgumentPromotionPass(PM: PassManagerRef);
pub fn LLVMAddTailCallEliminationPass(PM: PassManagerRef);
pub fn LLVMAddIndVarSimplifyPass(PM: PassManagerRef);
pub fn LLVMAddAggressiveDCEPass(PM: PassManagerRef);
pub fn LLVMAddGlobalDCEPass(PM: PassManagerRef);
pub fn LLVMAddCorrelatedValuePropagationPass(PM: PassManagerRef);
pub fn LLVMAddPruneEHPass(PM: PassManagerRef);
pub fn LLVMAddSimplifyLibCallsPass(PM: PassManagerRef);
pub fn LLVMAddLoopIdiomPass(PM: PassManagerRef);
pub fn LLVMAddEarlyCSEPass(PM: PassManagerRef);
pub fn LLVMAddTypeBasedAliasAnalysisPass(PM: PassManagerRef);
pub fn LLVMAddBasicAliasAnalysisPass(PM: PassManagerRef);
pub fn LLVMPassManagerBuilderCreate() -> PassManagerBuilderRef;
pub fn LLVMPassManagerBuilderDispose(PMB: PassManagerBuilderRef);
pub fn LLVMPassManagerBuilderSetOptLevel(PMB: PassManagerBuilderRef,
OptimizationLevel: c_uint);
pub fn LLVMPassManagerBuilderSetSizeLevel(PMB: PassManagerBuilderRef, Value: Bool);
pub fn LLVMPassManagerBuilderSetDisableUnitAtATime(PMB: PassManagerBuilderRef, Value: Bool);
pub fn LLVMPassManagerBuilderSetDisableUnrollLoops(PMB: PassManagerBuilderRef, Value: Bool);
pub fn LLVMPassManagerBuilderSetDisableSimplifyLibCalls(PMB: PassManagerBuilderRef,
Value: Bool);
pub fn LLVMPassManagerBuilderUseInlinerWithThreshold(PMB: PassManagerBuilderRef,
threshold: c_uint);
pub fn LLVMPassManagerBuilderPopulateModulePassManager(PMB: PassManagerBuilderRef,
@ -1452,10 +1243,6 @@ extern "C" {
Internalize: Bool,
RunInliner: Bool);
/// Destroys a memory buffer.
pub fn LLVMDisposeMemoryBuffer(MemBuf: MemoryBufferRef);
// Stuff that's in rustllvm/ because it's not upstream yet.
/// Opens an object file.
@ -1480,18 +1267,7 @@ extern "C" {
/// Reads the given file and returns it as a memory buffer. Use
/// LLVMDisposeMemoryBuffer() to get rid of it.
pub fn LLVMRustCreateMemoryBufferWithContentsOfFile(Path: *const c_char) -> MemoryBufferRef;
/// Borrows the contents of the memory buffer (doesn't copy it)
pub fn LLVMCreateMemoryBufferWithMemoryRange(InputData: *const c_char,
InputDataLength: size_t,
BufferName: *const c_char,
RequiresNull: Bool)
-> MemoryBufferRef;
pub fn LLVMCreateMemoryBufferWithMemoryRangeCopy(InputData: *const c_char,
InputDataLength: size_t,
BufferName: *const c_char)
-> MemoryBufferRef;
pub fn LLVMIsMultithreaded() -> Bool;
pub fn LLVMStartMultithreaded() -> Bool;
/// Returns a string describing the last error caused by an LLVMRust* call.
@ -1748,9 +1524,6 @@ extern "C" {
pub fn LLVMRustWriteTypeToString(Type: TypeRef, s: RustStringRef);
pub fn LLVMRustWriteValueToString(value_ref: ValueRef, s: RustStringRef);
pub fn LLVMIsAArgument(value_ref: ValueRef) -> ValueRef;
pub fn LLVMIsAAllocaInst(value_ref: ValueRef) -> ValueRef;
pub fn LLVMIsAConstantInt(value_ref: ValueRef) -> ValueRef;
pub fn LLVMRustPassKind(Pass: PassRef) -> PassKind;
@ -1830,7 +1603,6 @@ extern "C" {
instruction_out: *mut ValueRef);
pub fn LLVMRustWriteDiagnosticInfoToString(DI: DiagnosticInfoRef, s: RustStringRef);
pub fn LLVMGetDiagInfoSeverity(DI: DiagnosticInfoRef) -> DiagnosticSeverity;
pub fn LLVMRustGetDiagInfoKind(DI: DiagnosticInfoRef) -> DiagnosticKind;
pub fn LLVMRustWriteDebugLocToString(C: ContextRef, DL: DebugLocRef, s: RustStringRef);