r241604 - Use AlignOf instead of alignOf so that this can go back to being a static_assert. Amends r241577.
Aaron Ballman
aaron at aaronballman.com
Tue Jul 7 10:12:15 PDT 2015
Author: aaronballman
Date: Tue Jul 7 12:12:14 2015
New Revision: 241604
URL: http://llvm.org/viewvc/llvm-project?rev=241604&view=rev
Log:
Use AlignOf instead of alignOf so that this can go back to being a static_assert. Amends r241577.
Modified:
cfe/trunk/lib/AST/DeclObjC.cpp
Modified: cfe/trunk/lib/AST/DeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclObjC.cpp?rev=241604&r1=241603&r2=241604&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclObjC.cpp (original)
+++ cfe/trunk/lib/AST/DeclObjC.cpp Tue Jul 7 12:12:14 2015
@@ -1266,9 +1266,9 @@ ObjCTypeParamList *ObjCTypeParamList::cr
SourceLocation rAngleLoc) {
unsigned size = sizeof(ObjCTypeParamList)
+ sizeof(ObjCTypeParamDecl *) * typeParams.size();
- assert(llvm::alignOf<ObjCTypeParamList>() >=
- llvm::alignOf<ObjCTypeParamDecl *>() &&
- "type parameter list needs greater alignment");
+ static_assert(llvm::AlignOf<ObjCTypeParamList>::Alignment >=
+ llvm::AlignOf<ObjCTypeParamDecl *>::Alignment,
+ "type parameter list needs greater alignment");
unsigned align = llvm::alignOf<ObjCTypeParamList>();
void *mem = ctx.Allocate(size, align);
return new (mem) ObjCTypeParamList(lAngleLoc, typeParams, rAngleLoc);
More information about the cfe-commits
mailing list