(index<- ) ./librustc/lib/llvm.rs
git branch: * master 5200215 auto merge of #14035 : alexcrichton/rust/experimental, r=huonw
modified: Fri May 9 13:02:28 2014
1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 #![allow(non_uppercase_pattern_statics)]
12 #![allow(non_camel_case_types)]
13 #![allow(dead_code)]
14
15 use std::c_str::ToCStr;
16 use std::cell::RefCell;
17 use collections::HashMap;
18 use libc::{c_uint, c_ushort, c_void, free};
19 use std::str::raw::from_c_str;
20
21 use middle::trans::type_::Type;
22
23 pub type Opcode = u32;
24 pub type Bool = c_uint;
25
26 pub static True: Bool = 1 as Bool;
27 pub static False: Bool = 0 as Bool;
28
29 // Consts for the LLVM CallConv type, pre-cast to uint.
30
31 #[deriving(Eq)]
32 pub enum CallConv {
33 CCallConv = 0,
34 FastCallConv = 8,
35 ColdCallConv = 9,
36 X86StdcallCallConv = 64,
37 X86FastcallCallConv = 65,
38 X86_64_Win64 = 79,
39 }
40
41 pub enum Visibility {
42 LLVMDefaultVisibility = 0,
43 HiddenVisibility = 1,
44 ProtectedVisibility = 2,
45 }
46
47 // This enum omits the obsolete (and no-op) linkage types DLLImportLinkage,
48 // DLLExportLinkage, GhostLinkage and LinkOnceODRAutoHideLinkage.
49 // LinkerPrivateLinkage and LinkerPrivateWeakLinkage are not included either;
50 // they've been removed in upstream LLVM commit r203866.
51 pub enum Linkage {
52 ExternalLinkage = 0,
53 AvailableExternallyLinkage = 1,
54 LinkOnceAnyLinkage = 2,
55 LinkOnceODRLinkage = 3,
56 WeakAnyLinkage = 5,
57 WeakODRLinkage = 6,
58 AppendingLinkage = 7,
59 InternalLinkage = 8,
60 PrivateLinkage = 9,
61 ExternalWeakLinkage = 12,
62 CommonLinkage = 14,
63 }
64
65 #[deriving(Clone)]
66 pub enum Attribute {
67 ZExtAttribute = 1 << 0,
68 SExtAttribute = 1 << 1,
69 NoReturnAttribute = 1 << 2,
70 InRegAttribute = 1 << 3,
71 StructRetAttribute = 1 << 4,
72 NoUnwindAttribute = 1 << 5,
73 NoAliasAttribute = 1 << 6,
74 ByValAttribute = 1 << 7,
75 NestAttribute = 1 << 8,
76 ReadNoneAttribute = 1 << 9,
77 ReadOnlyAttribute = 1 << 10,
78 NoInlineAttribute = 1 << 11,
79 AlwaysInlineAttribute = 1 << 12,
80 OptimizeForSizeAttribute = 1 << 13,
81 StackProtectAttribute = 1 << 14,
82 StackProtectReqAttribute = 1 << 15,
83 AlignmentAttribute = 31 << 16,
84 NoCaptureAttribute = 1 << 21,
85 NoRedZoneAttribute = 1 << 22,
86 NoImplicitFloatAttribute = 1 << 23,
87 NakedAttribute = 1 << 24,
88 InlineHintAttribute = 1 << 25,
89 StackAttribute = 7 << 26,
90 ReturnsTwiceAttribute = 1 << 29,
91 UWTableAttribute = 1 << 30,
92 NonLazyBindAttribute = 1 << 31,
93 }
94
95 // enum for the LLVM IntPredicate type
96 pub enum IntPredicate {
97 IntEQ = 32,
98 IntNE = 33,
99 IntUGT = 34,
100 IntUGE = 35,
101 IntULT = 36,
102 IntULE = 37,
103 IntSGT = 38,
104 IntSGE = 39,
105 IntSLT = 40,
106 IntSLE = 41,
107 }
108
109 // enum for the LLVM RealPredicate type
110 pub enum RealPredicate {
111 RealPredicateFalse = 0,
112 RealOEQ = 1,
113 RealOGT = 2,
114 RealOGE = 3,
115 RealOLT = 4,
116 RealOLE = 5,
117 RealONE = 6,
118 RealORD = 7,
119 RealUNO = 8,
120 RealUEQ = 9,
121 RealUGT = 10,
122 RealUGE = 11,
123 RealULT = 12,
124 RealULE = 13,
125 RealUNE = 14,
126 RealPredicateTrue = 15,
127 }
128
129 // The LLVM TypeKind type - must stay in sync with the def of
130 // LLVMTypeKind in llvm/include/llvm-c/Core.h
131 #[deriving(Eq)]
132 #[repr(C)]
133 pub enum TypeKind {
134 Void = 0,
135 Half = 1,
136 Float = 2,
137 Double = 3,
138 X86_FP80 = 4,
139 FP128 = 5,
140 PPC_FP128 = 6,
141 Label = 7,
142 Integer = 8,
143 Function = 9,
144 Struct = 10,
145 Array = 11,
146 Pointer = 12,
147 Vector = 13,
148 Metadata = 14,
149 X86_MMX = 15,
150 }
151
152 #[repr(C)]
153 pub enum AtomicBinOp {
154 Xchg = 0,
155 Add = 1,
156 Sub = 2,
157 And = 3,
158 Nand = 4,
159 Or = 5,
160 Xor = 6,
161 Max = 7,
162 Min = 8,
163 UMax = 9,
164 UMin = 10,
165 }
166
167 #[repr(C)]
168 pub enum AtomicOrdering {
169 NotAtomic = 0,
170 Unordered = 1,
171 Monotonic = 2,
172 // Consume = 3, // Not specified yet.
173 Acquire = 4,
174 Release = 5,
175 AcquireRelease = 6,
176 SequentiallyConsistent = 7
177 }
178
179 // Consts for the LLVMCodeGenFileType type (in include/llvm/c/TargetMachine.h)
180 #[repr(C)]
181 pub enum FileType {
182 AssemblyFile = 0,
183 ObjectFile = 1
184 }
185
186 pub enum Metadata {
187 MD_dbg = 0,
188 MD_tbaa = 1,
189 MD_prof = 2,
190 MD_fpmath = 3,
191 MD_range = 4,
192 MD_tbaa_struct = 5
193 }
194
195 // Inline Asm Dialect
196 pub enum AsmDialect {
197 AD_ATT = 0,
198 AD_Intel = 1
199 }
200
201 #[deriving(Eq)]
202 #[repr(C)]
203 pub enum CodeGenOptLevel {
204 CodeGenLevelNone = 0,
205 CodeGenLevelLess = 1,
206 CodeGenLevelDefault = 2,
207 CodeGenLevelAggressive = 3,
208 }
209
210 #[repr(C)]
211 pub enum RelocMode {
212 RelocDefault = 0,
213 RelocStatic = 1,
214 RelocPIC = 2,
215 RelocDynamicNoPic = 3,
216 }
217
218 #[repr(C)]
219 pub enum CodeGenModel {
220 CodeModelDefault = 0,
221 CodeModelJITDefault = 1,
222 CodeModelSmall = 2,
223 CodeModelKernel = 3,
224 CodeModelMedium = 4,
225 CodeModelLarge = 5,
226 }
227
228 // Opaque pointer types
229 pub enum Module_opaque {}
230 pub type ModuleRef = *Module_opaque;
231 pub enum Context_opaque {}
232 pub type ContextRef = *Context_opaque;
233 pub enum Type_opaque {}
234 pub type TypeRef = *Type_opaque;
235 pub enum Value_opaque {}
236 pub type ValueRef = *Value_opaque;
237 pub enum BasicBlock_opaque {}
238 pub type BasicBlockRef = *BasicBlock_opaque;
239 pub enum Builder_opaque {}
240 pub type BuilderRef = *Builder_opaque;
241 pub enum ExecutionEngine_opaque {}
242 pub type ExecutionEngineRef = *ExecutionEngine_opaque;
243 pub enum MemoryBuffer_opaque {}
244 pub type MemoryBufferRef = *MemoryBuffer_opaque;
245 pub enum PassManager_opaque {}
246 pub type PassManagerRef = *PassManager_opaque;
247 pub enum PassManagerBuilder_opaque {}
248 pub type PassManagerBuilderRef = *PassManagerBuilder_opaque;
249 pub enum Use_opaque {}
250 pub type UseRef = *Use_opaque;
251 pub enum TargetData_opaque {}
252 pub type TargetDataRef = *TargetData_opaque;
253 pub enum ObjectFile_opaque {}
254 pub type ObjectFileRef = *ObjectFile_opaque;
255 pub enum SectionIterator_opaque {}
256 pub type SectionIteratorRef = *SectionIterator_opaque;
257 pub enum Pass_opaque {}
258 pub type PassRef = *Pass_opaque;
259 pub enum TargetMachine_opaque {}
260 pub type TargetMachineRef = *TargetMachine_opaque;
261 pub enum Archive_opaque {}
262 pub type ArchiveRef = *Archive_opaque;
263
264 pub mod debuginfo {
265 use super::{ValueRef};
266
267 pub enum DIBuilder_opaque {}
268 pub type DIBuilderRef = *DIBuilder_opaque;
269
270 pub type DIDescriptor = ValueRef;
271 pub type DIScope = DIDescriptor;
272 pub type DILocation = DIDescriptor;
273 pub type DIFile = DIScope;
274 pub type DILexicalBlock = DIScope;
275 pub type DISubprogram = DIScope;
276 pub type DIType = DIDescriptor;
277 pub type DIBasicType = DIType;
278 pub type DIDerivedType = DIType;
279 pub type DICompositeType = DIDerivedType;
280 pub type DIVariable = DIDescriptor;
281 pub type DIGlobalVariable = DIDescriptor;
282 pub type DIArray = DIDescriptor;
283 pub type DISubrange = DIDescriptor;
284
285 pub enum DIDescriptorFlags {
286 FlagPrivate = 1 << 0,
287 FlagProtected = 1 << 1,
288 FlagFwdDecl = 1 << 2,
289 FlagAppleBlock = 1 << 3,
290 FlagBlockByrefStruct = 1 << 4,
291 FlagVirtual = 1 << 5,
292 FlagArtificial = 1 << 6,
293 FlagExplicit = 1 << 7,
294 FlagPrototyped = 1 << 8,
295 FlagObjcClassComplete = 1 << 9,
296 FlagObjectPointer = 1 << 10,
297 FlagVector = 1 << 11,
298 FlagStaticMember = 1 << 12
299 }
300 }
301
302 pub mod llvm {
303 use super::{AtomicBinOp, AtomicOrdering, BasicBlockRef, ExecutionEngineRef};
304 use super::{Bool, BuilderRef, ContextRef, MemoryBufferRef, ModuleRef};
305 use super::{ObjectFileRef, Opcode, PassManagerRef, PassManagerBuilderRef};
306 use super::{SectionIteratorRef, TargetDataRef, TypeKind, TypeRef, UseRef};
307 use super::{ValueRef, TargetMachineRef, FileType, ArchiveRef};
308 use super::{CodeGenModel, RelocMode, CodeGenOptLevel};
309 use super::debuginfo::*;
310 use libc::{c_char, c_int, c_longlong, c_ushort, c_uint, c_ulonglong,
311 size_t};
312
313 // Link to our native llvm bindings (things that we need to use the C++ api
314 // for) and because llvm is written in C++ we need to link against libstdc++
315 //
316 // You'll probably notice that there is an omission of all LLVM libraries
317 // from this location. This is because the set of LLVM libraries that we
318 // link to is mostly defined by LLVM, and the `llvm-config` tool is used to
319 // figure out the exact set of libraries. To do this, the build system
320 // generates an llvmdeps.rs file next to this one which will be
321 // automatically updated whenever LLVM is updated to include an up-to-date
322 // set of the libraries we need to link to LLVM for.
323 #[link(name = "rustllvm", kind = "static")]
324 extern {
325 /* Create and destroy contexts. */
326 pub fn LLVMContextCreate() -> ContextRef;
327 pub fn LLVMContextDispose(C: ContextRef);
328 pub fn LLVMGetMDKindIDInContext(C: ContextRef,
329 Name: *c_char,
330 SLen: c_uint)
331 -> c_uint;
332
333 /* Create and destroy modules. */
334 pub fn LLVMModuleCreateWithNameInContext(ModuleID: *c_char,
335 C: ContextRef)
336 -> ModuleRef;
337 pub fn LLVMGetModuleContext(M: ModuleRef) -> ContextRef;
338 pub fn LLVMDisposeModule(M: ModuleRef);
339
340 /** Data layout. See Module::getDataLayout. */
341 pub fn LLVMGetDataLayout(M: ModuleRef) -> *c_char;
342 pub fn LLVMSetDataLayout(M: ModuleRef, Triple: *c_char);
343
344 /** Target triple. See Module::getTargetTriple. */
345 pub fn LLVMGetTarget(M: ModuleRef) -> *c_char;
346 pub fn LLVMSetTarget(M: ModuleRef, Triple: *c_char);
347
348 /** See Module::dump. */
349 pub fn LLVMDumpModule(M: ModuleRef);
350
351 /** See Module::setModuleInlineAsm. */
352 pub fn LLVMSetModuleInlineAsm(M: ModuleRef, Asm: *c_char);
353
354 /** See llvm::LLVMTypeKind::getTypeID. */
355 pub fn LLVMGetTypeKind(Ty: TypeRef) -> TypeKind;
356
357 /** See llvm::LLVMType::getContext. */
358 pub fn LLVMGetTypeContext(Ty: TypeRef) -> ContextRef;
359
360 /* Operations on integer types */
361 pub fn LLVMInt1TypeInContext(C: ContextRef) -> TypeRef;
362 pub fn LLVMInt8TypeInContext(C: ContextRef) -> TypeRef;
363 pub fn LLVMInt16TypeInContext(C: ContextRef) -> TypeRef;
364 pub fn LLVMInt32TypeInContext(C: ContextRef) -> TypeRef;
365 pub fn LLVMInt64TypeInContext(C: ContextRef) -> TypeRef;
366 pub fn LLVMIntTypeInContext(C: ContextRef, NumBits: c_uint)
367 -> TypeRef;
368
369 pub fn LLVMGetIntTypeWidth(IntegerTy: TypeRef) -> c_uint;
370
371 /* Operations on real types */
372 pub fn LLVMFloatTypeInContext(C: ContextRef) -> TypeRef;
373 pub fn LLVMDoubleTypeInContext(C: ContextRef) -> TypeRef;
374 pub fn LLVMX86FP80TypeInContext(C: ContextRef) -> TypeRef;
375 pub fn LLVMFP128TypeInContext(C: ContextRef) -> TypeRef;
376 pub fn LLVMPPCFP128TypeInContext(C: ContextRef) -> TypeRef;
377
378 /* Operations on function types */
379 pub fn LLVMFunctionType(ReturnType: TypeRef,
380 ParamTypes: *TypeRef,
381 ParamCount: c_uint,
382 IsVarArg: Bool)
383 -> TypeRef;
384 pub fn LLVMIsFunctionVarArg(FunctionTy: TypeRef) -> Bool;
385 pub fn LLVMGetReturnType(FunctionTy: TypeRef) -> TypeRef;
386 pub fn LLVMCountParamTypes(FunctionTy: TypeRef) -> c_uint;
387 pub fn LLVMGetParamTypes(FunctionTy: TypeRef, Dest: *TypeRef);
388
389 /* Operations on struct types */
390 pub fn LLVMStructTypeInContext(C: ContextRef,
391 ElementTypes: *TypeRef,
392 ElementCount: c_uint,
393 Packed: Bool)
394 -> TypeRef;
395 pub fn LLVMCountStructElementTypes(StructTy: TypeRef) -> c_uint;
396 pub fn LLVMGetStructElementTypes(StructTy: TypeRef,
397 Dest: *mut TypeRef);
398 pub fn LLVMIsPackedStruct(StructTy: TypeRef) -> Bool;
399
400 /* Operations on array, pointer, and vector types (sequence types) */
401 pub fn LLVMArrayType(ElementType: TypeRef, ElementCount: c_uint)
402 -> TypeRef;
403 pub fn LLVMPointerType(ElementType: TypeRef, AddressSpace: c_uint)
404 -> TypeRef;
405 pub fn LLVMVectorType(ElementType: TypeRef, ElementCount: c_uint)
406 -> TypeRef;
407
408 pub fn LLVMGetElementType(Ty: TypeRef) -> TypeRef;
409 pub fn LLVMGetArrayLength(ArrayTy: TypeRef) -> c_uint;
410 pub fn LLVMGetPointerAddressSpace(PointerTy: TypeRef) -> c_uint;
411 pub fn LLVMGetPointerToGlobal(EE: ExecutionEngineRef, V: ValueRef)
412 -> *();
413 pub fn LLVMGetVectorSize(VectorTy: TypeRef) -> c_uint;
414
415 /* Operations on other types */
416 pub fn LLVMVoidTypeInContext(C: ContextRef) -> TypeRef;
417 pub fn LLVMLabelTypeInContext(C: ContextRef) -> TypeRef;
418 pub fn LLVMMetadataTypeInContext(C: ContextRef) -> TypeRef;
419
420 /* Operations on all values */
421 pub fn LLVMTypeOf(Val: ValueRef) -> TypeRef;
422 pub fn LLVMGetValueName(Val: ValueRef) -> *c_char;
423 pub fn LLVMSetValueName(Val: ValueRef, Name: *c_char);
424 pub fn LLVMDumpValue(Val: ValueRef);
425 pub fn LLVMReplaceAllUsesWith(OldVal: ValueRef, NewVal: ValueRef);
426 pub fn LLVMHasMetadata(Val: ValueRef) -> c_int;
427 pub fn LLVMGetMetadata(Val: ValueRef, KindID: c_uint) -> ValueRef;
428 pub fn LLVMSetMetadata(Val: ValueRef, KindID: c_uint, Node: ValueRef);
429
430 /* Operations on Uses */
431 pub fn LLVMGetFirstUse(Val: ValueRef) -> UseRef;
432 pub fn LLVMGetNextUse(U: UseRef) -> UseRef;
433 pub fn LLVMGetUser(U: UseRef) -> ValueRef;
434 pub fn LLVMGetUsedValue(U: UseRef) -> ValueRef;
435
436 /* Operations on Users */
437 pub fn LLVMGetNumOperands(Val: ValueRef) -> c_int;
438 pub fn LLVMGetOperand(Val: ValueRef, Index: c_uint) -> ValueRef;
439 pub fn LLVMSetOperand(Val: ValueRef, Index: c_uint, Op: ValueRef);
440
441 /* Operations on constants of any type */
442 pub fn LLVMConstNull(Ty: TypeRef) -> ValueRef;
443 /* all zeroes */
444 pub fn LLVMConstAllOnes(Ty: TypeRef) -> ValueRef;
445 pub fn LLVMConstICmp(Pred: c_ushort, V1: ValueRef, V2: ValueRef)
446 -> ValueRef;
447 pub fn LLVMConstFCmp(Pred: c_ushort, V1: ValueRef, V2: ValueRef)
448 -> ValueRef;
449 /* only for int/vector */
450 pub fn LLVMGetUndef(Ty: TypeRef) -> ValueRef;
451 pub fn LLVMIsConstant(Val: ValueRef) -> Bool;
452 pub fn LLVMIsNull(Val: ValueRef) -> Bool;
453 pub fn LLVMIsUndef(Val: ValueRef) -> Bool;
454 pub fn LLVMConstPointerNull(Ty: TypeRef) -> ValueRef;
455
456 /* Operations on metadata */
457 pub fn LLVMMDStringInContext(C: ContextRef,
458 Str: *c_char,
459 SLen: c_uint)
460 -> ValueRef;
461 pub fn LLVMMDNodeInContext(C: ContextRef,
462 Vals: *ValueRef,
463 Count: c_uint)
464 -> ValueRef;
465 pub fn LLVMAddNamedMetadataOperand(M: ModuleRef,
466 Str: *c_char,
467 Val: ValueRef);
468
469 /* Operations on scalar constants */
470 pub fn LLVMConstInt(IntTy: TypeRef, N: c_ulonglong, SignExtend: Bool)
471 -> ValueRef;
472 pub fn LLVMConstIntOfString(IntTy: TypeRef, Text: *c_char, Radix: u8)
473 -> ValueRef;
474 pub fn LLVMConstIntOfStringAndSize(IntTy: TypeRef,
475 Text: *c_char,
476 SLen: c_uint,
477 Radix: u8)
478 -> ValueRef;
479 pub fn LLVMConstReal(RealTy: TypeRef, N: f64) -> ValueRef;
480 pub fn LLVMConstRealOfString(RealTy: TypeRef, Text: *c_char)
481 -> ValueRef;
482 pub fn LLVMConstRealOfStringAndSize(RealTy: TypeRef,
483 Text: *c_char,
484 SLen: c_uint)
485 -> ValueRef;
486 pub fn LLVMConstIntGetZExtValue(ConstantVal: ValueRef) -> c_ulonglong;
487 pub fn LLVMConstIntGetSExtValue(ConstantVal: ValueRef) -> c_longlong;
488
489
490 /* Operations on composite constants */
491 pub fn LLVMConstStringInContext(C: ContextRef,
492 Str: *c_char,
493 Length: c_uint,
494 DontNullTerminate: Bool)
495 -> ValueRef;
496 pub fn LLVMConstStructInContext(C: ContextRef,
497 ConstantVals: *ValueRef,
498 Count: c_uint,
499 Packed: Bool)
500 -> ValueRef;
501
502 pub fn LLVMConstArray(ElementTy: TypeRef,
503 ConstantVals: *ValueRef,
504 Length: c_uint)
505 -> ValueRef;
506 pub fn LLVMConstVector(ScalarConstantVals: *ValueRef, Size: c_uint)
507 -> ValueRef;
508
509 /* Constant expressions */
510 pub fn LLVMAlignOf(Ty: TypeRef) -> ValueRef;
511 pub fn LLVMSizeOf(Ty: TypeRef) -> ValueRef;
512 pub fn LLVMConstNeg(ConstantVal: ValueRef) -> ValueRef;
513 pub fn LLVMConstNSWNeg(ConstantVal: ValueRef) -> ValueRef;
514 pub fn LLVMConstNUWNeg(ConstantVal: ValueRef) -> ValueRef;
515 pub fn LLVMConstFNeg(ConstantVal: ValueRef) -> ValueRef;
516 pub fn LLVMConstNot(ConstantVal: ValueRef) -> ValueRef;
517 pub fn LLVMConstAdd(LHSConstant: ValueRef, RHSConstant: ValueRef)
518 -> ValueRef;
519 pub fn LLVMConstNSWAdd(LHSConstant: ValueRef, RHSConstant: ValueRef)
520 -> ValueRef;
521 pub fn LLVMConstNUWAdd(LHSConstant: ValueRef, RHSConstant: ValueRef)
522 -> ValueRef;
523 pub fn LLVMConstFAdd(LHSConstant: ValueRef, RHSConstant: ValueRef)
524 -> ValueRef;
525 pub fn LLVMConstSub(LHSConstant: ValueRef, RHSConstant: ValueRef)
526 -> ValueRef;
527 pub fn LLVMConstNSWSub(LHSConstant: ValueRef, RHSConstant: ValueRef)
528 -> ValueRef;
529 pub fn LLVMConstNUWSub(LHSConstant: ValueRef, RHSConstant: ValueRef)
530 -> ValueRef;
531 pub fn LLVMConstFSub(LHSConstant: ValueRef, RHSConstant: ValueRef)
532 -> ValueRef;
533 pub fn LLVMConstMul(LHSConstant: ValueRef, RHSConstant: ValueRef)
534 -> ValueRef;
535 pub fn LLVMConstNSWMul(LHSConstant: ValueRef, RHSConstant: ValueRef)
536 -> ValueRef;
537 pub fn LLVMConstNUWMul(LHSConstant: ValueRef, RHSConstant: ValueRef)
538 -> ValueRef;
539 pub fn LLVMConstFMul(LHSConstant: ValueRef, RHSConstant: ValueRef)
540 -> ValueRef;
541 pub fn LLVMConstUDiv(LHSConstant: ValueRef, RHSConstant: ValueRef)
542 -> ValueRef;
543 pub fn LLVMConstSDiv(LHSConstant: ValueRef, RHSConstant: ValueRef)
544 -> ValueRef;
545 pub fn LLVMConstExactSDiv(LHSConstant: ValueRef,
546 RHSConstant: ValueRef)
547 -> ValueRef;
548 pub fn LLVMConstFDiv(LHSConstant: ValueRef, RHSConstant: ValueRef)
549 -> ValueRef;
550 pub fn LLVMConstURem(LHSConstant: ValueRef, RHSConstant: ValueRef)
551 -> ValueRef;
552 pub fn LLVMConstSRem(LHSConstant: ValueRef, RHSConstant: ValueRef)
553 -> ValueRef;
554 pub fn LLVMConstFRem(LHSConstant: ValueRef, RHSConstant: ValueRef)
555 -> ValueRef;
556 pub fn LLVMConstAnd(LHSConstant: ValueRef, RHSConstant: ValueRef)
557 -> ValueRef;
558 pub fn LLVMConstOr(LHSConstant: ValueRef, RHSConstant: ValueRef)
559 -> ValueRef;
560 pub fn LLVMConstXor(LHSConstant: ValueRef, RHSConstant: ValueRef)
561 -> ValueRef;
562 pub fn LLVMConstShl(LHSConstant: ValueRef, RHSConstant: ValueRef)
563 -> ValueRef;
564 pub fn LLVMConstLShr(LHSConstant: ValueRef, RHSConstant: ValueRef)
565 -> ValueRef;
566 pub fn LLVMConstAShr(LHSConstant: ValueRef, RHSConstant: ValueRef)
567 -> ValueRef;
568 pub fn LLVMConstGEP(ConstantVal: ValueRef,
569 ConstantIndices: *ValueRef,
570 NumIndices: c_uint)
571 -> ValueRef;
572 pub fn LLVMConstInBoundsGEP(ConstantVal: ValueRef,
573 ConstantIndices: *ValueRef,
574 NumIndices: c_uint)
575 -> ValueRef;
576 pub fn LLVMConstTrunc(ConstantVal: ValueRef, ToType: TypeRef)
577 -> ValueRef;
578 pub fn LLVMConstSExt(ConstantVal: ValueRef, ToType: TypeRef)
579 -> ValueRef;
580 pub fn LLVMConstZExt(ConstantVal: ValueRef, ToType: TypeRef)
581 -> ValueRef;
582 pub fn LLVMConstFPTrunc(ConstantVal: ValueRef, ToType: TypeRef)
583 -> ValueRef;
584 pub fn LLVMConstFPExt(ConstantVal: ValueRef, ToType: TypeRef)
585 -> ValueRef;
586 pub fn LLVMConstUIToFP(ConstantVal: ValueRef, ToType: TypeRef)
587 -> ValueRef;
588 pub fn LLVMConstSIToFP(ConstantVal: ValueRef, ToType: TypeRef)
589 -> ValueRef;
590 pub fn LLVMConstFPToUI(ConstantVal: ValueRef, ToType: TypeRef)
591 -> ValueRef;
592 pub fn LLVMConstFPToSI(ConstantVal: ValueRef, ToType: TypeRef)
593 -> ValueRef;
594 pub fn LLVMConstPtrToInt(ConstantVal: ValueRef, ToType: TypeRef)
595 -> ValueRef;
596 pub fn LLVMConstIntToPtr(ConstantVal: ValueRef, ToType: TypeRef)
597 -> ValueRef;
598 pub fn LLVMConstBitCast(ConstantVal: ValueRef, ToType: TypeRef)
599 -> ValueRef;
600 pub fn LLVMConstZExtOrBitCast(ConstantVal: ValueRef, ToType: TypeRef)
601 -> ValueRef;
602 pub fn LLVMConstSExtOrBitCast(ConstantVal: ValueRef, ToType: TypeRef)
603 -> ValueRef;
604 pub fn LLVMConstTruncOrBitCast(ConstantVal: ValueRef, ToType: TypeRef)
605 -> ValueRef;
606 pub fn LLVMConstPointerCast(ConstantVal: ValueRef, ToType: TypeRef)
607 -> ValueRef;
608 pub fn LLVMConstIntCast(ConstantVal: ValueRef,
609 ToType: TypeRef,
610 isSigned: Bool)
611 -> ValueRef;
612 pub fn LLVMConstFPCast(ConstantVal: ValueRef, ToType: TypeRef)
613 -> ValueRef;
614 pub fn LLVMConstSelect(ConstantCondition: ValueRef,
615 ConstantIfTrue: ValueRef,
616 ConstantIfFalse: ValueRef)
617 -> ValueRef;
618 pub fn LLVMConstExtractElement(VectorConstant: ValueRef,
619 IndexConstant: ValueRef)
620 -> ValueRef;
621 pub fn LLVMConstInsertElement(VectorConstant: ValueRef,
622 ElementValueConstant: ValueRef,
623 IndexConstant: ValueRef)
624 -> ValueRef;
625 pub fn LLVMConstShuffleVector(VectorAConstant: ValueRef,
626 VectorBConstant: ValueRef,
627 MaskConstant: ValueRef)
628 -> ValueRef;
629 pub fn LLVMConstExtractValue(AggConstant: ValueRef,
630 IdxList: *c_uint,
631 NumIdx: c_uint)
632 -> ValueRef;
633 pub fn LLVMConstInsertValue(AggConstant: ValueRef,
634 ElementValueConstant: ValueRef,
635 IdxList: *c_uint,
636 NumIdx: c_uint)
637 -> ValueRef;
638 pub fn LLVMConstInlineAsm(Ty: TypeRef,
639 AsmString: *c_char,
640 Constraints: *c_char,
641 HasSideEffects: Bool,
642 IsAlignStack: Bool)
643 -> ValueRef;
644 pub fn LLVMBlockAddress(F: ValueRef, BB: BasicBlockRef) -> ValueRef;
645
646
647
648 /* Operations on global variables, functions, and aliases (globals) */
649 pub fn LLVMGetGlobalParent(Global: ValueRef) -> ModuleRef;
650 pub fn LLVMIsDeclaration(Global: ValueRef) -> Bool;
651 pub fn LLVMGetLinkage(Global: ValueRef) -> c_uint;
652 pub fn LLVMSetLinkage(Global: ValueRef, Link: c_uint);
653 pub fn LLVMGetSection(Global: ValueRef) -> *c_char;
654 pub fn LLVMSetSection(Global: ValueRef, Section: *c_char);
655 pub fn LLVMGetVisibility(Global: ValueRef) -> c_uint;
656 pub fn LLVMSetVisibility(Global: ValueRef, Viz: c_uint);
657 pub fn LLVMGetAlignment(Global: ValueRef) -> c_uint;
658 pub fn LLVMSetAlignment(Global: ValueRef, Bytes: c_uint);
659
660
661 /* Operations on global variables */
662 pub fn LLVMAddGlobal(M: ModuleRef, Ty: TypeRef, Name: *c_char)
663 -> ValueRef;
664 pub fn LLVMAddGlobalInAddressSpace(M: ModuleRef,
665 Ty: TypeRef,
666 Name: *c_char,
667 AddressSpace: c_uint)
668 -> ValueRef;
669 pub fn LLVMGetNamedGlobal(M: ModuleRef, Name: *c_char) -> ValueRef;
670 pub fn LLVMGetFirstGlobal(M: ModuleRef) -> ValueRef;
671 pub fn LLVMGetLastGlobal(M: ModuleRef) -> ValueRef;
672 pub fn LLVMGetNextGlobal(GlobalVar: ValueRef) -> ValueRef;
673 pub fn LLVMGetPreviousGlobal(GlobalVar: ValueRef) -> ValueRef;
674 pub fn LLVMDeleteGlobal(GlobalVar: ValueRef);
675 pub fn LLVMGetInitializer(GlobalVar: ValueRef) -> ValueRef;
676 pub fn LLVMSetInitializer(GlobalVar: ValueRef,
677 ConstantVal: ValueRef);
678 pub fn LLVMIsThreadLocal(GlobalVar: ValueRef) -> Bool;
679 pub fn LLVMSetThreadLocal(GlobalVar: ValueRef, IsThreadLocal: Bool);
680 pub fn LLVMIsGlobalConstant(GlobalVar: ValueRef) -> Bool;
681 pub fn LLVMSetGlobalConstant(GlobalVar: ValueRef, IsConstant: Bool);
682
683 /* Operations on aliases */
684 pub fn LLVMAddAlias(M: ModuleRef,
685 Ty: TypeRef,
686 Aliasee: ValueRef,
687 Name: *c_char)
688 -> ValueRef;
689
690 /* Operations on functions */
691 pub fn LLVMAddFunction(M: ModuleRef,
692 Name: *c_char,
693 FunctionTy: TypeRef)
694 -> ValueRef;
695 pub fn LLVMGetNamedFunction(M: ModuleRef, Name: *c_char) -> ValueRef;
696 pub fn LLVMGetFirstFunction(M: ModuleRef) -> ValueRef;
697 pub fn LLVMGetLastFunction(M: ModuleRef) -> ValueRef;
698 pub fn LLVMGetNextFunction(Fn: ValueRef) -> ValueRef;
699 pub fn LLVMGetPreviousFunction(Fn: ValueRef) -> ValueRef;
700 pub fn LLVMDeleteFunction(Fn: ValueRef);
701 pub fn LLVMGetOrInsertFunction(M: ModuleRef,
702 Name: *c_char,
703 FunctionTy: TypeRef)
704 -> ValueRef;
705 pub fn LLVMGetIntrinsicID(Fn: ValueRef) -> c_uint;
706 pub fn LLVMGetFunctionCallConv(Fn: ValueRef) -> c_uint;
707 pub fn LLVMSetFunctionCallConv(Fn: ValueRef, CC: c_uint);
708 pub fn LLVMGetGC(Fn: ValueRef) -> *c_char;
709 pub fn LLVMSetGC(Fn: ValueRef, Name: *c_char);
710 pub fn LLVMAddFunctionAttr(Fn: ValueRef, PA: c_uint);
711 pub fn LLVMAddFunctionAttrString(Fn: ValueRef, Name: *c_char);
712 pub fn LLVMRemoveFunctionAttrString(Fn: ValueRef, Name: *c_char);
713 pub fn LLVMGetFunctionAttr(Fn: ValueRef) -> c_ulonglong;
714
715 pub fn LLVMAddReturnAttribute(Fn: ValueRef, PA: c_uint);
716 pub fn LLVMRemoveReturnAttribute(Fn: ValueRef, PA: c_uint);
717
718 pub fn LLVMAddColdAttribute(Fn: ValueRef);
719
720 pub fn LLVMRemoveFunctionAttr(Fn: ValueRef,
721 PA: c_ulonglong,
722 HighPA: c_ulonglong);
723
724 /* Operations on parameters */
725 pub fn LLVMCountParams(Fn: ValueRef) -> c_uint;
726 pub fn LLVMGetParams(Fn: ValueRef, Params: *ValueRef);
727 pub fn LLVMGetParam(Fn: ValueRef, Index: c_uint) -> ValueRef;
728 pub fn LLVMGetParamParent(Inst: ValueRef) -> ValueRef;
729 pub fn LLVMGetFirstParam(Fn: ValueRef) -> ValueRef;
730 pub fn LLVMGetLastParam(Fn: ValueRef) -> ValueRef;
731 pub fn LLVMGetNextParam(Arg: ValueRef) -> ValueRef;
732 pub fn LLVMGetPreviousParam(Arg: ValueRef) -> ValueRef;
733 pub fn LLVMAddAttribute(Arg: ValueRef, PA: c_uint);
734 pub fn LLVMRemoveAttribute(Arg: ValueRef, PA: c_uint);
735 pub fn LLVMGetAttribute(Arg: ValueRef) -> c_uint;
736 pub fn LLVMSetParamAlignment(Arg: ValueRef, align: c_uint);
737
738 /* Operations on basic blocks */
739 pub fn LLVMBasicBlockAsValue(BB: BasicBlockRef) -> ValueRef;
740 pub fn LLVMValueIsBasicBlock(Val: ValueRef) -> Bool;
741 pub fn LLVMValueAsBasicBlock(Val: ValueRef) -> BasicBlockRef;
742 pub fn LLVMGetBasicBlockParent(BB: BasicBlockRef) -> ValueRef;
743 pub fn LLVMCountBasicBlocks(Fn: ValueRef) -> c_uint;
744 pub fn LLVMGetBasicBlocks(Fn: ValueRef, BasicBlocks: *ValueRef);
745 pub fn LLVMGetFirstBasicBlock(Fn: ValueRef) -> BasicBlockRef;
746 pub fn LLVMGetLastBasicBlock(Fn: ValueRef) -> BasicBlockRef;
747 pub fn LLVMGetNextBasicBlock(BB: BasicBlockRef) -> BasicBlockRef;
748 pub fn LLVMGetPreviousBasicBlock(BB: BasicBlockRef) -> BasicBlockRef;
749 pub fn LLVMGetEntryBasicBlock(Fn: ValueRef) -> BasicBlockRef;
750
751 pub fn LLVMAppendBasicBlockInContext(C: ContextRef,
752 Fn: ValueRef,
753 Name: *c_char)
754 -> BasicBlockRef;
755 pub fn LLVMInsertBasicBlockInContext(C: ContextRef,
756 BB: BasicBlockRef,
757 Name: *c_char)
758 -> BasicBlockRef;
759 pub fn LLVMDeleteBasicBlock(BB: BasicBlockRef);
760
761 pub fn LLVMMoveBasicBlockAfter(BB: BasicBlockRef,
762 MoveAfter: BasicBlockRef);
763
764 pub fn LLVMMoveBasicBlockBefore(BB: BasicBlockRef,
765 MoveBefore: BasicBlockRef);
766
767 /* Operations on instructions */
768 pub fn LLVMGetInstructionParent(Inst: ValueRef) -> BasicBlockRef;
769 pub fn LLVMGetFirstInstruction(BB: BasicBlockRef) -> ValueRef;
770 pub fn LLVMGetLastInstruction(BB: BasicBlockRef) -> ValueRef;
771 pub fn LLVMGetNextInstruction(Inst: ValueRef) -> ValueRef;
772 pub fn LLVMGetPreviousInstruction(Inst: ValueRef) -> ValueRef;
773 pub fn LLVMInstructionEraseFromParent(Inst: ValueRef);
774
775 /* Operations on call sites */
776 pub fn LLVMSetInstructionCallConv(Instr: ValueRef, CC: c_uint);
777 pub fn LLVMGetInstructionCallConv(Instr: ValueRef) -> c_uint;
778 pub fn LLVMAddInstrAttribute(Instr: ValueRef,
779 index: c_uint,
780 IA: c_uint);
781 pub fn LLVMRemoveInstrAttribute(Instr: ValueRef,
782 index: c_uint,
783 IA: c_uint);
784 pub fn LLVMSetInstrParamAlignment(Instr: ValueRef,
785 index: c_uint,
786 align: c_uint);
787
788 /* Operations on call instructions (only) */
789 pub fn LLVMIsTailCall(CallInst: ValueRef) -> Bool;
790 pub fn LLVMSetTailCall(CallInst: ValueRef, IsTailCall: Bool);
791
792 /* Operations on load/store instructions (only) */
793 pub fn LLVMGetVolatile(MemoryAccessInst: ValueRef) -> Bool;
794 pub fn LLVMSetVolatile(MemoryAccessInst: ValueRef, volatile: Bool);
795
796 /* Operations on phi nodes */
797 pub fn LLVMAddIncoming(PhiNode: ValueRef,
798 IncomingValues: *ValueRef,
799 IncomingBlocks: *BasicBlockRef,
800 Count: c_uint);
801 pub fn LLVMCountIncoming(PhiNode: ValueRef) -> c_uint;
802 pub fn LLVMGetIncomingValue(PhiNode: ValueRef, Index: c_uint)
803 -> ValueRef;
804 pub fn LLVMGetIncomingBlock(PhiNode: ValueRef, Index: c_uint)
805 -> BasicBlockRef;
806
807 /* Instruction builders */
808 pub fn LLVMCreateBuilderInContext(C: ContextRef) -> BuilderRef;
809 pub fn LLVMPositionBuilder(Builder: BuilderRef,
810 Block: BasicBlockRef,
811 Instr: ValueRef);
812 pub fn LLVMPositionBuilderBefore(Builder: BuilderRef,
813 Instr: ValueRef);
814 pub fn LLVMPositionBuilderAtEnd(Builder: BuilderRef,
815 Block: BasicBlockRef);
816 pub fn LLVMGetInsertBlock(Builder: BuilderRef) -> BasicBlockRef;
817 pub fn LLVMClearInsertionPosition(Builder: BuilderRef);
818 pub fn LLVMInsertIntoBuilder(Builder: BuilderRef, Instr: ValueRef);
819 pub fn LLVMInsertIntoBuilderWithName(Builder: BuilderRef,
820 Instr: ValueRef,
821 Name: *c_char);
822 pub fn LLVMDisposeBuilder(Builder: BuilderRef);
823 pub fn LLVMDisposeExecutionEngine(EE: ExecutionEngineRef);
824
825 /* Metadata */
826 pub fn LLVMSetCurrentDebugLocation(Builder: BuilderRef, L: ValueRef);
827 pub fn LLVMGetCurrentDebugLocation(Builder: BuilderRef) -> ValueRef;
828 pub fn LLVMSetInstDebugLocation(Builder: BuilderRef, Inst: ValueRef);
829
830 /* Terminators */
831 pub fn LLVMBuildRetVoid(B: BuilderRef) -> ValueRef;
832 pub fn LLVMBuildRet(B: BuilderRef, V: ValueRef) -> ValueRef;
833 pub fn LLVMBuildAggregateRet(B: BuilderRef,
834 RetVals: *ValueRef,
835 N: c_uint)
836 -> ValueRef;
837 pub fn LLVMBuildBr(B: BuilderRef, Dest: BasicBlockRef) -> ValueRef;
838 pub fn LLVMBuildCondBr(B: BuilderRef,
839 If: ValueRef,
840 Then: BasicBlockRef,
841 Else: BasicBlockRef)
842 -> ValueRef;
843 pub fn LLVMBuildSwitch(B: BuilderRef,
844 V: ValueRef,
845 Else: BasicBlockRef,
846 NumCases: c_uint)
847 -> ValueRef;
848 pub fn LLVMBuildIndirectBr(B: BuilderRef,
849 Addr: ValueRef,
850 NumDests: c_uint)
851 -> ValueRef;
852 pub fn LLVMBuildInvoke(B: BuilderRef,
853 Fn: ValueRef,
854 Args: *ValueRef,
855 NumArgs: c_uint,
856 Then: BasicBlockRef,
857 Catch: BasicBlockRef,
858 Name: *c_char)
859 -> ValueRef;
860 pub fn LLVMBuildLandingPad(B: BuilderRef,
861 Ty: TypeRef,
862 PersFn: ValueRef,
863 NumClauses: c_uint,
864 Name: *c_char)
865 -> ValueRef;
866 pub fn LLVMBuildResume(B: BuilderRef, Exn: ValueRef) -> ValueRef;
867 pub fn LLVMBuildUnreachable(B: BuilderRef) -> ValueRef;
868
869 /* Add a case to the switch instruction */
870 pub fn LLVMAddCase(Switch: ValueRef,
871 OnVal: ValueRef,
872 Dest: BasicBlockRef);
873
874 /* Add a destination to the indirectbr instruction */
875 pub fn LLVMAddDestination(IndirectBr: ValueRef, Dest: BasicBlockRef);
876
877 /* Add a clause to the landing pad instruction */
878 pub fn LLVMAddClause(LandingPad: ValueRef, ClauseVal: ValueRef);
879
880 /* Set the cleanup on a landing pad instruction */
881 pub fn LLVMSetCleanup(LandingPad: ValueRef, Val: Bool);
882
883 /* Arithmetic */
884 pub fn LLVMBuildAdd(B: BuilderRef,
885 LHS: ValueRef,
886 RHS: ValueRef,
887 Name: *c_char)
888 -> ValueRef;
889 pub fn LLVMBuildNSWAdd(B: BuilderRef,
890 LHS: ValueRef,
891 RHS: ValueRef,
892 Name: *c_char)
893 -> ValueRef;
894 pub fn LLVMBuildNUWAdd(B: BuilderRef,
895 LHS: ValueRef,
896 RHS: ValueRef,
897 Name: *c_char)
898 -> ValueRef;
899 pub fn LLVMBuildFAdd(B: BuilderRef,
900 LHS: ValueRef,
901 RHS: ValueRef,
902 Name: *c_char)
903 -> ValueRef;
904 pub fn LLVMBuildSub(B: BuilderRef,
905 LHS: ValueRef,
906 RHS: ValueRef,
907 Name: *c_char)
908 -> ValueRef;
909 pub fn LLVMBuildNSWSub(B: BuilderRef,
910 LHS: ValueRef,
911 RHS: ValueRef,
912 Name: *c_char)
913 -> ValueRef;
914 pub fn LLVMBuildNUWSub(B: BuilderRef,
915 LHS: ValueRef,
916 RHS: ValueRef,
917 Name: *c_char)
918 -> ValueRef;
919 pub fn LLVMBuildFSub(B: BuilderRef,
920 LHS: ValueRef,
921 RHS: ValueRef,
922 Name: *c_char)
923 -> ValueRef;
924 pub fn LLVMBuildMul(B: BuilderRef,
925 LHS: ValueRef,
926 RHS: ValueRef,
927 Name: *c_char)
928 -> ValueRef;
929 pub fn LLVMBuildNSWMul(B: BuilderRef,
930 LHS: ValueRef,
931 RHS: ValueRef,
932 Name: *c_char)
933 -> ValueRef;
934 pub fn LLVMBuildNUWMul(B: BuilderRef,
935 LHS: ValueRef,
936 RHS: ValueRef,
937 Name: *c_char)
938 -> ValueRef;
939 pub fn LLVMBuildFMul(B: BuilderRef,
940 LHS: ValueRef,
941 RHS: ValueRef,
942 Name: *c_char)
943 -> ValueRef;
944 pub fn LLVMBuildUDiv(B: BuilderRef,
945 LHS: ValueRef,
946 RHS: ValueRef,
947 Name: *c_char)
948 -> ValueRef;
949 pub fn LLVMBuildSDiv(B: BuilderRef,
950 LHS: ValueRef,
951 RHS: ValueRef,
952 Name: *c_char)
953 -> ValueRef;
954 pub fn LLVMBuildExactSDiv(B: BuilderRef,
955 LHS: ValueRef,
956 RHS: ValueRef,
957 Name: *c_char)
958 -> ValueRef;
959 pub fn LLVMBuildFDiv(B: BuilderRef,
960 LHS: ValueRef,
961 RHS: ValueRef,
962 Name: *c_char)
963 -> ValueRef;
964 pub fn LLVMBuildURem(B: BuilderRef,
965 LHS: ValueRef,
966 RHS: ValueRef,
967 Name: *c_char)
968 -> ValueRef;
969 pub fn LLVMBuildSRem(B: BuilderRef,
970 LHS: ValueRef,
971 RHS: ValueRef,
972 Name: *c_char)
973 -> ValueRef;
974 pub fn LLVMBuildFRem(B: BuilderRef,
975 LHS: ValueRef,
976 RHS: ValueRef,
977 Name: *c_char)
978 -> ValueRef;
979 pub fn LLVMBuildShl(B: BuilderRef,
980 LHS: ValueRef,
981 RHS: ValueRef,
982 Name: *c_char)
983 -> ValueRef;
984 pub fn LLVMBuildLShr(B: BuilderRef,
985 LHS: ValueRef,
986 RHS: ValueRef,
987 Name: *c_char)
988 -> ValueRef;
989 pub fn LLVMBuildAShr(B: BuilderRef,
990 LHS: ValueRef,
991 RHS: ValueRef,
992 Name: *c_char)
993 -> ValueRef;
994 pub fn LLVMBuildAnd(B: BuilderRef,
995 LHS: ValueRef,
996 RHS: ValueRef,
997 Name: *c_char)
998 -> ValueRef;
999 pub fn LLVMBuildOr(B: BuilderRef,
1000 LHS: ValueRef,
1001 RHS: ValueRef,
1002 Name: *c_char)
1003 -> ValueRef;
1004 pub fn LLVMBuildXor(B: BuilderRef,
1005 LHS: ValueRef,
1006 RHS: ValueRef,
1007 Name: *c_char)
1008 -> ValueRef;
1009 pub fn LLVMBuildBinOp(B: BuilderRef,
1010 Op: Opcode,
1011 LHS: ValueRef,
1012 RHS: ValueRef,
1013 Name: *c_char)
1014 -> ValueRef;
1015 pub fn LLVMBuildNeg(B: BuilderRef, V: ValueRef, Name: *c_char)
1016 -> ValueRef;
1017 pub fn LLVMBuildNSWNeg(B: BuilderRef, V: ValueRef, Name: *c_char)
1018 -> ValueRef;
1019 pub fn LLVMBuildNUWNeg(B: BuilderRef, V: ValueRef, Name: *c_char)
1020 -> ValueRef;
1021 pub fn LLVMBuildFNeg(B: BuilderRef, V: ValueRef, Name: *c_char)
1022 -> ValueRef;
1023 pub fn LLVMBuildNot(B: BuilderRef, V: ValueRef, Name: *c_char)
1024 -> ValueRef;
1025
1026 /* Memory */
1027 pub fn LLVMBuildMalloc(B: BuilderRef, Ty: TypeRef, Name: *c_char)
1028 -> ValueRef;
1029 pub fn LLVMBuildArrayMalloc(B: BuilderRef,
1030 Ty: TypeRef,
1031 Val: ValueRef,
1032 Name: *c_char)
1033 -> ValueRef;
1034 pub fn LLVMBuildAlloca(B: BuilderRef, Ty: TypeRef, Name: *c_char)
1035 -> ValueRef;
1036 pub fn LLVMBuildArrayAlloca(B: BuilderRef,
1037 Ty: TypeRef,
1038 Val: ValueRef,
1039 Name: *c_char)
1040 -> ValueRef;
1041 pub fn LLVMBuildFree(B: BuilderRef, PointerVal: ValueRef) -> ValueRef;
1042 pub fn LLVMBuildLoad(B: BuilderRef,
1043 PointerVal: ValueRef,
1044 Name: *c_char)
1045 -> ValueRef;
1046
1047 pub fn LLVMBuildStore(B: BuilderRef, Val: ValueRef, Ptr: ValueRef)
1048 -> ValueRef;
1049
1050 pub fn LLVMBuildGEP(B: BuilderRef,
1051 Pointer: ValueRef,
1052 Indices: *ValueRef,
1053 NumIndices: c_uint,
1054 Name: *c_char)
1055 -> ValueRef;
1056 pub fn LLVMBuildInBoundsGEP(B: BuilderRef,
1057 Pointer: ValueRef,
1058 Indices: *ValueRef,
1059 NumIndices: c_uint,
1060 Name: *c_char)
1061 -> ValueRef;
1062 pub fn LLVMBuildStructGEP(B: BuilderRef,
1063 Pointer: ValueRef,
1064 Idx: c_uint,
1065 Name: *c_char)
1066 -> ValueRef;
1067 pub fn LLVMBuildGlobalString(B: BuilderRef,
1068 Str: *c_char,
1069 Name: *c_char)
1070 -> ValueRef;
1071 pub fn LLVMBuildGlobalStringPtr(B: BuilderRef,
1072 Str: *c_char,
1073 Name: *c_char)
1074 -> ValueRef;
1075
1076 /* Casts */
1077 pub fn LLVMBuildTrunc(B: BuilderRef,
1078 Val: ValueRef,
1079 DestTy: TypeRef,
1080 Name: *c_char)
1081 -> ValueRef;
1082 pub fn LLVMBuildZExt(B: BuilderRef,
1083 Val: ValueRef,
1084 DestTy: TypeRef,
1085 Name: *c_char)
1086 -> ValueRef;
1087 pub fn LLVMBuildSExt(B: BuilderRef,
1088 Val: ValueRef,
1089 DestTy: TypeRef,
1090 Name: *c_char)
1091 -> ValueRef;
1092 pub fn LLVMBuildFPToUI(B: BuilderRef,
1093 Val: ValueRef,
1094 DestTy: TypeRef,
1095 Name: *c_char)
1096 -> ValueRef;
1097 pub fn LLVMBuildFPToSI(B: BuilderRef,
1098 Val: ValueRef,
1099 DestTy: TypeRef,
1100 Name: *c_char)
1101 -> ValueRef;
1102 pub fn LLVMBuildUIToFP(B: BuilderRef,
1103 Val: ValueRef,
1104 DestTy: TypeRef,
1105 Name: *c_char)
1106 -> ValueRef;
1107 pub fn LLVMBuildSIToFP(B: BuilderRef,
1108 Val: ValueRef,
1109 DestTy: TypeRef,
1110 Name: *c_char)
1111 -> ValueRef;
1112 pub fn LLVMBuildFPTrunc(B: BuilderRef,
1113 Val: ValueRef,
1114 DestTy: TypeRef,
1115 Name: *c_char)
1116 -> ValueRef;
1117 pub fn LLVMBuildFPExt(B: BuilderRef,
1118 Val: ValueRef,
1119 DestTy: TypeRef,
1120 Name: *c_char)
1121 -> ValueRef;
1122 pub fn LLVMBuildPtrToInt(B: BuilderRef,
1123 Val: ValueRef,
1124 DestTy: TypeRef,
1125 Name: *c_char)
1126 -> ValueRef;
1127 pub fn LLVMBuildIntToPtr(B: BuilderRef,
1128 Val: ValueRef,
1129 DestTy: TypeRef,
1130 Name: *c_char)
1131 -> ValueRef;
1132 pub fn LLVMBuildBitCast(B: BuilderRef,
1133 Val: ValueRef,
1134 DestTy: TypeRef,
1135 Name: *c_char)
1136 -> ValueRef;
1137 pub fn LLVMBuildZExtOrBitCast(B: BuilderRef,
1138 Val: ValueRef,
1139 DestTy: TypeRef,
1140 Name: *c_char)
1141 -> ValueRef;
1142 pub fn LLVMBuildSExtOrBitCast(B: BuilderRef,
1143 Val: ValueRef,
1144 DestTy: TypeRef,
1145 Name: *c_char)
1146 -> ValueRef;
1147 pub fn LLVMBuildTruncOrBitCast(B: BuilderRef,
1148 Val: ValueRef,
1149 DestTy: TypeRef,
1150 Name: *c_char)
1151 -> ValueRef;
1152 pub fn LLVMBuildCast(B: BuilderRef,
1153 Op: Opcode,
1154 Val: ValueRef,
1155 DestTy: TypeRef,
1156 Name: *c_char) -> ValueRef;
1157 pub fn LLVMBuildPointerCast(B: BuilderRef,
1158 Val: ValueRef,
1159 DestTy: TypeRef,
1160 Name: *c_char)
1161 -> ValueRef;
1162 pub fn LLVMBuildIntCast(B: BuilderRef,
1163 Val: ValueRef,
1164 DestTy: TypeRef,
1165 Name: *c_char)
1166 -> ValueRef;
1167 pub fn LLVMBuildFPCast(B: BuilderRef,
1168 Val: ValueRef,
1169 DestTy: TypeRef,
1170 Name: *c_char)
1171 -> ValueRef;
1172
1173 /* Comparisons */
1174 pub fn LLVMBuildICmp(B: BuilderRef,
1175 Op: c_uint,
1176 LHS: ValueRef,
1177 RHS: ValueRef,
1178 Name: *c_char)
1179 -> ValueRef;
1180 pub fn LLVMBuildFCmp(B: BuilderRef,
1181 Op: c_uint,
1182 LHS: ValueRef,
1183 RHS: ValueRef,
1184 Name: *c_char)
1185 -> ValueRef;
1186
1187 /* Miscellaneous instructions */
1188 pub fn LLVMBuildPhi(B: BuilderRef, Ty: TypeRef, Name: *c_char)
1189 -> ValueRef;
1190 pub fn LLVMBuildCall(B: BuilderRef,
1191 Fn: ValueRef,
1192 Args: *ValueRef,
1193 NumArgs: c_uint,
1194 Name: *c_char)
1195 -> ValueRef;
1196 pub fn LLVMBuildSelect(B: BuilderRef,
1197 If: ValueRef,
1198 Then: ValueRef,
1199 Else: ValueRef,
1200 Name: *c_char)
1201 -> ValueRef;
1202 pub fn LLVMBuildVAArg(B: BuilderRef,
1203 list: ValueRef,
1204 Ty: TypeRef,
1205 Name: *c_char)
1206 -> ValueRef;
1207 pub fn LLVMBuildExtractElement(B: BuilderRef,
1208 VecVal: ValueRef,
1209 Index: ValueRef,
1210 Name: *c_char)
1211 -> ValueRef;
1212 pub fn LLVMBuildInsertElement(B: BuilderRef,
1213 VecVal: ValueRef,
1214 EltVal: ValueRef,
1215 Index: ValueRef,
1216 Name: *c_char)
1217 -> ValueRef;
1218 pub fn LLVMBuildShuffleVector(B: BuilderRef,
1219 V1: ValueRef,
1220 V2: ValueRef,
1221 Mask: ValueRef,
1222 Name: *c_char)
1223 -> ValueRef;
1224 pub fn LLVMBuildExtractValue(B: BuilderRef,
1225 AggVal: ValueRef,
1226 Index: c_uint,
1227 Name: *c_char)
1228 -> ValueRef;
1229 pub fn LLVMBuildInsertValue(B: BuilderRef,
1230 AggVal: ValueRef,
1231 EltVal: ValueRef,
1232 Index: c_uint,
1233 Name: *c_char)
1234 -> ValueRef;
1235
1236 pub fn LLVMBuildIsNull(B: BuilderRef, Val: ValueRef, Name: *c_char)
1237 -> ValueRef;
1238 pub fn LLVMBuildIsNotNull(B: BuilderRef, Val: ValueRef, Name: *c_char)
1239 -> ValueRef;
1240 pub fn LLVMBuildPtrDiff(B: BuilderRef,
1241 LHS: ValueRef,
1242 RHS: ValueRef,
1243 Name: *c_char)
1244 -> ValueRef;
1245
1246 /* Atomic Operations */
1247 pub fn LLVMBuildAtomicLoad(B: BuilderRef,
1248 PointerVal: ValueRef,
1249 Name: *c_char,
1250 Order: AtomicOrdering,
1251 Alignment: c_uint)
1252 -> ValueRef;
1253
1254 pub fn LLVMBuildAtomicStore(B: BuilderRef,
1255 Val: ValueRef,
1256 Ptr: ValueRef,
1257 Order: AtomicOrdering,
1258 Alignment: c_uint)
1259 -> ValueRef;
1260
1261 pub fn LLVMBuildAtomicCmpXchg(B: BuilderRef,
1262 LHS: ValueRef,
1263 CMP: ValueRef,
1264 RHS: ValueRef,
1265 Order: AtomicOrdering,
1266 FailureOrder: AtomicOrdering)
1267 -> ValueRef;
1268 pub fn LLVMBuildAtomicRMW(B: BuilderRef,
1269 Op: AtomicBinOp,
1270 LHS: ValueRef,
1271 RHS: ValueRef,
1272 Order: AtomicOrdering,
1273 SingleThreaded: Bool)
1274 -> ValueRef;
1275
1276 pub fn LLVMBuildAtomicFence(B: BuilderRef, Order: AtomicOrdering);
1277
1278
1279 /* Selected entries from the downcasts. */
1280 pub fn LLVMIsATerminatorInst(Inst: ValueRef) -> ValueRef;
1281 pub fn LLVMIsAStoreInst(Inst: ValueRef) -> ValueRef;
1282
1283 /** Writes a module to the specified path. Returns 0 on success. */
1284 pub fn LLVMWriteBitcodeToFile(M: ModuleRef, Path: *c_char) -> c_int;
1285
1286 /** Creates target data from a target layout string. */
1287 pub fn LLVMCreateTargetData(StringRep: *c_char) -> TargetDataRef;
1288 /// Adds the target data to the given pass manager. The pass manager
1289 /// references the target data only weakly.
1290 pub fn LLVMAddTargetData(TD: TargetDataRef, PM: PassManagerRef);
1291 /** Number of bytes clobbered when doing a Store to *T. */
1292 pub fn LLVMStoreSizeOfType(TD: TargetDataRef, Ty: TypeRef)
1293 -> c_ulonglong;
1294
1295 /** Number of bytes clobbered when doing a Store to *T. */
1296 pub fn LLVMSizeOfTypeInBits(TD: TargetDataRef, Ty: TypeRef)
1297 -> c_ulonglong;
1298
1299 /** Distance between successive elements in an array of T.
1300 Includes ABI padding. */
1301 pub fn LLVMABISizeOfType(TD: TargetDataRef, Ty: TypeRef) -> c_uint;
1302
1303 /** Returns the preferred alignment of a type. */
1304 pub fn LLVMPreferredAlignmentOfType(TD: TargetDataRef, Ty: TypeRef)
1305 -> c_uint;
1306 /** Returns the minimum alignment of a type. */
1307 pub fn LLVMABIAlignmentOfType(TD: TargetDataRef, Ty: TypeRef)
1308 -> c_uint;
1309
1310 /// Computes the byte offset of the indexed struct element for a
1311 /// target.
1312 pub fn LLVMOffsetOfElement(TD: TargetDataRef,
1313 StructTy: TypeRef,
1314 Element: c_uint)
1315 -> c_ulonglong;
1316
1317 /**
1318 * Returns the minimum alignment of a type when part of a call frame.
1319 */
1320 pub fn LLVMCallFrameAlignmentOfType(TD: TargetDataRef, Ty: TypeRef)
1321 -> c_uint;
1322
1323 /** Disposes target data. */
1324 pub fn LLVMDisposeTargetData(TD: TargetDataRef);
1325
1326 /** Creates a pass manager. */
1327 pub fn LLVMCreatePassManager() -> PassManagerRef;
1328
1329 /** Creates a function-by-function pass manager */
1330 pub fn LLVMCreateFunctionPassManagerForModule(M: ModuleRef)
1331 -> PassManagerRef;
1332
1333 /** Disposes a pass manager. */
1334 pub fn LLVMDisposePassManager(PM: PassManagerRef);
1335
1336 /** Runs a pass manager on a module. */
1337 pub fn LLVMRunPassManager(PM: PassManagerRef, M: ModuleRef) -> Bool;
1338
1339 /** Runs the function passes on the provided function. */
1340 pub fn LLVMRunFunctionPassManager(FPM: PassManagerRef, F: ValueRef)
1341 -> Bool;
1342
1343 /** Initializes all the function passes scheduled in the manager */
1344 pub fn LLVMInitializeFunctionPassManager(FPM: PassManagerRef) -> Bool;
1345
1346 /** Finalizes all the function passes scheduled in the manager */
1347 pub fn LLVMFinalizeFunctionPassManager(FPM: PassManagerRef) -> Bool;
1348
1349 pub fn LLVMInitializePasses();
1350
1351 /** Adds a verification pass. */
1352 pub fn LLVMAddVerifierPass(PM: PassManagerRef);
1353
1354 pub fn LLVMAddGlobalOptimizerPass(PM: PassManagerRef);
1355 pub fn LLVMAddIPSCCPPass(PM: PassManagerRef);
1356 pub fn LLVMAddDeadArgEliminationPass(PM: PassManagerRef);
1357 pub fn LLVMAddInstructionCombiningPass(PM: PassManagerRef);
1358 pub fn LLVMAddCFGSimplificationPass(PM: PassManagerRef);
1359 pub fn LLVMAddFunctionInliningPass(PM: PassManagerRef);
1360 pub fn LLVMAddFunctionAttrsPass(PM: PassManagerRef);
1361 pub fn LLVMAddScalarReplAggregatesPass(PM: PassManagerRef);
1362 pub fn LLVMAddScalarReplAggregatesPassSSA(PM: PassManagerRef);
1363 pub fn LLVMAddJumpThreadingPass(PM: PassManagerRef);
1364 pub fn LLVMAddConstantPropagationPass(PM: PassManagerRef);
1365 pub fn LLVMAddReassociatePass(PM: PassManagerRef);
1366 pub fn LLVMAddLoopRotatePass(PM: PassManagerRef);
1367 pub fn LLVMAddLICMPass(PM: PassManagerRef);
1368 pub fn LLVMAddLoopUnswitchPass(PM: PassManagerRef);
1369 pub fn LLVMAddLoopDeletionPass(PM: PassManagerRef);
1370 pub fn LLVMAddLoopUnrollPass(PM: PassManagerRef);
1371 pub fn LLVMAddGVNPass(PM: PassManagerRef);
1372 pub fn LLVMAddMemCpyOptPass(PM: PassManagerRef);
1373 pub fn LLVMAddSCCPPass(PM: PassManagerRef);
1374 pub fn LLVMAddDeadStoreEliminationPass(PM: PassManagerRef);
1375 pub fn LLVMAddStripDeadPrototypesPass(PM: PassManagerRef);
1376 pub fn LLVMAddConstantMergePass(PM: PassManagerRef);
1377 pub fn LLVMAddArgumentPromotionPass(PM: PassManagerRef);
1378 pub fn LLVMAddTailCallEliminationPass(PM: PassManagerRef);
1379 pub fn LLVMAddIndVarSimplifyPass(PM: PassManagerRef);
1380 pub fn LLVMAddAggressiveDCEPass(PM: PassManagerRef);
1381 pub fn LLVMAddGlobalDCEPass(PM: PassManagerRef);
1382 pub fn LLVMAddCorrelatedValuePropagationPass(PM: PassManagerRef);
1383 pub fn LLVMAddPruneEHPass(PM: PassManagerRef);
1384 pub fn LLVMAddSimplifyLibCallsPass(PM: PassManagerRef);
1385 pub fn LLVMAddLoopIdiomPass(PM: PassManagerRef);
1386 pub fn LLVMAddEarlyCSEPass(PM: PassManagerRef);
1387 pub fn LLVMAddTypeBasedAliasAnalysisPass(PM: PassManagerRef);
1388 pub fn LLVMAddBasicAliasAnalysisPass(PM: PassManagerRef);
1389
1390 pub fn LLVMPassManagerBuilderCreate() -> PassManagerBuilderRef;
1391 pub fn LLVMPassManagerBuilderDispose(PMB: PassManagerBuilderRef);
1392 pub fn LLVMPassManagerBuilderSetOptLevel(PMB: PassManagerBuilderRef,
1393 OptimizationLevel: c_uint);
1394 pub fn LLVMPassManagerBuilderSetSizeLevel(PMB: PassManagerBuilderRef,
1395 Value: Bool);
1396 pub fn LLVMPassManagerBuilderSetDisableUnitAtATime(
1397 PMB: PassManagerBuilderRef,
1398 Value: Bool);
1399 pub fn LLVMPassManagerBuilderSetDisableUnrollLoops(
1400 PMB: PassManagerBuilderRef,
1401 Value: Bool);
1402 pub fn LLVMPassManagerBuilderSetDisableSimplifyLibCalls(
1403 PMB: PassManagerBuilderRef,
1404 Value: Bool);
1405 pub fn LLVMPassManagerBuilderUseInlinerWithThreshold(
1406 PMB: PassManagerBuilderRef,
1407 threshold: c_uint);
1408 pub fn LLVMPassManagerBuilderPopulateModulePassManager(
1409 PMB: PassManagerBuilderRef,
1410 PM: PassManagerRef);
1411
1412 pub fn LLVMPassManagerBuilderPopulateFunctionPassManager(
1413 PMB: PassManagerBuilderRef,
1414 PM: PassManagerRef);
1415 pub fn LLVMPassManagerBuilderPopulateLTOPassManager(
1416 PMB: PassManagerBuilderRef,
1417 PM: PassManagerRef,
1418 Internalize: Bool,
1419 RunInliner: Bool);
1420
1421 /** Destroys a memory buffer. */
1422 pub fn LLVMDisposeMemoryBuffer(MemBuf: MemoryBufferRef);
1423
1424
1425 /* Stuff that's in rustllvm/ because it's not upstream yet. */
1426
1427 /** Opens an object file. */
1428 pub fn LLVMCreateObjectFile(MemBuf: MemoryBufferRef) -> ObjectFileRef;
1429 /** Closes an object file. */
1430 pub fn LLVMDisposeObjectFile(ObjFile: ObjectFileRef);
1431
1432 /** Enumerates the sections in an object file. */
1433 pub fn LLVMGetSections(ObjFile: ObjectFileRef) -> SectionIteratorRef;
1434 /** Destroys a section iterator. */
1435 pub fn LLVMDisposeSectionIterator(SI: SectionIteratorRef);
1436 /** Returns true if the section iterator is at the end of the section
1437 list: */
1438 pub fn LLVMIsSectionIteratorAtEnd(ObjFile: ObjectFileRef,
1439 SI: SectionIteratorRef)
1440 -> Bool;
1441 /** Moves the section iterator to point to the next section. */
1442 pub fn LLVMMoveToNextSection(SI: SectionIteratorRef);
1443 /** Returns the current section size. */
1444 pub fn LLVMGetSectionSize(SI: SectionIteratorRef) -> c_ulonglong;
1445 /** Returns the current section contents as a string buffer. */
1446 pub fn LLVMGetSectionContents(SI: SectionIteratorRef) -> *c_char;
1447
1448 /** Reads the given file and returns it as a memory buffer. Use
1449 LLVMDisposeMemoryBuffer() to get rid of it. */
1450 pub fn LLVMRustCreateMemoryBufferWithContentsOfFile(Path: *c_char)
1451 -> MemoryBufferRef;
1452 /** Borrows the contents of the memory buffer (doesn't copy it) */
1453 pub fn LLVMCreateMemoryBufferWithMemoryRange(InputData: *c_char,
1454 InputDataLength: size_t,
1455 BufferName: *c_char,
1456 RequiresNull: Bool)
1457 -> MemoryBufferRef;
1458 pub fn LLVMCreateMemoryBufferWithMemoryRangeCopy(InputData: *c_char,
1459 InputDataLength: size_t,
1460 BufferName: *c_char)
1461 -> MemoryBufferRef;
1462
1463 pub fn LLVMIsMultithreaded() -> Bool;
1464 pub fn LLVMStartMultithreaded() -> Bool;
1465
1466 /** Returns a string describing the last error caused by an LLVMRust*
1467 call. */
1468 pub fn LLVMRustGetLastError() -> *c_char;
1469
1470 /// Print the pass timings since static dtors aren't picking them up.
1471 pub fn LLVMRustPrintPassTimings();
1472
1473 pub fn LLVMStructCreateNamed(C: ContextRef, Name: *c_char) -> TypeRef;
1474
1475 pub fn LLVMStructSetBody(StructTy: TypeRef,
1476 ElementTypes: *TypeRef,
1477 ElementCount: c_uint,
1478 Packed: Bool);
1479
1480 pub fn LLVMConstNamedStruct(S: TypeRef,
1481 ConstantVals: *ValueRef,
1482 Count: c_uint)
1483 -> ValueRef;
1484
1485 /** Enables LLVM debug output. */
1486 pub fn LLVMSetDebug(Enabled: c_int);
1487
1488 /** Prepares inline assembly. */
1489 pub fn LLVMInlineAsm(Ty: TypeRef,
1490 AsmString: *c_char,
1491 Constraints: *c_char,
1492 SideEffects: Bool,
1493 AlignStack: Bool,
1494 Dialect: c_uint)
1495 -> ValueRef;
1496
1497 pub static LLVMRustDebugMetadataVersion: u32;
1498
1499 pub fn LLVMRustAddModuleFlag(M: ModuleRef,
1500 name: *c_char,
1501 value: u32);
1502
1503 pub fn LLVMDIBuilderCreate(M: ModuleRef) -> DIBuilderRef;
1504
1505 pub fn LLVMDIBuilderDispose(Builder: DIBuilderRef);
1506
1507 pub fn LLVMDIBuilderFinalize(Builder: DIBuilderRef);
1508
1509 pub fn LLVMDIBuilderCreateCompileUnit(Builder: DIBuilderRef,
1510 Lang: c_uint,
1511 File: *c_char,
1512 Dir: *c_char,
1513 Producer: *c_char,
1514 isOptimized: bool,
1515 Flags: *c_char,
1516 RuntimeVer: c_uint,
1517 SplitName: *c_char);
1518
1519 pub fn LLVMDIBuilderCreateFile(Builder: DIBuilderRef,
1520 Filename: *c_char,
1521 Directory: *c_char)
1522 -> DIFile;
1523
1524 pub fn LLVMDIBuilderCreateSubroutineType(Builder: DIBuilderRef,
1525 File: DIFile,
1526 ParameterTypes: DIArray)
1527 -> DICompositeType;
1528
1529 pub fn LLVMDIBuilderCreateFunction(Builder: DIBuilderRef,
1530 Scope: DIDescriptor,
1531 Name: *c_char,
1532 LinkageName: *c_char,
1533 File: DIFile,
1534 LineNo: c_uint,
1535 Ty: DIType,
1536 isLocalToUnit: bool,
1537 isDefinition: bool,
1538 ScopeLine: c_uint,
1539 Flags: c_uint,
1540 isOptimized: bool,
1541 Fn: ValueRef,
1542 TParam: ValueRef,
1543 Decl: ValueRef)
1544 -> DISubprogram;
1545
1546 pub fn LLVMDIBuilderCreateBasicType(Builder: DIBuilderRef,
1547 Name: *c_char,
1548 SizeInBits: c_ulonglong,
1549 AlignInBits: c_ulonglong,
1550 Encoding: c_uint)
1551 -> DIBasicType;
1552
1553 pub fn LLVMDIBuilderCreatePointerType(Builder: DIBuilderRef,
1554 PointeeTy: DIType,
1555 SizeInBits: c_ulonglong,
1556 AlignInBits: c_ulonglong,
1557 Name: *c_char)
1558 -> DIDerivedType;
1559
1560 pub fn LLVMDIBuilderCreateStructType(Builder: DIBuilderRef,
1561 Scope: DIDescriptor,
1562 Name: *c_char,
1563 File: DIFile,
1564 LineNumber: c_uint,
1565 SizeInBits: c_ulonglong,
1566 AlignInBits: c_ulonglong,
1567 Flags: c_uint,
1568 DerivedFrom: DIType,
1569 Elements: DIArray,
1570 RunTimeLang: c_uint,
1571 VTableHolder: ValueRef,
1572 UniqueId: *c_char)
1573 -> DICompositeType;
1574
1575 pub fn LLVMDIBuilderCreateMemberType(Builder: DIBuilderRef,
1576 Scope: DIDescriptor,
1577 Name: *c_char,
1578 File: DIFile,
1579 LineNo: c_uint,
1580 SizeInBits: c_ulonglong,
1581 AlignInBits: c_ulonglong,
1582 OffsetInBits: c_ulonglong,
1583 Flags: c_uint,
1584 Ty: DIType)
1585 -> DIDerivedType;
1586
1587 pub fn LLVMDIBuilderCreateLexicalBlock(Builder: DIBuilderRef,
1588 Scope: DIDescriptor,
1589 File: DIFile,
1590 Line: c_uint,
1591 Col: c_uint,
1592 Discriminator: c_uint)
1593 -> DILexicalBlock;
1594
1595 pub fn LLVMDIBuilderCreateStaticVariable(Builder: DIBuilderRef,
1596 Context: DIDescriptor,
1597 Name: *c_char,
1598 LinkageName: *c_char,
1599 File: DIFile,
1600 LineNo: c_uint,
1601 Ty: DIType,
1602 isLocalToUnit: bool,
1603 Val: ValueRef,
1604 Decl: ValueRef)
1605 -> DIGlobalVariable;
1606
1607 pub fn LLVMDIBuilderCreateLocalVariable(Builder: DIBuilderRef,
1608 Tag: c_uint,
1609 Scope: DIDescriptor,
1610 Name: *c_char,
1611 File: DIFile,
1612 LineNo: c_uint,
1613 Ty: DIType,
1614 AlwaysPreserve: bool,
1615 Flags: c_uint,
1616 ArgNo: c_uint)
1617 -> DIVariable;
1618
1619 pub fn LLVMDIBuilderCreateArrayType(Builder: DIBuilderRef,
1620 Size: c_ulonglong,
1621 AlignInBits: c_ulonglong,
1622 Ty: DIType,
1623 Subscripts: DIArray)
1624 -> DIType;
1625
1626 pub fn LLVMDIBuilderCreateVectorType(Builder: DIBuilderRef,
1627 Size: c_ulonglong,
1628 AlignInBits: c_ulonglong,
1629 Ty: DIType,
1630 Subscripts: DIArray)
1631 -> DIType;
1632
1633 pub fn LLVMDIBuilderGetOrCreateSubrange(Builder: DIBuilderRef,
1634 Lo: c_longlong,
1635 Count: c_longlong)
1636 -> DISubrange;
1637
1638 pub fn LLVMDIBuilderGetOrCreateArray(Builder: DIBuilderRef,
1639 Ptr: *DIDescriptor,
1640 Count: c_uint)
1641 -> DIArray;
1642
1643 pub fn LLVMDIBuilderInsertDeclareAtEnd(Builder: DIBuilderRef,
1644 Val: ValueRef,
1645 VarInfo: DIVariable,
1646 InsertAtEnd: BasicBlockRef)
1647 -> ValueRef;
1648
1649 pub fn LLVMDIBuilderInsertDeclareBefore(Builder: DIBuilderRef,
1650 Val: ValueRef,
1651 VarInfo: DIVariable,
1652 InsertBefore: ValueRef)
1653 -> ValueRef;
1654
1655 pub fn LLVMDIBuilderCreateEnumerator(Builder: DIBuilderRef,
1656 Name: *c_char,
1657 Val: c_ulonglong)
1658 -> ValueRef;
1659
1660 pub fn LLVMDIBuilderCreateEnumerationType(Builder: DIBuilderRef,
1661 Scope: ValueRef,
1662 Name: *c_char,
1663 File: ValueRef,
1664 LineNumber: c_uint,
1665 SizeInBits: c_ulonglong,
1666 AlignInBits: c_ulonglong,
1667 Elements: ValueRef,
1668 ClassType: ValueRef)
1669 -> ValueRef;
1670
1671 pub fn LLVMDIBuilderCreateUnionType(Builder: DIBuilderRef,
1672 Scope: ValueRef,
1673 Name: *c_char,
1674 File: ValueRef,
1675 LineNumber: c_uint,
1676 SizeInBits: c_ulonglong,
1677 AlignInBits: c_ulonglong,
1678 Flags: c_uint,
1679 Elements: ValueRef,
1680 RunTimeLang: c_uint,
1681 UniqueId: *c_char)
1682 -> ValueRef;
1683
1684 pub fn LLVMSetUnnamedAddr(GlobalVar: ValueRef, UnnamedAddr: Bool);
1685
1686 pub fn LLVMDIBuilderCreateTemplateTypeParameter(Builder: DIBuilderRef,
1687 Scope: ValueRef,
1688 Name: *c_char,
1689 Ty: ValueRef,
1690 File: ValueRef,
1691 LineNo: c_uint,
1692 ColumnNo: c_uint)
1693 -> ValueRef;
1694
1695 pub fn LLVMDIBuilderCreateOpDeref(IntType: TypeRef) -> ValueRef;
1696
1697 pub fn LLVMDIBuilderCreateOpPlus(IntType: TypeRef) -> ValueRef;
1698
1699 pub fn LLVMDIBuilderCreateComplexVariable(Builder: DIBuilderRef,
1700 Tag: c_uint,
1701 Scope: ValueRef,
1702 Name: *c_char,
1703 File: ValueRef,
1704 LineNo: c_uint,
1705 Ty: ValueRef,
1706 AddrOps: *ValueRef,
1707 AddrOpsCount: c_uint,
1708 ArgNo: c_uint)
1709 -> ValueRef;
1710
1711 pub fn LLVMDIBuilderCreateNameSpace(Builder: DIBuilderRef,
1712 Scope: ValueRef,
1713 Name: *c_char,
1714 File: ValueRef,
1715 LineNo: c_uint)
1716 -> ValueRef;
1717
1718 pub fn LLVMDICompositeTypeSetTypeArray(CompositeType: ValueRef, TypeArray: ValueRef);
1719 pub fn LLVMTypeToString(Type: TypeRef) -> *c_char;
1720 pub fn LLVMValueToString(value_ref: ValueRef) -> *c_char;
1721
1722 pub fn LLVMIsAArgument(value_ref: ValueRef) -> ValueRef;
1723
1724 pub fn LLVMIsAAllocaInst(value_ref: ValueRef) -> ValueRef;
1725
1726 pub fn LLVMInitializeX86TargetInfo();
1727 pub fn LLVMInitializeX86Target();
1728 pub fn LLVMInitializeX86TargetMC();
1729 pub fn LLVMInitializeX86AsmPrinter();
1730 pub fn LLVMInitializeX86AsmParser();
1731 pub fn LLVMInitializeARMTargetInfo();
1732 pub fn LLVMInitializeARMTarget();
1733 pub fn LLVMInitializeARMTargetMC();
1734 pub fn LLVMInitializeARMAsmPrinter();
1735 pub fn LLVMInitializeARMAsmParser();
1736 pub fn LLVMInitializeMipsTargetInfo();
1737 pub fn LLVMInitializeMipsTarget();
1738 pub fn LLVMInitializeMipsTargetMC();
1739 pub fn LLVMInitializeMipsAsmPrinter();
1740 pub fn LLVMInitializeMipsAsmParser();
1741
1742 pub fn LLVMRustAddPass(PM: PassManagerRef, Pass: *c_char) -> bool;
1743 pub fn LLVMRustCreateTargetMachine(Triple: *c_char,
1744 CPU: *c_char,
1745 Features: *c_char,
1746 Model: CodeGenModel,
1747 Reloc: RelocMode,
1748 Level: CodeGenOptLevel,
1749 EnableSegstk: bool,
1750 UseSoftFP: bool,
1751 NoFramePointerElim: bool,
1752 FunctionSections: bool,
1753 DataSections: bool) -> TargetMachineRef;
1754 pub fn LLVMRustDisposeTargetMachine(T: TargetMachineRef);
1755 pub fn LLVMRustAddAnalysisPasses(T: TargetMachineRef,
1756 PM: PassManagerRef,
1757 M: ModuleRef);
1758 pub fn LLVMRustAddBuilderLibraryInfo(PMB: PassManagerBuilderRef,
1759 M: ModuleRef);
1760 pub fn LLVMRustAddLibraryInfo(PM: PassManagerRef, M: ModuleRef);
1761 pub fn LLVMRustRunFunctionPassManager(PM: PassManagerRef, M: ModuleRef);
1762 pub fn LLVMRustWriteOutputFile(T: TargetMachineRef,
1763 PM: PassManagerRef,
1764 M: ModuleRef,
1765 Output: *c_char,
1766 FileType: FileType) -> bool;
1767 pub fn LLVMRustPrintModule(PM: PassManagerRef,
1768 M: ModuleRef,
1769 Output: *c_char);
1770 pub fn LLVMRustSetLLVMOptions(Argc: c_int, Argv: **c_char);
1771 pub fn LLVMRustPrintPasses();
1772 pub fn LLVMRustSetNormalizedTarget(M: ModuleRef, triple: *c_char);
1773 pub fn LLVMRustAddAlwaysInlinePass(P: PassManagerBuilderRef,
1774 AddLifetimes: bool);
1775 pub fn LLVMRustLinkInExternalBitcode(M: ModuleRef,
1776 bc: *c_char,
1777 len: size_t) -> bool;
1778 pub fn LLVMRustRunRestrictionPass(M: ModuleRef,
1779 syms: **c_char,
1780 len: size_t);
1781 pub fn LLVMRustMarkAllFunctionsNounwind(M: ModuleRef);
1782
1783 pub fn LLVMRustOpenArchive(path: *c_char) -> ArchiveRef;
1784 pub fn LLVMRustArchiveReadSection(AR: ArchiveRef, name: *c_char,
1785 out_len: *mut size_t) -> *c_char;
1786 pub fn LLVMRustDestroyArchive(AR: ArchiveRef);
1787
1788 pub fn LLVMRustSetDLLExportStorageClass(V: ValueRef);
1789 pub fn LLVMVersionMinor() -> c_int;
1790
1791 pub fn LLVMRustGetSectionName(SI: SectionIteratorRef,
1792 data: *mut *c_char) -> c_int;
1793 }
1794 }
1795
1796 pub fn SetInstructionCallConv(instr: ValueRef, cc: CallConv) {
1797 unsafe {
1798 llvm::LLVMSetInstructionCallConv(instr, cc as c_uint);
1799 }
1800 }
1801 pub fn SetFunctionCallConv(fn_: ValueRef, cc: CallConv) {
1802 unsafe {
1803 llvm::LLVMSetFunctionCallConv(fn_, cc as c_uint);
1804 }
1805 }
1806 pub fn SetLinkage(global: ValueRef, link: Linkage) {
1807 unsafe {
1808 llvm::LLVMSetLinkage(global, link as c_uint);
1809 }
1810 }
1811
1812 pub fn SetUnnamedAddr(global: ValueRef, unnamed: bool) {
1813 unsafe {
1814 llvm::LLVMSetUnnamedAddr(global, unnamed as Bool);
1815 }
1816 }
1817
1818 pub fn set_thread_local(global: ValueRef, is_thread_local: bool) {
1819 unsafe {
1820 llvm::LLVMSetThreadLocal(global, is_thread_local as Bool);
1821 }
1822 }
1823
1824 pub fn ConstICmp(pred: IntPredicate, v1: ValueRef, v2: ValueRef) -> ValueRef {
1825 unsafe {
1826 llvm::LLVMConstICmp(pred as c_ushort, v1, v2)
1827 }
1828 }
1829 pub fn ConstFCmp(pred: RealPredicate, v1: ValueRef, v2: ValueRef) -> ValueRef {
1830 unsafe {
1831 llvm::LLVMConstFCmp(pred as c_ushort, v1, v2)
1832 }
1833 }
1834
1835 pub fn SetFunctionAttribute(fn_: ValueRef, attr: Attribute) {
1836 unsafe {
1837 llvm::LLVMAddFunctionAttr(fn_, attr as c_uint)
1838 }
1839 }
1840 /* Memory-managed object interface to type handles. */
1841
1842 pub struct TypeNames {
1843 named_types: RefCell<HashMap<~str, TypeRef>>,
1844 }
1845
1846 impl TypeNames {
1847 pub fn new() -> TypeNames {
1848 TypeNames {
1849 named_types: RefCell::new(HashMap::new())
1850 }
1851 }
1852
1853 pub fn associate_type(&self, s: &str, t: &Type) {
1854 assert!(self.named_types.borrow_mut().insert(s.to_owned(), t.to_ref()));
1855 }
1856
1857 pub fn find_type(&self, s: &str) -> Option<Type> {
1858 self.named_types.borrow().find_equiv(&s).map(|x| Type::from_ref(*x))
1859 }
1860
1861 pub fn type_to_str(&self, ty: Type) -> ~str {
1862 unsafe {
1863 let s = llvm::LLVMTypeToString(ty.to_ref());
1864 let ret = from_c_str(s);
1865 free(s as *mut c_void);
1866 ret
1867 }
1868 }
1869
1870 pub fn types_to_str(&self, tys: &[Type]) -> ~str {
1871 let strs: Vec<~str> = tys.iter().map(|t| self.type_to_str(*t)).collect();
1872 format!("[{}]", strs.connect(","))
1873 }
1874
1875 pub fn val_to_str(&self, val: ValueRef) -> ~str {
1876 unsafe {
1877 let s = llvm::LLVMValueToString(val);
1878 let ret = from_c_str(s);
1879 free(s as *mut c_void);
1880 ret
1881 }
1882 }
1883 }
1884
1885 /* Memory-managed interface to target data. */
1886
1887 pub struct TargetData {
1888 pub lltd: TargetDataRef
1889 }
1890
1891 impl Drop for TargetData {
1892 fn drop(&mut self) {
1893 unsafe {
1894 llvm::LLVMDisposeTargetData(self.lltd);
1895 }
1896 }
1897 }
1898
1899 pub fn mk_target_data(string_rep: &str) -> TargetData {
1900 TargetData {
1901 lltd: string_rep.with_c_str(|buf| {
1902 unsafe { llvm::LLVMCreateTargetData(buf) }
1903 })
1904 }
1905 }
1906
1907 /* Memory-managed interface to object files. */
1908
1909 pub struct ObjectFile {
1910 pub llof: ObjectFileRef,
1911 }
1912
1913 impl ObjectFile {
1914 // This will take ownership of llmb
1915 pub fn new(llmb: MemoryBufferRef) -> Option<ObjectFile> {
1916 unsafe {
1917 let llof = llvm::LLVMCreateObjectFile(llmb);
1918 if llof as int == 0 {
1919 // LLVMCreateObjectFile took ownership of llmb
1920 return None
1921 }
1922
1923 Some(ObjectFile {
1924 llof: llof,
1925 })
1926 }
1927 }
1928 }
1929
1930 impl Drop for ObjectFile {
1931 fn drop(&mut self) {
1932 unsafe {
1933 llvm::LLVMDisposeObjectFile(self.llof);
1934 }
1935 }
1936 }
1937
1938 /* Memory-managed interface to section iterators. */
1939
1940 pub struct SectionIter {
1941 pub llsi: SectionIteratorRef
1942 }
1943
1944 impl Drop for SectionIter {
1945 fn drop(&mut self) {
1946 unsafe {
1947 llvm::LLVMDisposeSectionIterator(self.llsi);
1948 }
1949 }
1950 }
1951
1952 pub fn mk_section_iter(llof: ObjectFileRef) -> SectionIter {
1953 unsafe {
1954 SectionIter {
1955 llsi: llvm::LLVMGetSections(llof)
1956 }
1957 }
1958 }
librustc/lib/llvm.rs:249:23-249:23 -NK_AS_STR_TODO- definition:
pub enum Use_opaque {}
pub type UseRef = *Use_opaque;
pub enum TargetData_opaque {}
references:- 7433: pub fn LLVMGetUser(U: UseRef) -> ValueRef;
434: pub fn LLVMGetUsedValue(U: UseRef) -> ValueRef;
librustc/middle/trans/value.rs:
132: impl Use {
133: pub fn get(&self) -> UseRef {
134: let Use(v) = *self; v
librustc/lib/llvm.rs:
431: pub fn LLVMGetFirstUse(Val: ValueRef) -> UseRef;
432: pub fn LLVMGetNextUse(U: UseRef) -> UseRef;
433: pub fn LLVMGetUser(U: UseRef) -> ValueRef;
librustc/lib/llvm.rs:271:4-271:4 -NK_AS_STR_TODO- definition:
pub type DIScope = DIDescriptor;
pub type DILocation = DIDescriptor;
pub type DIFile = DIScope;
references:- 22272: pub type DILocation = DIDescriptor;
273: pub type DIFile = DIScope;
274: pub type DILexicalBlock = DIScope;
275: pub type DISubprogram = DIScope;
276: pub type DIType = DIDescriptor;
librustc/middle/trans/debuginfo.rs:
2261: enum DebugLocation {
2262: KnownLocation { scope: DIScope, line: uint, col: uint },
2263: UnknownLocation
--
2416: scope_stack: &mut Vec<ScopeStackEntry> ,
2417: scope_map: &mut HashMap<ast::NodeId, DIScope>,
2418: inner_walk: |&CrateContext,
--
2645: scope_stack: &mut Vec<ScopeStackEntry> ,
2646: scope_map: &mut HashMap<ast::NodeId, DIScope>) {
--
2836: name: ast::Name,
2837: scope: DIScope,
2838: parent: Option<Weak<NamespaceTreeNode>>,
librustc/lib/llvm.rs:259:33-259:33 -NK_AS_STR_TODO- definition:
pub enum TargetMachine_opaque {}
pub type TargetMachineRef = *TargetMachine_opaque;
pub enum Archive_opaque {}
references:- 71752: FunctionSections: bool,
1753: DataSections: bool) -> TargetMachineRef;
1754: pub fn LLVMRustDisposeTargetMachine(T: TargetMachineRef);
--
1761: pub fn LLVMRustRunFunctionPassManager(PM: PassManagerRef, M: ModuleRef);
1762: pub fn LLVMRustWriteOutputFile(T: TargetMachineRef,
1763: PM: PassManagerRef,
librustc/back/link.rs:
70: sess: &Session,
71: target: lib::llvm::TargetMachineRef,
72: pm: lib::llvm::PassManagerRef,
--
259: // used once.
260: fn with_codegen(tm: TargetMachineRef, llmod: ModuleRef,
261: f: |PassManagerRef|) {
librustc/back/lto.rs:
21: pub fn run(sess: &session::Session, llmod: ModuleRef,
22: tm: TargetMachineRef, reachable: &[~str]) {
23: if sess.opts.cg.prefer_dynamic {
librustc/lib/llvm.rs:
1753: DataSections: bool) -> TargetMachineRef;
1754: pub fn LLVMRustDisposeTargetMachine(T: TargetMachineRef);
1755: pub fn LLVMRustAddAnalysisPasses(T: TargetMachineRef,
librustc/lib/llvm.rs:243:32-243:32 -NK_AS_STR_TODO- definition:
pub enum MemoryBuffer_opaque {}
pub type MemoryBufferRef = *MemoryBuffer_opaque;
pub enum PassManager_opaque {}
references:- 61427: /** Opens an object file. */
1428: pub fn LLVMCreateObjectFile(MemBuf: MemoryBufferRef) -> ObjectFileRef;
1429: /** Closes an object file. */
--
1914: // This will take ownership of llmb
1915: pub fn new(llmb: MemoryBufferRef) -> Option<ObjectFile> {
1916: unsafe {
librustc/lib/llvm.rs:268:4-268:4 -NK_AS_STR_TODO- definition:
pub type DIBuilderRef = *DIBuilder_opaque;
pub type DIDescriptor = ValueRef;
pub type DIScope = DIDescriptor;
references:- 291505: pub fn LLVMDIBuilderDispose(Builder: DIBuilderRef);
--
1607: pub fn LLVMDIBuilderCreateLocalVariable(Builder: DIBuilderRef,
1608: Tag: c_uint,
--
1649: pub fn LLVMDIBuilderInsertDeclareBefore(Builder: DIBuilderRef,
1650: Val: ValueRef,
--
1711: pub fn LLVMDIBuilderCreateNameSpace(Builder: DIBuilderRef,
1712: Scope: ValueRef,
librustc/middle/trans/debuginfo.rs:
178: llcontext: ContextRef,
179: builder: DIBuilderRef,
180: current_debug_location: Cell<DebugLocation>,
--
2344: fn DIB(cx: &CrateContext) -> DIBuilderRef {
2345: cx.dbg_cx.get_ref().builder
librustc/lib/llvm.rs:
1546: pub fn LLVMDIBuilderCreateBasicType(Builder: DIBuilderRef,
1547: Name: *c_char,
librustc/lib/llvm.rs:231:27-231:27 -NK_AS_STR_TODO- definition:
pub enum Context_opaque {}
pub type ContextRef = *Context_opaque;
pub enum Type_opaque {}
references:- 32librustc/middle/trans/context.rs:
librustc/middle/trans/debuginfo.rs:
librustc/driver/driver.rs:
librustc/lib/llvm.rs:
librustc/lib/llvm.rs:229:26-229:26 -NK_AS_STR_TODO- definition:
pub enum Module_opaque {}
pub type ModuleRef = *Module_opaque;
pub enum Context_opaque {}
references:- 51librustc/middle/trans/context.rs:
librustc/middle/trans/builder.rs:
librustc/middle/trans/base.rs:
librustc/middle/trans/debuginfo.rs:
librustc/back/link.rs:
librustc/back/lto.rs:
librustc/driver/driver.rs:
librustc/lib/llvm.rs:
librustc/lib/llvm.rs:280:4-280:4 -NK_AS_STR_TODO- definition:
pub type DIVariable = DIDescriptor;
pub type DIGlobalVariable = DIDescriptor;
pub type DIArray = DIDescriptor;
references:- 31644: Val: ValueRef,
1645: VarInfo: DIVariable,
1646: InsertAtEnd: BasicBlockRef)
--
1650: Val: ValueRef,
1651: VarInfo: DIVariable,
1652: InsertBefore: ValueRef)
librustc/lib/llvm.rs:1805:2-1805:2 -fn- definition:
}
pub fn SetLinkage(global: ValueRef, link: Linkage) {
unsafe {
references:- 14librustc/middle/trans/inline.rs:
70: "address_insignificant") {
71: SetLinkage(g, AvailableExternallyLinkage);
72: }
librustc/middle/trans/glue.rs:
463: lib::llvm::SetLinkage(llfn, lib::llvm::InternalLinkage);
464: ccx.stats.n_glues_created.set(ccx.stats.n_glues_created.get() + 1u);
--
521: llvm::LLVMSetGlobalConstant(gvar, True);
522: lib::llvm::SetLinkage(gvar, lib::llvm::InternalLinkage);
523: }
librustc/middle/trans/common.rs:
565: llvm::LLVMSetGlobalConstant(g, True);
566: lib::llvm::SetLinkage(g, lib::llvm::InternalLinkage);
--
593: llvm::LLVMSetGlobalConstant(g, True);
594: lib::llvm::SetLinkage(g, lib::llvm::InternalLinkage);
librustc/middle/trans/consts.rs:
113: llvm::LLVMSetGlobalConstant(gv, True);
114: SetLinkage(gv, PrivateLinkage);
115: gv
--
588: if store == ast::ExprVstoreMutSlice { False } else { True });
589: SetLinkage(gv, PrivateLinkage);
590: let p = const_ptrcast(cx, gv, llunitty);
librustc/middle/trans/base.rs:
1891: if !ccx.reachable.contains(&id) {
1892: lib::llvm::SetLinkage(g, lib::llvm::InternalLinkage);
1893: }
--
2059: if !foreign && !ccx.reachable.contains(&id) {
2060: lib::llvm::SetLinkage(val, lib::llvm::InternalLinkage);
2061: }
librustc/middle/trans/meth.rs:
480: llvm::LLVMSetGlobalConstant(vt_gvar, lib::llvm::True);
481: lib::llvm::SetLinkage(vt_gvar, lib::llvm::InternalLinkage);
482: vt_gvar
librustc/middle/trans/foreign.rs:
169: });
170: lib::llvm::SetLinkage(g2, lib::llvm::InternalLinkage);
171: llvm::LLVMSetInitializer(g2, g1);
librustc/middle/trans/base.rs:
1698: if !ccx.reachable.contains(&node_id) {
1699: lib::llvm::SetLinkage(llfn, lib::llvm::InternalLinkage);
1700: }
librustc/lib/llvm.rs:276:4-276:4 -NK_AS_STR_TODO- definition:
pub type DIType = DIDescriptor;
pub type DIBasicType = DIType;
pub type DIDerivedType = DIType;
references:- 27276: pub type DIType = DIDescriptor;
277: pub type DIBasicType = DIType;
278: pub type DIDerivedType = DIType;
--
1630: Subscripts: DIArray)
1631: -> DIType;
librustc/middle/trans/debuginfo.rs:
186: // members only set once:
187: composite_types_completed: RefCell<HashSet<DIType>>,
188: }
--
2086: let mut signature_metadata: Vec<DIType> =
2087: Vec::with_capacity(signature.inputs.len() + 1);
--
2144: usage_site_span: Span)
2145: -> DIType {
2146: let cache_id = cache_id_for_type(t);
--
2155: type_in_box: ty::t)
2156: -> DIType {
2157: let content_type_name: &str = ppaux::ty_to_str(cx.tcx(), type_in_box);
librustc/lib/llvm.rs:273:4-273:4 -NK_AS_STR_TODO- definition:
pub type DIFile = DIScope;
pub type DILexicalBlock = DIScope;
pub type DISubprogram = DIScope;
references:- 171521: Directory: *c_char)
1522: -> DIFile;
--
1610: Name: *c_char,
1611: File: DIFile,
1612: LineNo: c_uint,
librustc/middle/trans/debuginfo.rs:
1397: containing_scope: DIScope,
1398: file_metadata: DIFile,
1399: span: Span,
--
1470: containing_scope: DIScope,
1471: file_metadata: DIFile,
1472: span: Span)
--
1814: containing_scope: DIScope,
1815: file_metadata: DIFile,
1816: definition_span: Span)
librustc/lib/llvm.rs:
1577: Name: *c_char,
1578: File: DIFile,
1579: LineNo: c_uint,
librustc/lib/llvm.rs:245:31-245:31 -NK_AS_STR_TODO- definition:
pub enum PassManager_opaque {}
pub type PassManagerRef = *PassManager_opaque;
pub enum PassManagerBuilder_opaque {}
references:- 57librustc/back/link.rs:
librustc/lib/llvm.rs:282:4-282:4 -NK_AS_STR_TODO- definition:
pub type DIArray = DIDescriptor;
pub type DISubrange = DIDescriptor;
pub enum DIDescriptorFlags {
references:- 81629: Ty: DIType,
1630: Subscripts: DIArray)
1631: -> DIType;
--
1640: Count: c_uint)
1641: -> DIArray;
librustc/middle/trans/debuginfo.rs:
834: name_to_append_suffix_to: &mut StrBuf)
835: -> DIArray {
836: let self_type = match param_substs {
--
950: fn create_DIArray(builder: DIBuilderRef, arr: &[DIDescriptor]) -> DIArray {
951: return unsafe {
librustc/lib/llvm.rs:1811:1-1811:1 -fn- definition:
pub fn SetUnnamedAddr(global: ValueRef, unnamed: bool) {
unsafe {
llvm::LLVMSetUnnamedAddr(global, unnamed as Bool);
references:- 2librustc/middle/trans/base.rs:
192: // Function addresses in Rust are never significant, allowing functions to be merged.
193: lib::llvm::SetUnnamedAddr(llfn, true);
194: set_split_stack(llfn);
--
1902: }
1903: lib::llvm::SetUnnamedAddr(g, true);
librustc/lib/llvm.rs:261:27-261:27 -NK_AS_STR_TODO- definition:
pub enum Archive_opaque {}
pub type ArchiveRef = *Archive_opaque;
pub mod debuginfo {
references:- 41783: pub fn LLVMRustOpenArchive(path: *c_char) -> ArchiveRef;
1784: pub fn LLVMRustArchiveReadSection(AR: ArchiveRef, name: *c_char,
1785: out_len: *mut size_t) -> *c_char;
1786: pub fn LLVMRustDestroyArchive(AR: ArchiveRef);
librustc/back/archive.rs:
35: pub struct ArchiveRO {
36: ptr: ArchiveRef,
37: }
librustc/lib/llvm.rs:
1783: pub fn LLVMRustOpenArchive(path: *c_char) -> ArchiveRef;
1784: pub fn LLVMRustArchiveReadSection(AR: ArchiveRef, name: *c_char,
librustc/lib/llvm.rs:255:35-255:35 -NK_AS_STR_TODO- definition:
pub enum SectionIterator_opaque {}
pub type SectionIteratorRef = *SectionIterator_opaque;
pub enum Pass_opaque {}
references:- 81445: /** Returns the current section contents as a string buffer. */
1446: pub fn LLVMGetSectionContents(SI: SectionIteratorRef) -> *c_char;
--
1791: pub fn LLVMRustGetSectionName(SI: SectionIteratorRef,
1792: data: *mut *c_char) -> c_int;
--
1940: pub struct SectionIter {
1941: pub llsi: SectionIteratorRef
1942: }
librustc/lib/llvm.rs:235:25-235:25 -NK_AS_STR_TODO- definition:
pub enum Value_opaque {}
pub type ValueRef = *Value_opaque;
pub enum BasicBlock_opaque {}
references:- 1436librustc/middle/trans/monomorphize.rs:
librustc/middle/trans/controlflow.rs:
librustc/middle/trans/glue.rs:
librustc/middle/trans/datum.rs:
librustc/middle/trans/callee.rs:
librustc/middle/trans/expr.rs:
librustc/middle/trans/common.rs:
librustc/middle/trans/context.rs:
librustc/middle/trans/consts.rs:
librustc/middle/trans/build.rs:
librustc/middle/trans/builder.rs:
librustc/middle/trans/base.rs:
librustc/middle/trans/_match.rs:
librustc/middle/trans/closure.rs:
librustc/middle/trans/tvec.rs:
librustc/middle/trans/meth.rs:
librustc/middle/trans/foreign.rs:
librustc/middle/trans/intrinsic.rs:
librustc/middle/trans/reflect.rs:
librustc/middle/trans/debuginfo.rs:
librustc/middle/trans/machine.rs:
librustc/middle/trans/adt.rs:
librustc/middle/trans/value.rs:
librustc/middle/trans/llrepr.rs:
librustc/middle/trans/cleanup.rs:
librustc/middle/trans/builder.rs:
librustc/lib/llvm.rs:195:22-195:22 -enum- definition:
// Inline Asm Dialect
pub enum AsmDialect {
AD_ATT = 0,
references:- 2librustc/middle/trans/builder.rs:
777: volatile: bool, alignstack: bool,
778: dia: AsmDialect) -> ValueRef {
779: self.count_insn("inlineasm");
librustc/middle/trans/build.rs:
676: volatile: bool, alignstack: bool,
677: dia: AsmDialect) -> ValueRef {
678: B(cx).inline_asm_call(asm, cons, inputs, output, volatile, alignstack, dia)
librustc/lib/llvm.rs:278:4-278:4 -NK_AS_STR_TODO- definition:
pub type DIDerivedType = DIType;
pub type DICompositeType = DIDerivedType;
pub type DIVariable = DIDescriptor;
references:- 31584: Ty: DIType)
1585: -> DIDerivedType;
librustc/lib/llvm.rs:275:4-275:4 -NK_AS_STR_TODO- definition:
pub type DISubprogram = DIScope;
pub type DIType = DIDescriptor;
pub type DIBasicType = DIType;
references:- 31543: Decl: ValueRef)
1544: -> DISubprogram;
librustc/middle/trans/debuginfo.rs:
243: scope_map: RefCell<HashMap<ast::NodeId, DIScope>>,
244: fn_metadata: DISubprogram,
245: argument_counter: Cell<uint>,
--
2383: fn_entry_block: &ast::Block,
2384: fn_metadata: DISubprogram,
2385: scope_map: &mut HashMap<ast::NodeId, DIScope>) {
librustc/lib/llvm.rs:152:11-152:11 -enum- definition:
pub enum AtomicBinOp {
Xchg = 0,
Add = 1,
references:- 3librustc/middle/trans/build.rs:
820: }
821: pub fn AtomicRMW(cx: &Block, op: AtomicBinOp,
822: dst: ValueRef, src: ValueRef,
librustc/middle/trans/builder.rs:
958: }
959: pub fn atomic_rmw(&self, op: AtomicBinOp,
960: dst: ValueRef, src: ValueRef,
librustc/lib/llvm.rs:
1268: pub fn LLVMBuildAtomicRMW(B: BuilderRef,
1269: Op: AtomicBinOp,
1270: LHS: ValueRef,
librustc/lib/llvm.rs:50:57-50:57 -enum- definition:
// they've been removed in upstream LLVM commit r203866.
pub enum Linkage {
ExternalLinkage = 0,
references:- 2librustc/middle/trans/foreign.rs:
107: pub fn llvm_linkage_by_name(name: &str) -> Option<Linkage> {
108: // Use the names from src/llvm/docs/LangRef.rst here. Most types are only
librustc/lib/llvm.rs:
1805: }
1806: pub fn SetLinkage(global: ValueRef, link: Linkage) {
1807: unsafe {
librustc/lib/llvm.rs:1908:1-1908:1 -struct- definition:
pub struct ObjectFile {
pub llof: ObjectFileRef,
}
references:- 41923: Some(ObjectFile {
1924: llof: llof,
--
1930: impl Drop for ObjectFile {
1931: fn drop(&mut self) {
librustc/lib/llvm.rs:251:30-251:30 -NK_AS_STR_TODO- definition:
pub enum TargetData_opaque {}
pub type TargetDataRef = *TargetData_opaque;
pub enum ObjectFile_opaque {}
references:- 111319: */
1320: pub fn LLVMCallFrameAlignmentOfType(TD: TargetDataRef, Ty: TypeRef)
1321: -> c_uint;
--
1323: /** Disposes target data. */
1324: pub fn LLVMDisposeTargetData(TD: TargetDataRef);
--
1887: pub struct TargetData {
1888: pub lltd: TargetDataRef
1889: }
librustc/lib/llvm.rs:1834:1-1834:1 -fn- definition:
pub fn SetFunctionAttribute(fn_: ValueRef, attr: Attribute) {
unsafe {
llvm::LLVMAddFunctionAttr(fn_, attr as c_uint)
references:- 6librustc/middle/trans/base.rs:
413: pub fn set_no_inline(f: ValueRef) {
414: lib::llvm::SetFunctionAttribute(f, lib::llvm::NoInlineAttribute)
415: }
--
452: pub fn set_always_inline(f: ValueRef) {
453: lib::llvm::SetFunctionAttribute(f, lib::llvm::AlwaysInlineAttribute)
454: }
librustc/lib/llvm.rs:237:30-237:30 -NK_AS_STR_TODO- definition:
pub enum BasicBlock_opaque {}
pub type BasicBlockRef = *BasicBlock_opaque;
pub enum Builder_opaque {}
references:- 80librustc/middle/trans/common.rs:
librustc/middle/trans/build.rs:
librustc/middle/trans/builder.rs:
librustc/middle/trans/base.rs:
librustc/middle/trans/_match.rs:
librustc/middle/trans/basic_block.rs:
librustc/middle/trans/cleanup.rs:
librustc/middle/trans/builder.rs:
librustc/lib/llvm.rs:241:35-241:35 -NK_AS_STR_TODO- definition:
pub enum ExecutionEngine_opaque {}
pub type ExecutionEngineRef = *ExecutionEngine_opaque;
pub enum MemoryBuffer_opaque {}
references:- 2410: pub fn LLVMGetPointerAddressSpace(PointerTy: TypeRef) -> c_uint;
411: pub fn LLVMGetPointerToGlobal(EE: ExecutionEngineRef, V: ValueRef)
412: -> *();
--
822: pub fn LLVMDisposeBuilder(Builder: BuilderRef);
823: pub fn LLVMDisposeExecutionEngine(EE: ExecutionEngineRef);
librustc/lib/llvm.rs:23:23-23:23 -NK_AS_STR_TODO- definition:
pub type Opcode = u32;
pub type Bool = c_uint;
pub static True: Bool = 1 as Bool;
references:- 58librustc/middle/trans/common.rs:
librustc/middle/trans/consts.rs:
librustc/middle/trans/build.rs:
librustc/middle/trans/builder.rs:
librustc/middle/trans/type_.rs:
librustc/lib/llvm.rs:
librustc/lib/llvm.rs:31:16-31:16 -enum- definition:
pub enum CallConv {
CCallConv = 0,
FastCallConv = 8,
references:- 111796: pub fn SetInstructionCallConv(instr: ValueRef, cc: CallConv) {
1797: unsafe {
--
1800: }
1801: pub fn SetFunctionCallConv(fn_: ValueRef, cc: CallConv) {
1802: unsafe {
librustc/middle/trans/build.rs:
687: pub fn CallWithConv(cx: &Block, fn_: ValueRef, args: &[ValueRef], conv: CallConv,
688: attributes: &[(uint, lib::llvm::Attribute)]) -> ValueRef {
librustc/middle/trans/builder.rs:
821: pub fn call_with_conv(&self, llfn: ValueRef, args: &[ValueRef],
822: conv: CallConv, attributes: &[(uint, lib::llvm::Attribute)]) -> ValueRef {
823: self.count_insn("callwithconv");
librustc/middle/trans/base.rs:
208: pub fn get_extern_fn(externs: &mut ExternMap, llmod: ModuleRef,
209: name: &str, cc: lib::llvm::CallConv,
210: ty: Type, output: ty::t) -> ValueRef {
--
1734: node_id: ast::NodeId,
1735: cc: lib::llvm::CallConv,
1736: fn_ty: Type,
librustc/middle/trans/foreign.rs:
75: pub fn llvm_calling_convention(ccx: &CrateContext,
76: abi: Abi) -> Option<CallConv> {
77: let os = ccx.sess().targ_cfg.os;
librustc/lib/llvm.rs:
32: pub enum CallConv {
librustc/lib/llvm.rs:65:19-65:19 -enum- definition:
pub enum Attribute {
ZExtAttribute = 1 << 0,
SExtAttribute = 1 << 1,
references:- 1466: pub enum Attribute {
--
1835: pub fn SetFunctionAttribute(fn_: ValueRef, attr: Attribute) {
1836: unsafe {
librustc/middle/trans/build.rs:
687: pub fn CallWithConv(cx: &Block, fn_: ValueRef, args: &[ValueRef], conv: CallConv,
688: attributes: &[(uint, lib::llvm::Attribute)]) -> ValueRef {
689: if cx.unreachable.get() { return _UndefReturn(cx, fn_); }
librustc/middle/trans/builder.rs:
800: pub fn call(&self, llfn: ValueRef, args: &[ValueRef],
801: attributes: &[(uint, lib::llvm::Attribute)]) -> ValueRef {
802: self.count_insn("call");
--
821: pub fn call_with_conv(&self, llfn: ValueRef, args: &[ValueRef],
822: conv: CallConv, attributes: &[(uint, lib::llvm::Attribute)]) -> ValueRef {
823: self.count_insn("callwithconv");
librustc/middle/trans/base.rs:
885: llargs: Vec<ValueRef> ,
886: attributes: &[(uint, lib::llvm::Attribute)],
887: call_info: Option<NodeInfo>)
librustc/middle/trans/cabi.rs:
51: pad: option::Option<Type>,
52: attr: option::Option<Attribute>) -> ArgType {
53: ArgType {
--
62: pub fn indirect(ty: Type, attr: option::Option<Attribute>) -> ArgType {
63: ArgType {
librustc/middle/trans/cabi_x86_64.rs:
339: is_mem_cls: |cls: &[RegClass]| -> bool,
340: attr: Attribute)
341: -> ArgType {
librustc/middle/trans/cabi.rs:
45: /// LLVM attribute of argument
46: pub attr: option::Option<Attribute>
47: }
librustc/lib/llvm.rs:253:30-253:30 -NK_AS_STR_TODO- definition:
pub enum ObjectFile_opaque {}
pub type ObjectFileRef = *ObjectFile_opaque;
pub enum SectionIterator_opaque {}
references:- 61429: /** Closes an object file. */
1430: pub fn LLVMDisposeObjectFile(ObjFile: ObjectFileRef);
--
1952: pub fn mk_section_iter(llof: ObjectFileRef) -> SectionIter {
1953: unsafe {
librustc/lib/llvm.rs:1828:2-1828:2 -fn- definition:
}
pub fn ConstFCmp(pred: RealPredicate, v1: ValueRef, v2: ValueRef) -> ValueRef {
unsafe {
references:- 6librustc/middle/trans/consts.rs:
379: ast::BiGt => {
380: if is_float { ConstFCmp(RealOGT, te1, te2) }
381: else {
librustc/lib/llvm.rs:1823:1-1823:1 -fn- definition:
pub fn ConstICmp(pred: IntPredicate, v1: ValueRef, v2: ValueRef) -> ValueRef {
unsafe {
llvm::LLVMConstICmp(pred as c_ushort, v1, v2)
references:- 10librustc/middle/trans/consts.rs:
381: else {
382: if signed { ConstICmp(IntSGT, te1, te2) }
383: else { ConstICmp(IntUGT, te1, te2) }
384: }
librustc/lib/llvm.rs:22:1-22:1 -NK_AS_STR_TODO- definition:
pub type Opcode = u32;
pub type Bool = c_uint;
pub static True: Bool = 1 as Bool;
references:- 61152: pub fn LLVMBuildCast(B: BuilderRef,
1153: Op: Opcode,
1154: Val: ValueRef,
librustc/middle/trans/build.rs:
271: pub fn BinOp(cx: &Block, op: Opcode, lhs: ValueRef, rhs: ValueRef)
272: -> ValueRef {
--
579: pub fn Cast(cx: &Block, op: Opcode, val: ValueRef, dest_ty: Type, _: *u8)
580: -> ValueRef {
librustc/middle/trans/builder.rs:
688: pub fn cast(&self, op: Opcode, val: ValueRef, dest_ty: Type) -> ValueRef {
689: self.count_insn("cast");
librustc/lib/llvm.rs:109:40-109:40 -enum- definition:
// enum for the LLVM RealPredicate type
pub enum RealPredicate {
RealPredicateFalse = 0,
references:- 31828: }
1829: pub fn ConstFCmp(pred: RealPredicate, v1: ValueRef, v2: ValueRef) -> ValueRef {
1830: unsafe {
librustc/middle/trans/build.rs:
620: pub fn FCmp(cx: &Block, op: RealPredicate, lhs: ValueRef, rhs: ValueRef)
621: -> ValueRef {
librustc/middle/trans/builder.rs:
725: pub fn fcmp(&self, op: RealPredicate, lhs: ValueRef, rhs: ValueRef) -> ValueRef {
726: self.count_insn("fcmp");
librustc/lib/llvm.rs:279:4-279:4 -NK_AS_STR_TODO- definition:
pub type DICompositeType = DIDerivedType;
pub type DIVariable = DIDescriptor;
pub type DIGlobalVariable = DIDescriptor;
references:- 131572: UniqueId: *c_char)
1573: -> DICompositeType;
librustc/middle/trans/debuginfo.rs:
1316: fn finalize(&self, cx: &CrateContext) -> DICompositeType {
1317: match *self {
--
1816: definition_span: Span)
1817: -> DICompositeType {
1818: let loc = span_start(cx, definition_span);
--
2081: span: Span)
2082: -> DICompositeType {
2083: let loc = span_start(cx, span);
librustc/lib/llvm.rs:
1526: ParameterTypes: DIArray)
1527: -> DICompositeType;
librustc/lib/llvm.rs:202:11-202:11 -enum- definition:
pub enum CodeGenOptLevel {
CodeGenLevelNone = 0,
CodeGenLevelLess = 1,
references:- 51747: Reloc: RelocMode,
1748: Level: CodeGenOptLevel,
1749: EnableSegstk: bool,
librustc/back/link.rs:
437: llmod: ModuleRef,
438: opt: lib::llvm::CodeGenOptLevel) {
439: // Create the PassManagerBuilder for LLVM. We configure it with
librustc/lib/llvm.rs:167:11-167:11 -enum- definition:
pub enum AtomicOrdering {
NotAtomic = 0,
Unordered = 1,
references:- 181271: RHS: ValueRef,
1272: Order: AtomicOrdering,
1273: SingleThreaded: Bool)
--
1276: pub fn LLVMBuildAtomicFence(B: BuilderRef, Order: AtomicOrdering);
librustc/middle/trans/build.rs:
817: order: AtomicOrdering,
818: failure_order: AtomicOrdering) -> ValueRef {
819: B(cx).atomic_cmpxchg(dst, cmp, src, order, failure_order)
--
822: dst: ValueRef, src: ValueRef,
823: order: AtomicOrdering) -> ValueRef {
824: B(cx).atomic_rmw(op, dst, src, order)
librustc/middle/trans/builder.rs:
960: dst: ValueRef, src: ValueRef,
961: order: AtomicOrdering) -> ValueRef {
962: unsafe {
--
967: pub fn atomic_fence(&self, order: AtomicOrdering) {
968: unsafe {
librustc/lib/llvm.rs:180:11-180:11 -enum- definition:
pub enum FileType {
AssemblyFile = 0,
ObjectFile = 1
references:- 21765: Output: *c_char,
1766: FileType: FileType) -> bool;
1767: pub fn LLVMRustPrintModule(PM: PassManagerRef,
librustc/back/link.rs:
74: output: &Path,
75: file_type: lib::llvm::FileType) {
76: unsafe {
librustc/lib/llvm.rs:233:24-233:24 -NK_AS_STR_TODO- definition:
pub enum Type_opaque {}
pub type TypeRef = *Type_opaque;
pub enum Value_opaque {}
references:- 132librustc/middle/trans/type_.rs:
librustc/lib/llvm.rs:
librustc/lib/llvm.rs:239:27-239:27 -NK_AS_STR_TODO- definition:
pub enum Builder_opaque {}
pub type BuilderRef = *Builder_opaque;
pub enum ExecutionEngine_opaque {}
references:- 107librustc/middle/trans/common.rs:
librustc/middle/trans/builder.rs:
librustc/lib/llvm.rs:
librustc/lib/llvm.rs:132:11-132:11 -enum- definition:
pub enum TypeKind {
Void = 0,
Half = 1,
references:- 5354: /** See llvm::LLVMTypeKind::getTypeID. */
355: pub fn LLVMGetTypeKind(Ty: TypeRef) -> TypeKind;
librustc/middle/trans/type_.rs:
240: pub fn kind(&self) -> TypeKind {
241: unsafe {
librustc/lib/llvm.rs:247:38-247:38 -NK_AS_STR_TODO- definition:
pub enum PassManagerBuilder_opaque {}
pub type PassManagerBuilderRef = *PassManagerBuilder_opaque;
pub enum Use_opaque {}
references:- 131772: pub fn LLVMRustSetNormalizedTarget(M: ModuleRef, triple: *c_char);
1773: pub fn LLVMRustAddAlwaysInlinePass(P: PassManagerBuilderRef,
1774: AddLifetimes: bool);
librustc/lib/llvm.rs:1886:1-1886:1 -struct- definition:
pub struct TargetData {
pub lltd: TargetDataRef
}
references:- 41899: pub fn mk_target_data(string_rep: &str) -> TargetData {
1900: TargetData {
1901: lltd: string_rep.with_c_str(|buf| {
librustc/middle/trans/context.rs:
56: pub metadata_llmod: ModuleRef,
57: pub td: TargetData,
58: pub tn: TypeNames,
librustc/lib/llvm.rs:
1891: impl Drop for TargetData {
1892: fn drop(&mut self) {
librustc/lib/llvm.rs:270:4-270:4 -NK_AS_STR_TODO- definition:
pub type DIDescriptor = ValueRef;
pub type DIScope = DIDescriptor;
pub type DILocation = DIDescriptor;
references:- 181575: pub fn LLVMDIBuilderCreateMemberType(Builder: DIBuilderRef,
1576: Scope: DIDescriptor,
1577: Name: *c_char,
--
1638: pub fn LLVMDIBuilderGetOrCreateArray(Builder: DIBuilderRef,
1639: Ptr: *DIDescriptor,
1640: Count: c_uint)
librustc/middle/trans/debuginfo.rs:
950: fn create_DIArray(builder: DIBuilderRef, arr: &[DIDescriptor]) -> DIArray {
951: return unsafe {
--
1775: let member_metadata: Vec<DIDescriptor> = member_descriptions
1776: .iter()
librustc/lib/llvm.rs:
271: pub type DIScope = DIDescriptor;
272: pub type DILocation = DIDescriptor;
273: pub type DIFile = DIScope;
librustc/lib/llvm.rs:95:39-95:39 -enum- definition:
// enum for the LLVM IntPredicate type
pub enum IntPredicate {
IntEQ = 32,
references:- 31824: pub fn ConstICmp(pred: IntPredicate, v1: ValueRef, v2: ValueRef) -> ValueRef {
1825: unsafe {
librustc/middle/trans/build.rs:
609: /* Comparisons */
610: pub fn ICmp(cx: &Block, op: IntPredicate, lhs: ValueRef, rhs: ValueRef)
611: -> ValueRef {
librustc/middle/trans/builder.rs:
717: /* Comparisons */
718: pub fn icmp(&self, op: IntPredicate, lhs: ValueRef, rhs: ValueRef) -> ValueRef {
719: self.count_insn("icmp");
librustc/lib/llvm.rs:1841:1-1841:1 -struct- definition:
pub struct TypeNames {
named_types: RefCell<HashMap<~str, TypeRef>>,
}
references:- 41847: pub fn new() -> TypeNames {
1848: TypeNames {
1849: named_types: RefCell::new(HashMap::new())
librustc/middle/trans/context.rs:
57: pub td: TargetData,
58: pub tn: TypeNames,
59: pub externs: RefCell<ExternMap>,
librustc/lib/llvm.rs:1939:1-1939:1 -struct- definition:
pub struct SectionIter {
pub llsi: SectionIteratorRef
}
references:- 31953: unsafe {
1954: SectionIter {
1955: llsi: llvm::LLVMGetSections(llof)