[llvm-commits] [llvm] r50363 - /llvm/trunk/include/llvm/Support/AlignOf.h
Ted Kremenek
kremenek at apple.com
Mon Apr 28 10:58:20 PDT 2008
Author: kremenek
Date: Mon Apr 28 12:58:20 2008
New Revision: 50363
URL: http://llvm.org/viewvc/llvm-project?rev=50363&view=rev
Log:
Add more alignment enums.
Modified:
llvm/trunk/include/llvm/Support/AlignOf.h
Modified: llvm/trunk/include/llvm/Support/AlignOf.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/AlignOf.h?rev=50363&r1=50362&r2=50363&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/AlignOf.h (original)
+++ llvm/trunk/include/llvm/Support/AlignOf.h Mon Apr 28 12:58:20 2008
@@ -35,10 +35,17 @@
template <typename T>
struct AlignOf {
enum { Alignment = sizeof(AlignmentCalcImpl<T>) - sizeof(T) };
+
enum { Alignment_GreaterEqual_2Bytes = Alignment >= 2 ? 1 : 0 };
enum { Alignment_GreaterEqual_4Bytes = Alignment >= 4 ? 1 : 0 };
enum { Alignment_GreaterEqual_8Bytes = Alignment >= 8 ? 1 : 0 };
enum { Alignment_GreaterEqual_16Bytes = Alignment >= 16 ? 1 : 0 };
+
+ enum { Alignment_LessEqual_2Bytes = Alignment <= 2 ? 1 : 0 };
+ enum { Alignment_LessEqual_4Bytes = Alignment <= 4 ? 1 : 0 };
+ enum { Alignment_LessEqual_8Bytes = Alignment <= 8 ? 1 : 0 };
+ enum { Alignment_LessEqual_16Bytes = Alignment <= 16 ? 1 : 0 };
+
};
/// alignof - A templated function that returns the mininum alignment of
More information about the llvm-commits
mailing list