aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Core.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-05-21 15:52:21 +0000
committerDuncan Sands <baldrick@free.fr>2009-05-21 15:52:21 +0000
commit788f65ea894f8e607fdf41f8c360bc9d1d987153 (patch)
tree1ffe037dbd917d3dc1434c1947079f899fcf51d8 /lib/VMCore/Core.cpp
parent2d9b3cbe342bca2e2ec06f74e90a949c43b89fce (diff)
downloadexternal_llvm-788f65ea894f8e607fdf41f8c360bc9d1d987153.zip
external_llvm-788f65ea894f8e607fdf41f8c360bc9d1d987153.tar.gz
external_llvm-788f65ea894f8e607fdf41f8c360bc9d1d987153.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 'lib/VMCore/Core.cpp')
-rw-r--r--lib/VMCore/Core.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp
index 1fa83eb..f85dbe7 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)));
}