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 /lib/VMCore/Core.cpp | |
parent | e3e51c0038bd6ba2add82e2246e97edec0ab2204 (diff) |
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 'lib/VMCore/Core.cpp')
-rw-r--r-- | lib/VMCore/Core.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp index 1fa83ebd1c..f85dbe7611 100644 --- a/lib/VMCore/Core.cpp +++ b/lib/VMCore/Core.cpp @@ -356,6 +356,10 @@ LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size) { /*--.. Constant expressions ................................................--*/ +LLVMValueRef LLVMAlignOf(LLVMTypeRef Ty) { + return wrap(ConstantExpr::getAlignOf(unwrap(Ty))); +} + LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty) { return wrap(ConstantExpr::getSizeOf(unwrap(Ty))); } |