r241577 - Changing a use of alignof() into llvm::alignOf() for MSVC compatibility. This requires changing a static_assert into an assert, too.
Aaron Ballman
aaron at aaronballman.com
Tue Jul 7 05:50:30 PDT 2015
Author: aaronballman
Date: Tue Jul 7 07:50:30 2015
New Revision: 241577
URL: http://llvm.org/viewvc/llvm-project?rev=241577&view=rev
Log:
Changing a use of alignof() into llvm::alignOf() for MSVC compatibility. This requires changing a static_assert into an assert, too.
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=241577&r1=241576&r2=241577&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclObjC.cpp (original)
+++ cfe/trunk/lib/AST/DeclObjC.cpp Tue Jul 7 07:50:30 2015
@@ -1266,8 +1266,9 @@ ObjCTypeParamList *ObjCTypeParamList::cr
SourceLocation rAngleLoc) {
unsigned size = sizeof(ObjCTypeParamList)
+ sizeof(ObjCTypeParamDecl *) * typeParams.size();
- static_assert(alignof(ObjCTypeParamList) >= alignof(ObjCTypeParamDecl*),
- "type parameter list needs greater alignment");
+ assert(llvm::alignOf<ObjCTypeParamList>() >=
+ llvm::alignOf<ObjCTypeParamDecl *>() &&
+ "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