From 3248854a5d16e1de17c58e05f726bdef9f042df2 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 30 Oct 2010 05:14:06 +0000 Subject: [PATCH] Rename alignof -> alignOf to avoid irritating C++'0x compilers, PR8423 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117775 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/DeclCXX.cpp | 2 +- lib/AST/DeclObjC.cpp | 2 +- lib/AST/Expr.cpp | 10 +++++----- lib/AST/ExprCXX.cpp | 12 ++++++------ lib/AST/Stmt.cpp | 8 ++++---- lib/Basic/IdentifierTable.cpp | 2 +- lib/Lex/TokenLexer.cpp | 2 +- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp index 88ede82d92..17f2dfda64 100644 --- a/lib/AST/DeclCXX.cpp +++ b/lib/AST/DeclCXX.cpp @@ -1057,7 +1057,7 @@ CXXBaseOrMemberInitializer::Create(ASTContext &Context, unsigned NumIndices) { void *Mem = Context.Allocate(sizeof(CXXBaseOrMemberInitializer) + sizeof(VarDecl *) * NumIndices, - llvm::alignof()); + llvm::alignOf()); return new (Mem) CXXBaseOrMemberInitializer(Context, Member, MemberLoc, L, Init, R, Indices, NumIndices); } diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index d952cc36ef..817f7073af 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -711,7 +711,7 @@ ObjCClassDecl::ObjCClassDecl(DeclContext *DC, SourceLocation L, void ObjCClassDecl::setClassList(ASTContext &C, ObjCInterfaceDecl*const*List, const SourceLocation *Locs, unsigned Num) { ForwardDecls = (ObjCClassRef*) C.Allocate(sizeof(ObjCClassRef)*Num, - llvm::alignof()); + llvm::alignOf()); for (unsigned i = 0; i < Num; ++i) new (&ForwardDecls[i]) ObjCClassRef(List[i], Locs[i]); diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 011887b9a7..19b2b5bae9 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -257,7 +257,7 @@ DeclRefExpr *DeclRefExpr::Create(ASTContext &Context, if (TemplateArgs) Size += ExplicitTemplateArgumentList::sizeFor(*TemplateArgs); - void *Mem = Context.Allocate(Size, llvm::alignof()); + void *Mem = Context.Allocate(Size, llvm::alignOf()); return new (Mem) DeclRefExpr(Qualifier, QualifierRange, D, NameInfo, TemplateArgs, T); } @@ -271,7 +271,7 @@ DeclRefExpr *DeclRefExpr::CreateEmpty(ASTContext &Context, bool HasQualifier, if (NumTemplateArgs) Size += ExplicitTemplateArgumentList::sizeFor(NumTemplateArgs); - void *Mem = Context.Allocate(Size, llvm::alignof()); + void *Mem = Context.Allocate(Size, llvm::alignOf()); return new (Mem) DeclRefExpr(EmptyShell()); } @@ -432,7 +432,7 @@ StringLiteral *StringLiteral::Create(ASTContext &C, const char *StrData, // any concatenated string tokens. void *Mem = C.Allocate(sizeof(StringLiteral)+ sizeof(SourceLocation)*(NumStrs-1), - llvm::alignof()); + llvm::alignOf()); StringLiteral *SL = new (Mem) StringLiteral(Ty); // OPTIMIZE: could allocate this appended to the StringLiteral. @@ -452,7 +452,7 @@ StringLiteral *StringLiteral::Create(ASTContext &C, const char *StrData, StringLiteral *StringLiteral::CreateEmpty(ASTContext &C, unsigned NumStrs) { void *Mem = C.Allocate(sizeof(StringLiteral)+ sizeof(SourceLocation)*(NumStrs-1), - llvm::alignof()); + llvm::alignOf()); StringLiteral *SL = new (Mem) StringLiteral(QualType()); SL->StrData = 0; SL->ByteLength = 0; @@ -714,7 +714,7 @@ MemberExpr *MemberExpr::Create(ASTContext &C, Expr *base, bool isarrow, if (targs) Size += ExplicitTemplateArgumentList::sizeFor(*targs); - void *Mem = C.Allocate(Size, llvm::alignof()); + void *Mem = C.Allocate(Size, llvm::alignOf()); MemberExpr *E = new (Mem) MemberExpr(base, isarrow, memberdecl, nameinfo, ty); if (hasQualOrFound) { diff --git a/lib/AST/ExprCXX.cpp b/lib/AST/ExprCXX.cpp index 1e0691830a..05b6fc1f6c 100644 --- a/lib/AST/ExprCXX.cpp +++ b/lib/AST/ExprCXX.cpp @@ -233,7 +233,7 @@ UnresolvedLookupExpr::CreateEmpty(ASTContext &C, unsigned NumTemplateArgs) { if (NumTemplateArgs != 0) size += ExplicitTemplateArgumentList::sizeFor(NumTemplateArgs); - void *Mem = C.Allocate(size, llvm::alignof()); + void *Mem = C.Allocate(size, llvm::alignOf()); UnresolvedLookupExpr *E = new (Mem) UnresolvedLookupExpr(EmptyShell()); E->HasExplicitTemplateArgs = NumTemplateArgs != 0; return E; @@ -261,7 +261,7 @@ void OverloadExpr::initializeResults(ASTContext &C, if (NumResults) { Results = static_cast( C.Allocate(sizeof(DeclAccessPair) * NumResults, - llvm::alignof())); + llvm::alignOf())); memcpy(Results, &*Begin.getIterator(), NumResults * sizeof(DeclAccessPair)); } @@ -737,7 +737,7 @@ CXXDependentScopeMemberExpr::Create(ASTContext &C, if (TemplateArgs) size += ExplicitTemplateArgumentList::sizeFor(*TemplateArgs); - void *Mem = C.Allocate(size, llvm::alignof()); + void *Mem = C.Allocate(size, llvm::alignOf()); return new (Mem) CXXDependentScopeMemberExpr(C, Base, BaseType, IsArrow, OperatorLoc, Qualifier, QualifierRange, @@ -756,7 +756,7 @@ CXXDependentScopeMemberExpr::CreateEmpty(ASTContext &C, std::size_t size = sizeof(CXXDependentScopeMemberExpr) + ExplicitTemplateArgumentList::sizeFor(NumTemplateArgs); - void *Mem = C.Allocate(size, llvm::alignof()); + void *Mem = C.Allocate(size, llvm::alignOf()); CXXDependentScopeMemberExpr *E = new (Mem) CXXDependentScopeMemberExpr(C, 0, QualType(), 0, SourceLocation(), 0, @@ -812,7 +812,7 @@ UnresolvedMemberExpr::Create(ASTContext &C, bool Dependent, if (TemplateArgs) size += ExplicitTemplateArgumentList::sizeFor(*TemplateArgs); - void *Mem = C.Allocate(size, llvm::alignof()); + void *Mem = C.Allocate(size, llvm::alignOf()); return new (Mem) UnresolvedMemberExpr(C, Dependent ? C.DependentTy : C.OverloadTy, Dependent, HasUnresolvedUsing, Base, BaseType, @@ -826,7 +826,7 @@ UnresolvedMemberExpr::CreateEmpty(ASTContext &C, unsigned NumTemplateArgs) { if (NumTemplateArgs != 0) size += ExplicitTemplateArgumentList::sizeFor(NumTemplateArgs); - void *Mem = C.Allocate(size, llvm::alignof()); + void *Mem = C.Allocate(size, llvm::alignOf()); UnresolvedMemberExpr *E = new (Mem) UnresolvedMemberExpr(EmptyShell()); E->HasExplicitTemplateArgs = NumTemplateArgs != 0; return E; diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index 09d889e923..acd77beaca 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -416,7 +416,7 @@ ObjCAtTryStmt *ObjCAtTryStmt::Create(ASTContext &Context, Stmt *atFinallyStmt) { unsigned Size = sizeof(ObjCAtTryStmt) + (1 + NumCatchStmts + (atFinallyStmt != 0)) * sizeof(Stmt *); - void *Mem = Context.Allocate(Size, llvm::alignof()); + void *Mem = Context.Allocate(Size, llvm::alignOf()); return new (Mem) ObjCAtTryStmt(atTryLoc, atTryStmt, CatchStmts, NumCatchStmts, atFinallyStmt); } @@ -426,7 +426,7 @@ ObjCAtTryStmt *ObjCAtTryStmt::CreateEmpty(ASTContext &Context, bool HasFinally) { unsigned Size = sizeof(ObjCAtTryStmt) + (1 + NumCatchStmts + HasFinally) * sizeof(Stmt *); - void *Mem = Context.Allocate(Size, llvm::alignof()); + void *Mem = Context.Allocate(Size, llvm::alignOf()); return new (Mem) ObjCAtTryStmt(EmptyShell(), NumCatchStmts, HasFinally); } @@ -448,7 +448,7 @@ CXXTryStmt *CXXTryStmt::Create(ASTContext &C, SourceLocation tryLoc, std::size_t Size = sizeof(CXXTryStmt); Size += ((numHandlers + 1) * sizeof(Stmt)); - void *Mem = C.Allocate(Size, llvm::alignof()); + void *Mem = C.Allocate(Size, llvm::alignOf()); return new (Mem) CXXTryStmt(tryLoc, tryBlock, handlers, numHandlers); } @@ -457,7 +457,7 @@ CXXTryStmt *CXXTryStmt::Create(ASTContext &C, EmptyShell Empty, std::size_t Size = sizeof(CXXTryStmt); Size += ((numHandlers + 1) * sizeof(Stmt)); - void *Mem = C.Allocate(Size, llvm::alignof()); + void *Mem = C.Allocate(Size, llvm::alignOf()); return new (Mem) CXXTryStmt(Empty, numHandlers); } diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp index 4ea6cedeb5..47f12923a2 100644 --- a/lib/Basic/IdentifierTable.cpp +++ b/lib/Basic/IdentifierTable.cpp @@ -390,7 +390,7 @@ Selector SelectorTable::getSelector(unsigned nKeys, IdentifierInfo **IIV) { unsigned Size = sizeof(MultiKeywordSelector) + nKeys*sizeof(IdentifierInfo *); MultiKeywordSelector *SI = (MultiKeywordSelector*)SelTabImpl.Allocator.Allocate(Size, - llvm::alignof()); + llvm::alignOf()); new (SI) MultiKeywordSelector(nKeys, IIV); SelTabImpl.Table.InsertNode(SI, InsertPos); return Selector(SI); diff --git a/lib/Lex/TokenLexer.cpp b/lib/Lex/TokenLexer.cpp index 94719b0baa..a0e5ae33b2 100644 --- a/lib/Lex/TokenLexer.cpp +++ b/lib/Lex/TokenLexer.cpp @@ -287,7 +287,7 @@ void TokenLexer::ExpandFunctionArguments() { llvm::BumpPtrAllocator &Alloc = PP.getPreprocessorAllocator(); Token *Res = static_cast(Alloc.Allocate(sizeof(Token)*ResultToks.size(), - llvm::alignof())); + llvm::alignOf())); if (NumTokens) memcpy(Res, &ResultToks[0], NumTokens*sizeof(Token)); Tokens = Res; -- 2.40.0