summaryrefslogtreecommitdiff
path: root/include/llvm/Support/Recycler.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Support/Recycler.h')
-rw-r--r--include/llvm/Support/Recycler.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/llvm/Support/Recycler.h b/include/llvm/Support/Recycler.h
index bcc561db2d..129e8efd2b 100644
--- a/include/llvm/Support/Recycler.h
+++ b/include/llvm/Support/Recycler.h
@@ -100,10 +100,10 @@ public:
template<class SubClass, class AllocatorType>
SubClass *Allocate(AllocatorType &Allocator) {
- assert(sizeof(SubClass) <= Size &&
- "Recycler allocation size is less than object size!");
- assert(AlignOf<SubClass>::Alignment <= Align &&
- "Recycler allocation alignment is less than object alignment!");
+ static_assert(AlignOf<SubClass>::Alignment <= Align,
+ "Recycler allocation alignment is less than object align!");
+ static_assert(sizeof(SubClass) <= Size,
+ "Recycler allocation size is less than object size!");
return !FreeList.empty() ?
reinterpret_cast<SubClass *>(FreeList.remove(FreeList.begin())) :
static_cast<SubClass *>(Allocator.Allocate(Size, Align));