comparison tools/binding/llvm/c/Target.d @ 1651:cb960b882ca3 default tip

bindings were moved to dsource.org/projects/bindings/
author Moritz Warning <moritzwarning@web.de>
date Thu, 20 May 2010 20:05:03 +0200
parents 40bd4a0d4870
children
comparison
equal deleted inserted replaced
1650:40bd4a0d4870 1651:cb960b882ca3
1 // Converted to the D programming language by Tomas Lindquist Olsen 2008
2 // Original file header:
3 /*===-- llvm-c/Target.h - Target Lib C Iface --------------------*- C++ -*-===*\
4 |* *|
5 |* The LLVM Compiler Infrastructure *|
6 |* *|
7 |* This file is distributed under the University of Illinois Open Source *|
8 |* License. See LICENSE.TXT for details. *|
9 |* *|
10 |*===----------------------------------------------------------------------===*|
11 |* *|
12 |* This header declares the C interface to libLLVMTarget.a, which *|
13 |* implements target information. *|
14 |* *|
15 |* Many exotic languages can interoperate with C code but have a harder time *|
16 |* with C++ due to name mangling. So in addition to C, this interface enables *|
17 |* tools written in such languages. *|
18 |* *|
19 \*===----------------------------------------------------------------------===*/
20
21 module llvm.c.Target;
22
23 import llvm.c.Core;
24
25 extern(C):
26
27 enum { LLVMBigEndian, LLVMLittleEndian };
28 alias int LLVMByteOrdering;
29
30 typedef void* LLVMTargetDataRef;
31 typedef void* LLVMStructLayoutRef;
32
33
34 /*===-- Target Data -------------------------------------------------------===*/
35
36 /** Creates target data from a target layout string.
37 See the constructor llvm::TargetData::TargetData. */
38 LLVMTargetDataRef LLVMCreateTargetData( /*const*/ char *StringRep);
39
40 /** Adds target data information to a pass manager. This does not take ownership
41 of the target data.
42 See the method llvm::PassManagerBase::add. */
43 void LLVMAddTargetData(LLVMTargetDataRef, LLVMPassManagerRef);
44
45 /** Converts target data to a target layout string. The string must be disposed
46 with LLVMDisposeMessage.
47 See the constructor llvm::TargetData::TargetData. */
48 char *LLVMCopyStringRepOfTargetData(LLVMTargetDataRef);
49
50 /** Returns the byte order of a target, either LLVMBigEndian or
51 LLVMLittleEndian.
52 See the method llvm::TargetData::isLittleEndian. */
53 LLVMByteOrdering LLVMByteOrder(LLVMTargetDataRef);
54
55 /** Returns the pointer size in bytes for a target.
56 See the method llvm::TargetData::getPointerSize. */
57 uint LLVMPointerSize(LLVMTargetDataRef);
58
59 /** Returns the integer type that is the same size as a pointer on a target.
60 See the method llvm::TargetData::getIntPtrType. */
61 LLVMTypeRef LLVMIntPtrType(LLVMTargetDataRef);
62
63 /** Computes the size of a type in bytes for a target.
64 See the method llvm::TargetData::getTypeSizeInBits. */
65 ulong LLVMSizeOfTypeInBits(LLVMTargetDataRef, LLVMTypeRef);
66
67 /** Computes the storage size of a type in bytes for a target.
68 See the method llvm::TargetData::getTypeStoreSize. */
69 ulong LLVMStoreSizeOfType(LLVMTargetDataRef, LLVMTypeRef);
70
71 /** Computes the ABI size of a type in bytes for a target.
72 See the method llvm::TargetData::getABITypeSize. */
73 ulong LLVMABISizeOfType(LLVMTargetDataRef, LLVMTypeRef);
74
75 /** Computes the ABI alignment of a type in bytes for a target.
76 See the method llvm::TargetData::getTypeABISize. */
77 uint LLVMABIAlignmentOfType(LLVMTargetDataRef, LLVMTypeRef);
78
79 /** Computes the call frame alignment of a type in bytes for a target.
80 See the method llvm::TargetData::getTypeABISize. */
81 uint LLVMCallFrameAlignmentOfType(LLVMTargetDataRef, LLVMTypeRef);
82
83 /** Computes the preferred alignment of a type in bytes for a target.
84 See the method llvm::TargetData::getTypeABISize. */
85 uint LLVMPreferredAlignmentOfType(LLVMTargetDataRef, LLVMTypeRef);
86
87 /** Computes the preferred alignment of a global variable in bytes for a target.
88 See the method llvm::TargetData::getPreferredAlignment. */
89 uint LLVMPreferredAlignmentOfGlobal(LLVMTargetDataRef,
90 LLVMValueRef GlobalVar);
91
92 /** Computes the structure element that contains the byte offset for a target.
93 See the method llvm::StructLayout::getElementContainingOffset. */
94 uint LLVMElementAtOffset(LLVMTargetDataRef, LLVMTypeRef StructTy,
95 ulong Offset);
96
97 /** Computes the byte offset of the indexed struct element for a target.
98 See the method llvm::StructLayout::getElementContainingOffset. */
99 ulong LLVMOffsetOfElement(LLVMTargetDataRef, LLVMTypeRef StructTy,
100 uint Element);
101
102 /** Struct layouts are speculatively cached. If a TargetDataRef is alive when
103 types are being refined and removed, this method must be called whenever a
104 struct type is removed to avoid a dangling pointer in this cache.
105 See the method llvm::TargetData::InvalidateStructLayoutInfo. */
106 void LLVMInvalidateStructLayout(LLVMTargetDataRef, LLVMTypeRef StructTy);
107
108 /** Deallocates a TargetData.
109 See the destructor llvm::TargetData::~TargetData. */
110 void LLVMDisposeTargetData(LLVMTargetDataRef);