summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitd334aca93f538d1a59ae3296fd7bddf5766de2a7 (patch)
treeb61ee358ec5217c30a2454ec8e59aa275602076f /llvm/lib/VMCore/Core.cpp
parent027de2adcd43f01221db121ada17f11e0bc8a543 (diff)
downloadbcm5719-llvm-d334aca93f538d1a59ae3296fd7bddf5766de2a7.tar.gz
bcm5719-llvm-d334aca93f538d1a59ae3296fd7bddf5766de2a7.zip
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! llvm-svn: 72213
Diffstat (limited to 'llvm/lib/VMCore/Core.cpp')
-rw-r--r--llvm/lib/VMCore/Core.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Core.cpp b/llvm/lib/VMCore/Core.cpp
index 1fa83ebd1c0..f85dbe76119 100644
--- a/llvm/lib/VMCore/Core.cpp
+++ b/llvm/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)));
}
OpenPOWER on IntegriCloud