From 8ae395de66bec80bfdfb72da8e1217abeec9b913 Mon Sep 17 00:00:00 2001 From: Pete Cooper Date: Tue, 9 Jun 2015 20:58:03 +0000 Subject: Use AlignOf traits to enable static_assert. This is better than runtime asserts. Thanks to David Blaikie for the help here. llvm-svn: 239431 --- llvm/lib/MC/MCSymbol.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/MC/MCSymbol.cpp') diff --git a/llvm/lib/MC/MCSymbol.cpp b/llvm/lib/MC/MCSymbol.cpp index f0f35f7b29e..836d28294f5 100644 --- a/llvm/lib/MC/MCSymbol.cpp +++ b/llvm/lib/MC/MCSymbol.cpp @@ -28,9 +28,9 @@ void *MCSymbol::operator new(size_t s, const StringMapEntry *Name, // For safety, ensure that the alignment of a pointer is enough for an // MCSymbol. This also ensures we don't need padding between the name and // symbol. - // FIXME: Use static_assert when constexpr is supported. - assert(alignOf() <= alignOf() && - "Bad alignment of MCSymbol"); + static_assert(AlignOf::Alignment <= + AlignOf::Alignment, + "Bad alignment of MCSymbol"); void *Storage = Ctx.allocate(Size, alignOf()); NameEntryStorageTy *Start = static_cast(Storage); NameEntryStorageTy *End = Start + (Name ? 1 : 0); -- cgit v1.2.3