diff options
author | Duncan Sands <baldrick@free.fr> | 2009-05-21 15:52:21 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2009-05-21 15:52:21 +0000 |
commit | ef854af5bd231ae0c059eb4f07d13352d2a50a9d (patch) | |
tree | 1ffe037dbd917d3dc1434c1947079f899fcf51d8 /bindings | |
parent | e3e51c0038bd6ba2add82e2246e97edec0ab2204 (diff) | |
download | external_llvm-ef854af5bd231ae0c059eb4f07d13352d2a50a9d.zip external_llvm-ef854af5bd231ae0c059eb4f07d13352d2a50a9d.tar.gz external_llvm-ef854af5bd231ae0c059eb4f07d13352d2a50a9d.tar.bz2 |
Add a getAlignOf helper for getting the ABI alignment of a
type as a target independent constant expression. I confess
that I didn't check that this method works as intended (though
I did test the equivalent hand-written IR a little). But what
could possibly go wrong!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72213 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/ocaml/llvm/llvm.mli | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bindings/ocaml/llvm/llvm.mli b/bindings/ocaml/llvm/llvm.mli index 421c20c..f7ca58e 100644 --- a/bindings/ocaml/llvm/llvm.mli +++ b/bindings/ocaml/llvm/llvm.mli @@ -514,9 +514,15 @@ external const_vector : llvalue array -> llvalue = "llvm_const_vector" (** {7 Constant expressions} *) +(** [align_of ty] returns the alignof constant for the type [ty]. This is + equivalent to [const_ptrtoint (const_gep (const_null (pointer_type {i8,ty})) + (const_int i32_type 0) (const_int i32_type 1)) i32_type], but considerably + more readable. See the method [llvm::ConstantExpr::getAlignOf]. *) +external align_of : lltype -> llvalue = "LLVMAlignOf" + (** [size_of ty] returns the sizeof constant for the type [ty]. This is equivalent to [const_ptrtoint (const_gep (const_null (pointer_type ty)) - (const_int i64_type 1)) i64_type], but considerably more readable. + (const_int i32_type 1)) i64_type], but considerably more readable. See the method [llvm::ConstantExpr::getSizeOf]. *) external size_of : lltype -> llvalue = "LLVMSizeOf" |