r284730 - Retire llvm::alignOf in favor of C++11 alignof.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 20 07:27:23 PDT 2016


Author: d0k
Date: Thu Oct 20 09:27:22 2016
New Revision: 284730

URL: http://llvm.org/viewvc/llvm-project?rev=284730&view=rev
Log:
Retire llvm::alignOf in favor of C++11 alignof.

No functionality change intended.

Modified:
    cfe/trunk/include/clang/AST/ASTContext.h
    cfe/trunk/include/clang/AST/ASTVector.h
    cfe/trunk/include/clang/AST/Stmt.h
    cfe/trunk/include/clang/AST/StmtOpenMP.h
    cfe/trunk/include/clang/AST/TypeLoc.h
    cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyUtil.h
    cfe/trunk/include/clang/Basic/SourceManager.h
    cfe/trunk/include/clang/Sema/Overload.h
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/lib/AST/DeclBase.cpp
    cfe/trunk/lib/AST/DeclCXX.cpp
    cfe/trunk/lib/AST/DeclGroup.cpp
    cfe/trunk/lib/AST/DeclObjC.cpp
    cfe/trunk/lib/AST/DeclTemplate.cpp
    cfe/trunk/lib/AST/Expr.cpp
    cfe/trunk/lib/AST/ExprCXX.cpp
    cfe/trunk/lib/AST/ExprObjC.cpp
    cfe/trunk/lib/AST/NestedNameSpecifier.cpp
    cfe/trunk/lib/AST/Stmt.cpp
    cfe/trunk/lib/AST/StmtCXX.cpp
    cfe/trunk/lib/AST/StmtObjC.cpp
    cfe/trunk/lib/AST/StmtOpenMP.cpp
    cfe/trunk/lib/AST/TemplateBase.cpp
    cfe/trunk/lib/AST/TypeLoc.cpp
    cfe/trunk/lib/Analysis/CFG.cpp
    cfe/trunk/lib/Basic/IdentifierTable.cpp
    cfe/trunk/lib/CodeGen/CGCleanup.cpp
    cfe/trunk/lib/CodeGen/CGCleanup.h
    cfe/trunk/lib/CodeGen/CodeGenFunction.h
    cfe/trunk/lib/CodeGen/EHScopeStack.h
    cfe/trunk/lib/Lex/MacroInfo.cpp
    cfe/trunk/lib/Lex/PPDirectives.cpp
    cfe/trunk/lib/Lex/PreprocessingRecord.cpp
    cfe/trunk/lib/Sema/AttributeList.cpp
    cfe/trunk/lib/Sema/CodeCompleteConsumer.cpp
    cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp
    cfe/trunk/lib/Sema/TypeLocBuilder.h

Modified: cfe/trunk/include/clang/AST/ASTContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ASTContext.h (original)
+++ cfe/trunk/include/clang/AST/ASTContext.h Thu Oct 20 09:27:22 2016
@@ -582,7 +582,7 @@ public:
     return BumpAlloc.Allocate(Size, Align);
   }
   template <typename T> T *Allocate(size_t Num = 1) const {
-    return static_cast<T *>(Allocate(Num * sizeof(T), llvm::alignOf<T>()));
+    return static_cast<T *>(Allocate(Num * sizeof(T), alignof(T)));
   }
   void Deallocate(void *Ptr) const { }
   

Modified: cfe/trunk/include/clang/AST/ASTVector.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTVector.h?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ASTVector.h (original)
+++ cfe/trunk/include/clang/AST/ASTVector.h Thu Oct 20 09:27:22 2016
@@ -380,7 +380,7 @@ void ASTVector<T>::grow(const ASTContext
     NewCapacity = MinSize;
 
   // Allocate the memory from the ASTContext.
-  T *NewElts = new (C, llvm::alignOf<T>()) T[NewCapacity];
+  T *NewElts = new (C, alignof(T)) T[NewCapacity];
 
   // Copy the elements over.
   if (Begin != End) {

Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Thu Oct 20 09:27:22 2016
@@ -340,7 +340,7 @@ protected:
 
 public:
   Stmt(StmtClass SC) {
-    static_assert(sizeof(*this) % llvm::AlignOf<void *>::Alignment == 0,
+    static_assert(sizeof(*this) % alignof(void *) == 0,
                   "Insufficient alignment!");
     StmtBits.sClass = SC;
     if (StatisticsEnabled) Stmt::addStmtClass(SC);

Modified: cfe/trunk/include/clang/AST/StmtOpenMP.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtOpenMP.h?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/StmtOpenMP.h (original)
+++ cfe/trunk/include/clang/AST/StmtOpenMP.h Thu Oct 20 09:27:22 2016
@@ -70,7 +70,7 @@ protected:
       : Stmt(SC), Kind(K), StartLoc(std::move(StartLoc)),
         EndLoc(std::move(EndLoc)), NumClauses(NumClauses),
         NumChildren(NumChildren),
-        ClausesOffset(llvm::alignTo(sizeof(T), llvm::alignOf<OMPClause *>())) {}
+        ClausesOffset(llvm::alignTo(sizeof(T), alignof(OMPClause *))) {}
 
   /// \brief Sets the list of variables for this clause.
   ///

Modified: cfe/trunk/include/clang/AST/TypeLoc.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TypeLoc.h?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/TypeLoc.h (original)
+++ cfe/trunk/include/clang/AST/TypeLoc.h Thu Oct 20 09:27:22 2016
@@ -347,7 +347,7 @@ class ConcreteTypeLoc : public Base {
 
 public:
   unsigned getLocalDataAlignment() const {
-    return std::max(llvm::alignOf<LocalData>(),
+    return std::max(unsigned(alignof(LocalData)),
                     asDerived()->getExtraLocalDataAlignment());
   }
   unsigned getLocalDataSize() const {
@@ -487,8 +487,10 @@ class TypeSpecTypeLoc : public ConcreteT
                                                Type,
                                                TypeSpecLocInfo> {
 public:
-  enum { LocalDataSize = sizeof(TypeSpecLocInfo),
-         LocalDataAlignment = llvm::AlignOf<TypeSpecLocInfo>::Alignment };
+  enum {
+    LocalDataSize = sizeof(TypeSpecLocInfo),
+    LocalDataAlignment = alignof(TypeSpecLocInfo)
+  };
 
   SourceLocation getNameLoc() const {
     return this->getLocalData()->NameLoc;
@@ -548,7 +550,7 @@ public:
   }
 
   unsigned getExtraLocalDataAlignment() const {
-    return needsExtraLocalData() ? llvm::alignOf<WrittenBuiltinSpecs>() : 1;
+    return needsExtraLocalData() ? alignof(WrittenBuiltinSpecs) : 1;
   }
 
   SourceRange getLocalSourceRange() const {
@@ -768,7 +770,7 @@ public:
     return (this->getNumProtocols() + 2) * sizeof(SourceLocation) ;
   }
   unsigned getExtraLocalDataAlignment() const {
-    return llvm::alignOf<SourceLocation>();
+    return alignof(SourceLocation);
   }
   SourceRange getLocalSourceRange() const {
     SourceLocation start = getNameLoc();
@@ -1045,10 +1047,9 @@ public:
   }
 
   unsigned getExtraLocalDataAlignment() const {
-    assert(llvm::alignOf<ObjCObjectTypeLoc>()
-	     >= llvm::alignOf<TypeSourceInfo *>() &&
-	   "not enough alignment for tail-allocated data");
-    return llvm::alignOf<TypeSourceInfo *>();
+    static_assert(alignof(ObjCObjectTypeLoc) >= alignof(TypeSourceInfo *),
+                  "not enough alignment for tail-allocated data");
+    return alignof(TypeSourceInfo *);
   }
 
   QualType getInnerType() const {
@@ -1414,9 +1415,7 @@ public:
     return getNumParams() * sizeof(ParmVarDecl *);
   }
 
-  unsigned getExtraLocalDataAlignment() const {
-    return llvm::alignOf<ParmVarDecl*>();
-  }
+  unsigned getExtraLocalDataAlignment() const { return alignof(ParmVarDecl *); }
 
   QualType getInnerType() const { return getTypePtr()->getReturnType(); }
 };
@@ -1610,7 +1609,7 @@ public:
   }
 
   unsigned getExtraLocalDataAlignment() const {
-    return llvm::alignOf<TemplateArgumentLocInfo>();
+    return alignof(TemplateArgumentLocInfo);
   }
 
 private:
@@ -2020,7 +2019,7 @@ public:
   }
 
   unsigned getExtraLocalDataAlignment() const {
-    return llvm::alignOf<TemplateArgumentLocInfo>();
+    return alignof(TemplateArgumentLocInfo);
   }
 
 private:

Modified: cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyUtil.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyUtil.h?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyUtil.h (original)
+++ cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyUtil.h Thu Oct 20 09:27:22 2016
@@ -45,7 +45,7 @@ public:
   MemRegionRef(llvm::BumpPtrAllocator *A) : Allocator(A) {}
 
   void *allocate(size_t Sz) {
-    return Allocator->Allocate(Sz, llvm::AlignOf<AlignmentType>::Alignment);
+    return Allocator->Allocate(Sz, alignof(AlignmentType));
   }
 
   template <typename T> T *allocateT() { return Allocator->Allocate<T>(); }

Modified: cfe/trunk/include/clang/Basic/SourceManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceManager.h?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/SourceManager.h (original)
+++ cfe/trunk/include/clang/Basic/SourceManager.h Thu Oct 20 09:27:22 2016
@@ -44,7 +44,6 @@
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/ADT/PointerIntPair.h"
-#include "llvm/Support/AlignOf.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/MemoryBuffer.h"
@@ -226,7 +225,7 @@ namespace SrcMgr {
 
   // Assert that the \c ContentCache objects will always be 8-byte aligned so
   // that we can pack 3 bits of integer into pointers to such objects.
-  static_assert(llvm::AlignOf<ContentCache>::Alignment >= 8,
+  static_assert(alignof(ContentCache) >= 8,
                 "ContentCache must be 8-byte aligned.");
 
   /// \brief Information about a FileID, basically just the logical file

Modified: cfe/trunk/include/clang/Sema/Overload.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Overload.h?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Overload.h (original)
+++ cfe/trunk/include/clang/Sema/Overload.h Thu Oct 20 09:27:22 2016
@@ -727,8 +727,9 @@ namespace clang {
     CandidateSetKind Kind;
 
     unsigned NumInlineSequences;
-    llvm::AlignedCharArray<llvm::AlignOf<ImplicitConversionSequence>::Alignment,
-                           16 * sizeof(ImplicitConversionSequence)> InlineSpace;
+    llvm::AlignedCharArray<alignof(ImplicitConversionSequence),
+                           16 * sizeof(ImplicitConversionSequence)>
+        InlineSpace;
 
     OverloadCandidateSet(const OverloadCandidateSet &) = delete;
     void operator=(const OverloadCandidateSet &) = delete;

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Thu Oct 20 09:27:22 2016
@@ -6887,7 +6887,7 @@ ASTContext::getQualifiedTemplateName(Nes
   QualifiedTemplateName *QTN =
     QualifiedTemplateNames.FindNodeOrInsertPos(ID, InsertPos);
   if (!QTN) {
-    QTN = new (*this, llvm::alignOf<QualifiedTemplateName>())
+    QTN = new (*this, alignof(QualifiedTemplateName))
         QualifiedTemplateName(NNS, TemplateKeyword, Template);
     QualifiedTemplateNames.InsertNode(QTN, InsertPos);
   }
@@ -6915,11 +6915,11 @@ ASTContext::getDependentTemplateName(Nes
 
   NestedNameSpecifier *CanonNNS = getCanonicalNestedNameSpecifier(NNS);
   if (CanonNNS == NNS) {
-    QTN = new (*this, llvm::alignOf<DependentTemplateName>())
+    QTN = new (*this, alignof(DependentTemplateName))
         DependentTemplateName(NNS, Name);
   } else {
     TemplateName Canon = getDependentTemplateName(CanonNNS, Name);
-    QTN = new (*this, llvm::alignOf<DependentTemplateName>())
+    QTN = new (*this, alignof(DependentTemplateName))
         DependentTemplateName(NNS, Name, Canon);
     DependentTemplateName *CheckQTN =
       DependentTemplateNames.FindNodeOrInsertPos(ID, InsertPos);
@@ -6951,13 +6951,13 @@ ASTContext::getDependentTemplateName(Nes
   
   NestedNameSpecifier *CanonNNS = getCanonicalNestedNameSpecifier(NNS);
   if (CanonNNS == NNS) {
-    QTN = new (*this, llvm::alignOf<DependentTemplateName>())
+    QTN = new (*this, alignof(DependentTemplateName))
         DependentTemplateName(NNS, Operator);
   } else {
     TemplateName Canon = getDependentTemplateName(CanonNNS, Operator);
-    QTN = new (*this, llvm::alignOf<DependentTemplateName>())
+    QTN = new (*this, alignof(DependentTemplateName))
         DependentTemplateName(NNS, Operator, Canon);
-    
+
     DependentTemplateName *CheckQTN
       = DependentTemplateNames.FindNodeOrInsertPos(ID, InsertPos);
     assert(!CheckQTN && "Dependent template name canonicalization broken");

Modified: cfe/trunk/lib/AST/DeclBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclBase.cpp (original)
+++ cfe/trunk/lib/AST/DeclBase.cpp Thu Oct 20 09:27:22 2016
@@ -45,8 +45,7 @@ void Decl::updateOutOfDate(IdentifierInf
 }
 
 #define DECL(DERIVED, BASE)                                                    \
-  static_assert(llvm::AlignOf<Decl>::Alignment >=                              \
-                    llvm::AlignOf<DERIVED##Decl>::Alignment,                   \
+  static_assert(alignof(Decl) >= alignof(DERIVED##Decl),                       \
                 "Alignment sufficient after objects prepended to " #DERIVED);
 #define ABSTRACT_DECL(DECL)
 #include "clang/AST/DeclNodes.inc"
@@ -55,7 +54,7 @@ void *Decl::operator new(std::size_t Siz
                          unsigned ID, std::size_t Extra) {
   // Allocate an extra 8 bytes worth of storage, which ensures that the
   // resulting pointer will still be 8-byte aligned.
-  static_assert(sizeof(unsigned) * 2 >= llvm::AlignOf<Decl>::Alignment,
+  static_assert(sizeof(unsigned) * 2 >= alignof(Decl),
                 "Decl won't be misaligned");
   void *Start = Context.Allocate(Size + Extra + 8);
   void *Result = (char*)Start + 8;
@@ -80,8 +79,7 @@ void *Decl::operator new(std::size_t Siz
     // Ensure required alignment of the resulting object by adding extra
     // padding at the start if required.
     size_t ExtraAlign =
-        llvm::OffsetToAlignment(sizeof(Module *),
-                                llvm::AlignOf<Decl>::Alignment);
+        llvm::OffsetToAlignment(sizeof(Module *), alignof(Decl));
     char *Buffer = reinterpret_cast<char *>(
         ::operator new(ExtraAlign + sizeof(Module *) + Size + Extra, Ctx));
     Buffer += ExtraAlign;

Modified: cfe/trunk/lib/AST/DeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclCXX.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclCXX.cpp (original)
+++ cfe/trunk/lib/AST/DeclCXX.cpp Thu Oct 20 09:27:22 2016
@@ -1797,7 +1797,7 @@ CXXCtorInitializer *CXXCtorInitializer::
                                                VarDecl **Indices,
                                                unsigned NumIndices) {
   void *Mem = Context.Allocate(totalSizeToAlloc<VarDecl *>(NumIndices),
-                               llvm::alignOf<CXXCtorInitializer>());
+                               alignof(CXXCtorInitializer));
   return new (Mem) CXXCtorInitializer(Context, Member, MemberLoc, L, Init, R,
                                       Indices, NumIndices);
 }

Modified: cfe/trunk/lib/AST/DeclGroup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclGroup.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclGroup.cpp (original)
+++ cfe/trunk/lib/AST/DeclGroup.cpp Thu Oct 20 09:27:22 2016
@@ -19,7 +19,7 @@ using namespace clang;
 DeclGroup* DeclGroup::Create(ASTContext &C, Decl **Decls, unsigned NumDecls) {
   assert(NumDecls > 1 && "Invalid DeclGroup");
   unsigned Size = totalSizeToAlloc<Decl *>(NumDecls);
-  void* Mem = C.Allocate(Size, llvm::AlignOf<DeclGroup>::Alignment);
+  void *Mem = C.Allocate(Size, alignof(DeclGroup));
   new (Mem) DeclGroup(NumDecls, Decls);
   return static_cast<DeclGroup*>(Mem);
 }

Modified: cfe/trunk/lib/AST/DeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclObjC.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclObjC.cpp (original)
+++ cfe/trunk/lib/AST/DeclObjC.cpp Thu Oct 20 09:27:22 2016
@@ -800,8 +800,7 @@ void ObjCMethodDecl::setParamsAndSelLocs
   if (Params.empty() && SelLocs.empty())
     return;
 
-  static_assert(llvm::AlignOf<ParmVarDecl *>::Alignment >=
-                    llvm::AlignOf<SourceLocation>::Alignment,
+  static_assert(alignof(ParmVarDecl *) >= alignof(SourceLocation),
                 "Alignment not sufficient for SourceLocation");
 
   unsigned Size = sizeof(ParmVarDecl *) * NumParams +
@@ -1374,7 +1373,7 @@ ObjCTypeParamList *ObjCTypeParamList::cr
                      SourceLocation rAngleLoc) {
   void *mem =
       ctx.Allocate(totalSizeToAlloc<ObjCTypeParamDecl *>(typeParams.size()),
-                   llvm::alignOf<ObjCTypeParamList>());
+                   alignof(ObjCTypeParamList));
   return new (mem) ObjCTypeParamList(lAngleLoc, typeParams, rAngleLoc);
 }
 

Modified: cfe/trunk/lib/AST/DeclTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclTemplate.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclTemplate.cpp (original)
+++ cfe/trunk/lib/AST/DeclTemplate.cpp Thu Oct 20 09:27:22 2016
@@ -66,7 +66,7 @@ TemplateParameterList::Create(const ASTC
                               SourceLocation RAngleLoc, Expr *RequiresClause) {
   void *Mem = C.Allocate(totalSizeToAlloc<NamedDecl *, Expr *>(
                              Params.size(), RequiresClause ? 1u : 0u),
-                         llvm::alignOf<TemplateParameterList>());
+                         alignof(TemplateParameterList));
   return new (Mem) TemplateParameterList(TemplateLoc, LAngleLoc, Params,
                                          RAngleLoc, RequiresClause);
 }

Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Thu Oct 20 09:27:22 2016
@@ -402,7 +402,7 @@ DeclRefExpr *DeclRefExpr::Create(const A
           HasTemplateKWAndArgsInfo ? 1 : 0,
           TemplateArgs ? TemplateArgs->size() : 0);
 
-  void *Mem = Context.Allocate(Size, llvm::alignOf<DeclRefExpr>());
+  void *Mem = Context.Allocate(Size, alignof(DeclRefExpr));
   return new (Mem) DeclRefExpr(Context, QualifierLoc, TemplateKWLoc, D,
                                RefersToEnclosingVariableOrCapture,
                                NameInfo, FoundD, TemplateArgs, T, VK);
@@ -419,7 +419,7 @@ DeclRefExpr *DeclRefExpr::CreateEmpty(co
                        ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
           HasQualifier ? 1 : 0, HasFoundDecl ? 1 : 0, HasTemplateKWAndArgsInfo,
           NumTemplateArgs);
-  void *Mem = Context.Allocate(Size, llvm::alignOf<DeclRefExpr>());
+  void *Mem = Context.Allocate(Size, alignof(DeclRefExpr));
   return new (Mem) DeclRefExpr(EmptyShell());
 }
 
@@ -831,9 +831,9 @@ StringLiteral *StringLiteral::Create(con
 
   // Allocate enough space for the StringLiteral plus an array of locations for
   // any concatenated string tokens.
-  void *Mem = C.Allocate(sizeof(StringLiteral)+
-                         sizeof(SourceLocation)*(NumStrs-1),
-                         llvm::alignOf<StringLiteral>());
+  void *Mem =
+      C.Allocate(sizeof(StringLiteral) + sizeof(SourceLocation) * (NumStrs - 1),
+                 alignof(StringLiteral));
   StringLiteral *SL = new (Mem) StringLiteral(Ty);
 
   // OPTIMIZE: could allocate this appended to the StringLiteral.
@@ -849,9 +849,9 @@ StringLiteral *StringLiteral::Create(con
 
 StringLiteral *StringLiteral::CreateEmpty(const ASTContext &C,
                                           unsigned NumStrs) {
-  void *Mem = C.Allocate(sizeof(StringLiteral)+
-                         sizeof(SourceLocation)*(NumStrs-1),
-                         llvm::alignOf<StringLiteral>());
+  void *Mem =
+      C.Allocate(sizeof(StringLiteral) + sizeof(SourceLocation) * (NumStrs - 1),
+                 alignof(StringLiteral));
   StringLiteral *SL = new (Mem) StringLiteral(QualType());
   SL->CharByteWidth = 0;
   SL->Length = 0;
@@ -1416,7 +1416,7 @@ MemberExpr *MemberExpr::Create(
                                             HasTemplateKWAndArgsInfo ? 1 : 0,
                                             targs ? targs->size() : 0);
 
-  void *Mem = C.Allocate(Size, llvm::alignOf<MemberExpr>());
+  void *Mem = C.Allocate(Size, alignof(MemberExpr));
   MemberExpr *E = new (Mem)
       MemberExpr(base, isarrow, OperatorLoc, memberdecl, nameinfo, ty, vk, ok);
 
@@ -3604,7 +3604,7 @@ DesignatedInitExpr::Create(const ASTCont
                            SourceLocation ColonOrEqualLoc,
                            bool UsesColonSyntax, Expr *Init) {
   void *Mem = C.Allocate(totalSizeToAlloc<Stmt *>(IndexExprs.size() + 1),
-                         llvm::alignOf<DesignatedInitExpr>());
+                         alignof(DesignatedInitExpr));
   return new (Mem) DesignatedInitExpr(C, C.VoidTy, Designators,
                                       ColonOrEqualLoc, UsesColonSyntax,
                                       IndexExprs, Init);
@@ -3613,7 +3613,7 @@ DesignatedInitExpr::Create(const ASTCont
 DesignatedInitExpr *DesignatedInitExpr::CreateEmpty(const ASTContext &C,
                                                     unsigned NumIndexExprs) {
   void *Mem = C.Allocate(totalSizeToAlloc<Stmt *>(NumIndexExprs + 1),
-                         llvm::alignOf<DesignatedInitExpr>());
+                         alignof(DesignatedInitExpr));
   return new (Mem) DesignatedInitExpr(NumIndexExprs + 1);
 }
 
@@ -3753,7 +3753,7 @@ PseudoObjectExpr *PseudoObjectExpr::Crea
                                            unsigned numSemanticExprs) {
   void *buffer =
       Context.Allocate(totalSizeToAlloc<Expr *>(1 + numSemanticExprs),
-                       llvm::alignOf<PseudoObjectExpr>());
+                       alignof(PseudoObjectExpr));
   return new(buffer) PseudoObjectExpr(sh, numSemanticExprs);
 }
 
@@ -3781,7 +3781,7 @@ PseudoObjectExpr *PseudoObjectExpr::Crea
   }
 
   void *buffer = C.Allocate(totalSizeToAlloc<Expr *>(semantics.size() + 1),
-                            llvm::alignOf<PseudoObjectExpr>());
+                            alignof(PseudoObjectExpr));
   return new(buffer) PseudoObjectExpr(type, VK, syntax, semantics,
                                       resultIndex);
 }

Modified: cfe/trunk/lib/AST/ExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprCXX.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ExprCXX.cpp (original)
+++ cfe/trunk/lib/AST/ExprCXX.cpp Thu Oct 20 09:27:22 2016
@@ -243,7 +243,7 @@ UnresolvedLookupExpr::Create(const ASTCo
   std::size_t Size =
       totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(1,
                                                                       num_args);
-  void *Mem = C.Allocate(Size, llvm::alignOf<UnresolvedLookupExpr>());
+  void *Mem = C.Allocate(Size, alignof(UnresolvedLookupExpr));
   return new (Mem) UnresolvedLookupExpr(C, NamingClass, QualifierLoc,
                                         TemplateKWLoc, NameInfo,
                                         ADL, /*Overload*/ true, Args,
@@ -258,7 +258,7 @@ UnresolvedLookupExpr::CreateEmpty(const
   std::size_t Size =
       totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
           HasTemplateKWAndArgsInfo, NumTemplateArgs);
-  void *Mem = C.Allocate(Size, llvm::alignOf<UnresolvedLookupExpr>());
+  void *Mem = C.Allocate(Size, alignof(UnresolvedLookupExpr));
   UnresolvedLookupExpr *E = new (Mem) UnresolvedLookupExpr(EmptyShell());
   E->HasTemplateKWAndArgsInfo = HasTemplateKWAndArgsInfo;
   return E;
@@ -301,9 +301,8 @@ OverloadExpr::OverloadExpr(StmtClass K,
       }
     }
 
-    Results = static_cast<DeclAccessPair *>(
-                                C.Allocate(sizeof(DeclAccessPair) * NumResults, 
-                                           llvm::alignOf<DeclAccessPair>()));
+    Results = static_cast<DeclAccessPair *>(C.Allocate(
+        sizeof(DeclAccessPair) * NumResults, alignof(DeclAccessPair)));
     memcpy(Results, Begin.I, NumResults * sizeof(DeclAccessPair));
   }
 
@@ -340,11 +339,11 @@ void OverloadExpr::initializeResults(con
   assert(!Results && "Results already initialized!");
   NumResults = End - Begin;
   if (NumResults) {
-     Results = static_cast<DeclAccessPair *>(
-                               C.Allocate(sizeof(DeclAccessPair) * NumResults,
- 
-                                          llvm::alignOf<DeclAccessPair>()));
-     memcpy(Results, Begin.I, NumResults * sizeof(DeclAccessPair));
+    Results = static_cast<DeclAccessPair *>(
+        C.Allocate(sizeof(DeclAccessPair) * NumResults,
+
+                   alignof(DeclAccessPair)));
+    memcpy(Results, Begin.I, NumResults * sizeof(DeclAccessPair));
   }
 }
 
@@ -1058,7 +1057,7 @@ ExprWithCleanups *ExprWithCleanups::Crea
                                            bool CleanupsHaveSideEffects,
                                            ArrayRef<CleanupObject> objects) {
   void *buffer = C.Allocate(totalSizeToAlloc<CleanupObject>(objects.size()),
-                            llvm::alignOf<ExprWithCleanups>());
+                            alignof(ExprWithCleanups));
   return new (buffer)
       ExprWithCleanups(subexpr, CleanupsHaveSideEffects, objects);
 }
@@ -1072,7 +1071,7 @@ ExprWithCleanups *ExprWithCleanups::Crea
                                            EmptyShell empty,
                                            unsigned numObjects) {
   void *buffer = C.Allocate(totalSizeToAlloc<CleanupObject>(numObjects),
-                            llvm::alignOf<ExprWithCleanups>());
+                            alignof(ExprWithCleanups));
   return new (buffer) ExprWithCleanups(empty, numObjects);
 }
 
@@ -1171,7 +1170,7 @@ CXXDependentScopeMemberExpr::Create(cons
       totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
           HasTemplateKWAndArgsInfo, NumTemplateArgs);
 
-  void *Mem = C.Allocate(Size, llvm::alignOf<CXXDependentScopeMemberExpr>());
+  void *Mem = C.Allocate(Size, alignof(CXXDependentScopeMemberExpr));
   return new (Mem) CXXDependentScopeMemberExpr(C, Base, BaseType,
                                                IsArrow, OperatorLoc,
                                                QualifierLoc,
@@ -1188,7 +1187,7 @@ CXXDependentScopeMemberExpr::CreateEmpty
   std::size_t Size =
       totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
           HasTemplateKWAndArgsInfo, NumTemplateArgs);
-  void *Mem = C.Allocate(Size, llvm::alignOf<CXXDependentScopeMemberExpr>());
+  void *Mem = C.Allocate(Size, alignof(CXXDependentScopeMemberExpr));
   CXXDependentScopeMemberExpr *E
     =  new (Mem) CXXDependentScopeMemberExpr(C, nullptr, QualType(),
                                              0, SourceLocation(),
@@ -1272,7 +1271,7 @@ UnresolvedMemberExpr *UnresolvedMemberEx
       totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
           HasTemplateKWAndArgsInfo, TemplateArgs ? TemplateArgs->size() : 0);
 
-  void *Mem = C.Allocate(Size, llvm::alignOf<UnresolvedMemberExpr>());
+  void *Mem = C.Allocate(Size, alignof(UnresolvedMemberExpr));
   return new (Mem) UnresolvedMemberExpr(
       C, HasUnresolvedUsing, Base, BaseType, IsArrow, OperatorLoc, QualifierLoc,
       TemplateKWLoc, MemberNameInfo, TemplateArgs, Begin, End);
@@ -1287,7 +1286,7 @@ UnresolvedMemberExpr::CreateEmpty(const
       totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
           HasTemplateKWAndArgsInfo, NumTemplateArgs);
 
-  void *Mem = C.Allocate(Size, llvm::alignOf<UnresolvedMemberExpr>());
+  void *Mem = C.Allocate(Size, alignof(UnresolvedMemberExpr));
   UnresolvedMemberExpr *E = new (Mem) UnresolvedMemberExpr(EmptyShell());
   E->HasTemplateKWAndArgsInfo = HasTemplateKWAndArgsInfo;
   return E;

Modified: cfe/trunk/lib/AST/ExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprObjC.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ExprObjC.cpp (original)
+++ cfe/trunk/lib/AST/ExprObjC.cpp Thu Oct 20 09:27:22 2016
@@ -278,7 +278,7 @@ ObjCMessageExpr *ObjCMessageExpr::alloc(
                                         unsigned NumStoredSelLocs) {
   return (ObjCMessageExpr *)C.Allocate(
       totalSizeToAlloc<void *, SourceLocation>(NumArgs + 1, NumStoredSelLocs),
-      llvm::AlignOf<ObjCMessageExpr>::Alignment);
+      alignof(ObjCMessageExpr));
 }
 
 void ObjCMessageExpr::getSelectorLocs(

Modified: cfe/trunk/lib/AST/NestedNameSpecifier.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/NestedNameSpecifier.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/AST/NestedNameSpecifier.cpp (original)
+++ cfe/trunk/lib/AST/NestedNameSpecifier.cpp Thu Oct 20 09:27:22 2016
@@ -34,8 +34,8 @@ NestedNameSpecifier::FindOrInsert(const
   NestedNameSpecifier *NNS
     = Context.NestedNameSpecifiers.FindNodeOrInsertPos(ID, InsertPos);
   if (!NNS) {
-    NNS = new (Context, llvm::alignOf<NestedNameSpecifier>())
-        NestedNameSpecifier(Mockup);
+    NNS =
+        new (Context, alignof(NestedNameSpecifier)) NestedNameSpecifier(Mockup);
     Context.NestedNameSpecifiers.InsertNode(NNS, InsertPos);
   }
 
@@ -113,8 +113,7 @@ NestedNameSpecifier *
 NestedNameSpecifier::GlobalSpecifier(const ASTContext &Context) {
   if (!Context.GlobalNestedNameSpecifier)
     Context.GlobalNestedNameSpecifier =
-        new (Context, llvm::alignOf<NestedNameSpecifier>())
-            NestedNameSpecifier();
+        new (Context, alignof(NestedNameSpecifier)) NestedNameSpecifier();
   return Context.GlobalNestedNameSpecifier;
 }
 
@@ -687,7 +686,7 @@ NestedNameSpecifierLocBuilder::getWithLo
   // FIXME: After copying the source-location information, should we free
   // our (temporary) buffer and adopt the ASTContext-allocated memory?
   // Doing so would optimize repeated calls to getWithLocInContext().
-  void *Mem = Context.Allocate(BufferSize, llvm::alignOf<void *>());
+  void *Mem = Context.Allocate(BufferSize, alignof(void *));
   memcpy(Mem, Buffer, BufferSize);
   return NestedNameSpecifierLoc(Representation, Mem);
 }

Modified: cfe/trunk/lib/AST/Stmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Stmt.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Stmt.cpp (original)
+++ cfe/trunk/lib/AST/Stmt.cpp Thu Oct 20 09:27:22 2016
@@ -315,7 +315,7 @@ AttributedStmt *AttributedStmt::Create(c
                                        Stmt *SubStmt) {
   assert(!Attrs.empty() && "Attrs should not be empty");
   void *Mem = C.Allocate(sizeof(AttributedStmt) + sizeof(Attr *) * Attrs.size(),
-                         llvm::alignOf<AttributedStmt>());
+                         alignof(AttributedStmt));
   return new (Mem) AttributedStmt(Loc, Attrs, SubStmt);
 }
 
@@ -323,7 +323,7 @@ AttributedStmt *AttributedStmt::CreateEm
                                             unsigned NumAttrs) {
   assert(NumAttrs > 0 && "NumAttrs should be greater than zero");
   void *Mem = C.Allocate(sizeof(AttributedStmt) + sizeof(Attr *) * NumAttrs,
-                         llvm::alignOf<AttributedStmt>());
+                         alignof(AttributedStmt));
   return new (Mem) AttributedStmt(EmptyShell(), NumAttrs);
 }
 
@@ -1002,7 +1002,7 @@ CapturedStmt::Capture *CapturedStmt::get
   unsigned Size = sizeof(CapturedStmt) + sizeof(Stmt *) * (NumCaptures + 1);
 
   // Offset of the first Capture object.
-  unsigned FirstCaptureOffset = llvm::alignTo(Size, llvm::alignOf<Capture>());
+  unsigned FirstCaptureOffset = llvm::alignTo(Size, alignof(Capture));
 
   return reinterpret_cast<Capture *>(
       reinterpret_cast<char *>(const_cast<CapturedStmt *>(this))
@@ -1059,7 +1059,7 @@ CapturedStmt *CapturedStmt::Create(const
   unsigned Size = sizeof(CapturedStmt) + sizeof(Stmt *) * (Captures.size() + 1);
   if (!Captures.empty()) {
     // Realign for the following Capture array.
-    Size = llvm::alignTo(Size, llvm::alignOf<Capture>());
+    Size = llvm::alignTo(Size, alignof(Capture));
     Size += sizeof(Capture) * Captures.size();
   }
 
@@ -1072,7 +1072,7 @@ CapturedStmt *CapturedStmt::CreateDeseri
   unsigned Size = sizeof(CapturedStmt) + sizeof(Stmt *) * (NumCaptures + 1);
   if (NumCaptures > 0) {
     // Realign for the following Capture array.
-    Size = llvm::alignTo(Size, llvm::alignOf<Capture>());
+    Size = llvm::alignTo(Size, alignof(Capture));
     Size += sizeof(Capture) * NumCaptures;
   }
 

Modified: cfe/trunk/lib/AST/StmtCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtCXX.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtCXX.cpp (original)
+++ cfe/trunk/lib/AST/StmtCXX.cpp Thu Oct 20 09:27:22 2016
@@ -28,7 +28,7 @@ CXXTryStmt *CXXTryStmt::Create(const AST
   std::size_t Size = sizeof(CXXTryStmt);
   Size += ((handlers.size() + 1) * sizeof(Stmt *));
 
-  void *Mem = C.Allocate(Size, llvm::alignOf<CXXTryStmt>());
+  void *Mem = C.Allocate(Size, alignof(CXXTryStmt));
   return new (Mem) CXXTryStmt(tryLoc, tryBlock, handlers);
 }
 
@@ -37,7 +37,7 @@ CXXTryStmt *CXXTryStmt::Create(const AST
   std::size_t Size = sizeof(CXXTryStmt);
   Size += ((numHandlers + 1) * sizeof(Stmt *));
 
-  void *Mem = C.Allocate(Size, llvm::alignOf<CXXTryStmt>());
+  void *Mem = C.Allocate(Size, alignof(CXXTryStmt));
   return new (Mem) CXXTryStmt(Empty, numHandlers);
 }
 

Modified: cfe/trunk/lib/AST/StmtObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtObjC.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtObjC.cpp (original)
+++ cfe/trunk/lib/AST/StmtObjC.cpp Thu Oct 20 09:27:22 2016
@@ -50,7 +50,7 @@ ObjCAtTryStmt *ObjCAtTryStmt::Create(con
   unsigned Size =
       sizeof(ObjCAtTryStmt) +
       (1 + NumCatchStmts + (atFinallyStmt != nullptr)) * sizeof(Stmt *);
-  void *Mem = Context.Allocate(Size, llvm::alignOf<ObjCAtTryStmt>());
+  void *Mem = Context.Allocate(Size, alignof(ObjCAtTryStmt));
   return new (Mem) ObjCAtTryStmt(atTryLoc, atTryStmt, CatchStmts, NumCatchStmts,
                                  atFinallyStmt);
 }
@@ -60,7 +60,7 @@ ObjCAtTryStmt *ObjCAtTryStmt::CreateEmpt
                                           bool HasFinally) {
   unsigned Size =
       sizeof(ObjCAtTryStmt) + (1 + NumCatchStmts + HasFinally) * sizeof(Stmt *);
-  void *Mem = Context.Allocate(Size, llvm::alignOf<ObjCAtTryStmt>());
+  void *Mem = Context.Allocate(Size, alignof(ObjCAtTryStmt));
   return new (Mem) ObjCAtTryStmt(EmptyShell(), NumCatchStmts, HasFinally);
 }
 

Modified: cfe/trunk/lib/AST/StmtOpenMP.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtOpenMP.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtOpenMP.cpp (original)
+++ cfe/trunk/lib/AST/StmtOpenMP.cpp Thu Oct 20 09:27:22 2016
@@ -58,7 +58,7 @@ OMPParallelDirective *OMPParallelDirecti
     const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
     ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPParallelDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPParallelDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
   OMPParallelDirective *Dir =
@@ -73,7 +73,7 @@ OMPParallelDirective *OMPParallelDirecti
                                                         unsigned NumClauses,
                                                         EmptyShell) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPParallelDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPParallelDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
   return new (Mem) OMPParallelDirective(NumClauses);
@@ -84,8 +84,7 @@ OMPSimdDirective::Create(const ASTContex
                          SourceLocation EndLoc, unsigned CollapsedNum,
                          ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
                          const HelperExprs &Exprs) {
-  unsigned Size =
-      llvm::alignTo(sizeof(OMPSimdDirective), llvm::alignOf<OMPClause *>());
+  unsigned Size = llvm::alignTo(sizeof(OMPSimdDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
                  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd));
@@ -113,8 +112,7 @@ OMPSimdDirective *OMPSimdDirective::Crea
                                                 unsigned NumClauses,
                                                 unsigned CollapsedNum,
                                                 EmptyShell) {
-  unsigned Size =
-      llvm::alignTo(sizeof(OMPSimdDirective), llvm::alignOf<OMPClause *>());
+  unsigned Size = llvm::alignTo(sizeof(OMPSimdDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
                  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd));
@@ -126,8 +124,7 @@ OMPForDirective::Create(const ASTContext
                         SourceLocation EndLoc, unsigned CollapsedNum,
                         ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
                         const HelperExprs &Exprs, bool HasCancel) {
-  unsigned Size =
-      llvm::alignTo(sizeof(OMPForDirective), llvm::alignOf<OMPClause *>());
+  unsigned Size = llvm::alignTo(sizeof(OMPForDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
                  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for));
@@ -166,8 +163,7 @@ OMPForDirective *OMPForDirective::Create
                                               unsigned NumClauses,
                                               unsigned CollapsedNum,
                                               EmptyShell) {
-  unsigned Size =
-      llvm::alignTo(sizeof(OMPForDirective), llvm::alignOf<OMPClause *>());
+  unsigned Size = llvm::alignTo(sizeof(OMPForDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
                  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for));
@@ -180,7 +176,7 @@ OMPForSimdDirective::Create(const ASTCon
                             ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
                             const HelperExprs &Exprs) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPForSimdDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPForSimdDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
                  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd));
@@ -219,7 +215,7 @@ OMPForSimdDirective *OMPForSimdDirective
                                                       unsigned CollapsedNum,
                                                       EmptyShell) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPForSimdDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPForSimdDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
                  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd));
@@ -230,7 +226,7 @@ OMPSectionsDirective *OMPSectionsDirecti
     const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
     ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPSectionsDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPSectionsDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
   OMPSectionsDirective *Dir =
@@ -245,7 +241,7 @@ OMPSectionsDirective *OMPSectionsDirecti
                                                         unsigned NumClauses,
                                                         EmptyShell) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPSectionsDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPSectionsDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
   return new (Mem) OMPSectionsDirective(NumClauses);
@@ -256,8 +252,7 @@ OMPSectionDirective *OMPSectionDirective
                                                  SourceLocation EndLoc,
                                                  Stmt *AssociatedStmt,
                                                  bool HasCancel) {
-  unsigned Size =
-      llvm::alignTo(sizeof(OMPSectionDirective), llvm::alignOf<Stmt *>());
+  unsigned Size = llvm::alignTo(sizeof(OMPSectionDirective), alignof(Stmt *));
   void *Mem = C.Allocate(Size + sizeof(Stmt *));
   OMPSectionDirective *Dir = new (Mem) OMPSectionDirective(StartLoc, EndLoc);
   Dir->setAssociatedStmt(AssociatedStmt);
@@ -267,8 +262,7 @@ OMPSectionDirective *OMPSectionDirective
 
 OMPSectionDirective *OMPSectionDirective::CreateEmpty(const ASTContext &C,
                                                       EmptyShell) {
-  unsigned Size =
-      llvm::alignTo(sizeof(OMPSectionDirective), llvm::alignOf<Stmt *>());
+  unsigned Size = llvm::alignTo(sizeof(OMPSectionDirective), alignof(Stmt *));
   void *Mem = C.Allocate(Size + sizeof(Stmt *));
   return new (Mem) OMPSectionDirective();
 }
@@ -279,7 +273,7 @@ OMPSingleDirective *OMPSingleDirective::
                                                ArrayRef<OMPClause *> Clauses,
                                                Stmt *AssociatedStmt) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPSingleDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPSingleDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
   OMPSingleDirective *Dir =
@@ -293,7 +287,7 @@ OMPSingleDirective *OMPSingleDirective::
                                                     unsigned NumClauses,
                                                     EmptyShell) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPSingleDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPSingleDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
   return new (Mem) OMPSingleDirective(NumClauses);
@@ -303,8 +297,7 @@ OMPMasterDirective *OMPMasterDirective::
                                                SourceLocation StartLoc,
                                                SourceLocation EndLoc,
                                                Stmt *AssociatedStmt) {
-  unsigned Size =
-      llvm::alignTo(sizeof(OMPMasterDirective), llvm::alignOf<Stmt *>());
+  unsigned Size = llvm::alignTo(sizeof(OMPMasterDirective), alignof(Stmt *));
   void *Mem = C.Allocate(Size + sizeof(Stmt *));
   OMPMasterDirective *Dir = new (Mem) OMPMasterDirective(StartLoc, EndLoc);
   Dir->setAssociatedStmt(AssociatedStmt);
@@ -313,8 +306,7 @@ OMPMasterDirective *OMPMasterDirective::
 
 OMPMasterDirective *OMPMasterDirective::CreateEmpty(const ASTContext &C,
                                                     EmptyShell) {
-  unsigned Size =
-      llvm::alignTo(sizeof(OMPMasterDirective), llvm::alignOf<Stmt *>());
+  unsigned Size = llvm::alignTo(sizeof(OMPMasterDirective), alignof(Stmt *));
   void *Mem = C.Allocate(Size + sizeof(Stmt *));
   return new (Mem) OMPMasterDirective();
 }
@@ -324,7 +316,7 @@ OMPCriticalDirective *OMPCriticalDirecti
     SourceLocation StartLoc, SourceLocation EndLoc,
     ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPCriticalDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPCriticalDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
   OMPCriticalDirective *Dir =
@@ -338,7 +330,7 @@ OMPCriticalDirective *OMPCriticalDirecti
                                                         unsigned NumClauses,
                                                         EmptyShell) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPCriticalDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPCriticalDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
   return new (Mem) OMPCriticalDirective(NumClauses);
@@ -348,8 +340,8 @@ OMPParallelForDirective *OMPParallelForD
     const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
     unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
     const HelperExprs &Exprs, bool HasCancel) {
-  unsigned Size = llvm::alignTo(sizeof(OMPParallelForDirective),
-                                llvm::alignOf<OMPClause *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPParallelForDirective), alignof(OMPClause *));
   void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
                          sizeof(Stmt *) *
                              numLoopChildren(CollapsedNum, OMPD_parallel_for));
@@ -387,8 +379,8 @@ OMPParallelForDirective *OMPParallelForD
 OMPParallelForDirective *
 OMPParallelForDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
                                      unsigned CollapsedNum, EmptyShell) {
-  unsigned Size = llvm::alignTo(sizeof(OMPParallelForDirective),
-                                llvm::alignOf<OMPClause *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPParallelForDirective), alignof(OMPClause *));
   void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
                          sizeof(Stmt *) *
                              numLoopChildren(CollapsedNum, OMPD_parallel_for));
@@ -399,8 +391,8 @@ OMPParallelForSimdDirective *OMPParallel
     const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
     unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
     const HelperExprs &Exprs) {
-  unsigned Size = llvm::alignTo(sizeof(OMPParallelForSimdDirective),
-                                llvm::alignOf<OMPClause *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPParallelForSimdDirective), alignof(OMPClause *));
   void *Mem = C.Allocate(
       Size + sizeof(OMPClause *) * Clauses.size() +
       sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd));
@@ -438,8 +430,8 @@ OMPParallelForSimdDirective *
 OMPParallelForSimdDirective::CreateEmpty(const ASTContext &C,
                                          unsigned NumClauses,
                                          unsigned CollapsedNum, EmptyShell) {
-  unsigned Size = llvm::alignTo(sizeof(OMPParallelForSimdDirective),
-                                llvm::alignOf<OMPClause *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPParallelForSimdDirective), alignof(OMPClause *));
   void *Mem = C.Allocate(
       Size + sizeof(OMPClause *) * NumClauses +
       sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd));
@@ -449,8 +441,8 @@ OMPParallelForSimdDirective::CreateEmpty
 OMPParallelSectionsDirective *OMPParallelSectionsDirective::Create(
     const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
     ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
-  unsigned Size = llvm::alignTo(sizeof(OMPParallelSectionsDirective),
-                                llvm::alignOf<OMPClause *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPParallelSectionsDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
   OMPParallelSectionsDirective *Dir =
@@ -464,8 +456,8 @@ OMPParallelSectionsDirective *OMPParalle
 OMPParallelSectionsDirective *
 OMPParallelSectionsDirective::CreateEmpty(const ASTContext &C,
                                           unsigned NumClauses, EmptyShell) {
-  unsigned Size = llvm::alignTo(sizeof(OMPParallelSectionsDirective),
-                                llvm::alignOf<OMPClause *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPParallelSectionsDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
   return new (Mem) OMPParallelSectionsDirective(NumClauses);
@@ -475,8 +467,7 @@ OMPTaskDirective *
 OMPTaskDirective::Create(const ASTContext &C, SourceLocation StartLoc,
                          SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
                          Stmt *AssociatedStmt, bool HasCancel) {
-  unsigned Size =
-      llvm::alignTo(sizeof(OMPTaskDirective), llvm::alignOf<OMPClause *>());
+  unsigned Size = llvm::alignTo(sizeof(OMPTaskDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
   OMPTaskDirective *Dir =
@@ -490,8 +481,7 @@ OMPTaskDirective::Create(const ASTContex
 OMPTaskDirective *OMPTaskDirective::CreateEmpty(const ASTContext &C,
                                                 unsigned NumClauses,
                                                 EmptyShell) {
-  unsigned Size =
-      llvm::alignTo(sizeof(OMPTaskDirective), llvm::alignOf<OMPClause *>());
+  unsigned Size = llvm::alignTo(sizeof(OMPTaskDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
   return new (Mem) OMPTaskDirective(NumClauses);
@@ -544,8 +534,7 @@ OMPTaskgroupDirective *OMPTaskgroupDirec
                                                      SourceLocation StartLoc,
                                                      SourceLocation EndLoc,
                                                      Stmt *AssociatedStmt) {
-  unsigned Size =
-      llvm::alignTo(sizeof(OMPTaskgroupDirective), llvm::alignOf<Stmt *>());
+  unsigned Size = llvm::alignTo(sizeof(OMPTaskgroupDirective), alignof(Stmt *));
   void *Mem = C.Allocate(Size + sizeof(Stmt *));
   OMPTaskgroupDirective *Dir =
       new (Mem) OMPTaskgroupDirective(StartLoc, EndLoc);
@@ -555,8 +544,7 @@ OMPTaskgroupDirective *OMPTaskgroupDirec
 
 OMPTaskgroupDirective *OMPTaskgroupDirective::CreateEmpty(const ASTContext &C,
                                                           EmptyShell) {
-  unsigned Size =
-      llvm::alignTo(sizeof(OMPTaskgroupDirective), llvm::alignOf<Stmt *>());
+  unsigned Size = llvm::alignTo(sizeof(OMPTaskgroupDirective), alignof(Stmt *));
   void *Mem = C.Allocate(Size + sizeof(Stmt *));
   return new (Mem) OMPTaskgroupDirective();
 }
@@ -564,8 +552,8 @@ OMPTaskgroupDirective *OMPTaskgroupDirec
 OMPCancellationPointDirective *OMPCancellationPointDirective::Create(
     const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
     OpenMPDirectiveKind CancelRegion) {
-  unsigned Size = llvm::alignTo(sizeof(OMPCancellationPointDirective),
-                                llvm::alignOf<Stmt *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPCancellationPointDirective), alignof(Stmt *));
   void *Mem = C.Allocate(Size);
   OMPCancellationPointDirective *Dir =
       new (Mem) OMPCancellationPointDirective(StartLoc, EndLoc);
@@ -575,8 +563,8 @@ OMPCancellationPointDirective *OMPCancel
 
 OMPCancellationPointDirective *
 OMPCancellationPointDirective::CreateEmpty(const ASTContext &C, EmptyShell) {
-  unsigned Size = llvm::alignTo(sizeof(OMPCancellationPointDirective),
-                                llvm::alignOf<Stmt *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPCancellationPointDirective), alignof(Stmt *));
   void *Mem = C.Allocate(Size);
   return new (Mem) OMPCancellationPointDirective();
 }
@@ -587,7 +575,7 @@ OMPCancelDirective::Create(const ASTCont
                            OpenMPDirectiveKind CancelRegion) {
   unsigned Size = llvm::alignTo(sizeof(OMPCancelDirective) +
                                     sizeof(OMPClause *) * Clauses.size(),
-                                llvm::alignOf<Stmt *>());
+                                alignof(Stmt *));
   void *Mem = C.Allocate(Size);
   OMPCancelDirective *Dir =
       new (Mem) OMPCancelDirective(StartLoc, EndLoc, Clauses.size());
@@ -601,7 +589,7 @@ OMPCancelDirective *OMPCancelDirective::
                                                     EmptyShell) {
   unsigned Size = llvm::alignTo(sizeof(OMPCancelDirective) +
                                     sizeof(OMPClause *) * NumClauses,
-                                llvm::alignOf<Stmt *>());
+                                alignof(Stmt *));
   void *Mem = C.Allocate(Size);
   return new (Mem) OMPCancelDirective(NumClauses);
 }
@@ -611,7 +599,7 @@ OMPFlushDirective *OMPFlushDirective::Cr
                                              SourceLocation EndLoc,
                                              ArrayRef<OMPClause *> Clauses) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPFlushDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPFlushDirective), alignof(OMPClause *));
   void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size());
   OMPFlushDirective *Dir =
       new (Mem) OMPFlushDirective(StartLoc, EndLoc, Clauses.size());
@@ -623,7 +611,7 @@ OMPFlushDirective *OMPFlushDirective::Cr
                                                   unsigned NumClauses,
                                                   EmptyShell) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPFlushDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPFlushDirective), alignof(OMPClause *));
   void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses);
   return new (Mem) OMPFlushDirective(NumClauses);
 }
@@ -634,7 +622,7 @@ OMPOrderedDirective *OMPOrderedDirective
                                                  ArrayRef<OMPClause *> Clauses,
                                                  Stmt *AssociatedStmt) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPOrderedDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPOrderedDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(Stmt *) + sizeof(OMPClause *) * Clauses.size());
   OMPOrderedDirective *Dir =
@@ -648,7 +636,7 @@ OMPOrderedDirective *OMPOrderedDirective
                                                       unsigned NumClauses,
                                                       EmptyShell) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPOrderedDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPOrderedDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(Stmt *) + sizeof(OMPClause *) * NumClauses);
   return new (Mem) OMPOrderedDirective(NumClauses);
@@ -659,7 +647,7 @@ OMPAtomicDirective *OMPAtomicDirective::
     ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *X, Expr *V,
     Expr *E, Expr *UE, bool IsXLHSInRHSPart, bool IsPostfixUpdate) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPAtomicDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPAtomicDirective), alignof(OMPClause *));
   void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
                          5 * sizeof(Stmt *));
   OMPAtomicDirective *Dir =
@@ -679,7 +667,7 @@ OMPAtomicDirective *OMPAtomicDirective::
                                                     unsigned NumClauses,
                                                     EmptyShell) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPAtomicDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPAtomicDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 5 * sizeof(Stmt *));
   return new (Mem) OMPAtomicDirective(NumClauses);
@@ -691,7 +679,7 @@ OMPTargetDirective *OMPTargetDirective::
                                                ArrayRef<OMPClause *> Clauses,
                                                Stmt *AssociatedStmt) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPTargetDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPTargetDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
   OMPTargetDirective *Dir =
@@ -705,7 +693,7 @@ OMPTargetDirective *OMPTargetDirective::
                                                     unsigned NumClauses,
                                                     EmptyShell) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPTargetDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPTargetDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
   return new (Mem) OMPTargetDirective(NumClauses);
@@ -714,8 +702,8 @@ OMPTargetDirective *OMPTargetDirective::
 OMPTargetParallelDirective *OMPTargetParallelDirective::Create(
     const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
     ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
-  unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelDirective),
-                                llvm::alignOf<OMPClause *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPTargetParallelDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
   OMPTargetParallelDirective *Dir =
@@ -728,8 +716,8 @@ OMPTargetParallelDirective *OMPTargetPar
 OMPTargetParallelDirective *
 OMPTargetParallelDirective::CreateEmpty(const ASTContext &C,
                                         unsigned NumClauses, EmptyShell) {
-  unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelDirective),
-                                llvm::alignOf<OMPClause *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPTargetParallelDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
   return new (Mem) OMPTargetParallelDirective(NumClauses);
@@ -740,7 +728,7 @@ OMPTargetParallelForDirective *OMPTarget
     unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
     const HelperExprs &Exprs, bool HasCancel) {
   unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForDirective),
-                                llvm::alignOf<OMPClause *>());
+                                alignof(OMPClause *));
   void *Mem = C.Allocate(
       Size + sizeof(OMPClause *) * Clauses.size() +
       sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for));
@@ -780,7 +768,7 @@ OMPTargetParallelForDirective::CreateEmp
                                            unsigned NumClauses,
                                            unsigned CollapsedNum, EmptyShell) {
   unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForDirective),
-                                llvm::alignOf<OMPClause *>());
+                                alignof(OMPClause *));
   void *Mem = C.Allocate(
       Size + sizeof(OMPClause *) * NumClauses +
       sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for));
@@ -790,9 +778,9 @@ OMPTargetParallelForDirective::CreateEmp
 OMPTargetDataDirective *OMPTargetDataDirective::Create(
     const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
     ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
-  void *Mem = C.Allocate(llvm::alignTo(sizeof(OMPTargetDataDirective),
-                                       llvm::alignOf<OMPClause *>()) +
-                         sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
+  void *Mem = C.Allocate(
+      llvm::alignTo(sizeof(OMPTargetDataDirective), alignof(OMPClause *)) +
+      sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
   OMPTargetDataDirective *Dir =
       new (Mem) OMPTargetDataDirective(StartLoc, EndLoc, Clauses.size());
   Dir->setClauses(Clauses);
@@ -803,18 +791,18 @@ OMPTargetDataDirective *OMPTargetDataDir
 OMPTargetDataDirective *OMPTargetDataDirective::CreateEmpty(const ASTContext &C,
                                                             unsigned N,
                                                             EmptyShell) {
-  void *Mem = C.Allocate(llvm::alignTo(sizeof(OMPTargetDataDirective),
-                                       llvm::alignOf<OMPClause *>()) +
-                         sizeof(OMPClause *) * N + sizeof(Stmt *));
+  void *Mem = C.Allocate(
+      llvm::alignTo(sizeof(OMPTargetDataDirective), alignof(OMPClause *)) +
+      sizeof(OMPClause *) * N + sizeof(Stmt *));
   return new (Mem) OMPTargetDataDirective(N);
 }
 
 OMPTargetEnterDataDirective *OMPTargetEnterDataDirective::Create(
     const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
     ArrayRef<OMPClause *> Clauses) {
-  void *Mem = C.Allocate(llvm::alignTo(sizeof(OMPTargetEnterDataDirective),
-                                       llvm::alignOf<OMPClause *>()) +
-                         sizeof(OMPClause *) * Clauses.size());
+  void *Mem = C.Allocate(
+      llvm::alignTo(sizeof(OMPTargetEnterDataDirective), alignof(OMPClause *)) +
+      sizeof(OMPClause *) * Clauses.size());
   OMPTargetEnterDataDirective *Dir =
       new (Mem) OMPTargetEnterDataDirective(StartLoc, EndLoc, Clauses.size());
   Dir->setClauses(Clauses);
@@ -824,9 +812,9 @@ OMPTargetEnterDataDirective *OMPTargetEn
 OMPTargetEnterDataDirective *
 OMPTargetEnterDataDirective::CreateEmpty(const ASTContext &C, unsigned N,
                                          EmptyShell) {
-  void *Mem = C.Allocate(llvm::alignTo(sizeof(OMPTargetEnterDataDirective),
-                                       llvm::alignOf<OMPClause *>()) +
-                         sizeof(OMPClause *) * N);
+  void *Mem = C.Allocate(
+      llvm::alignTo(sizeof(OMPTargetEnterDataDirective), alignof(OMPClause *)) +
+      sizeof(OMPClause *) * N);
   return new (Mem) OMPTargetEnterDataDirective(N);
 }
 
@@ -834,9 +822,9 @@ OMPTargetExitDataDirective *
 OMPTargetExitDataDirective::Create(const ASTContext &C, SourceLocation StartLoc,
                                    SourceLocation EndLoc,
                                    ArrayRef<OMPClause *> Clauses) {
-  void *Mem = C.Allocate(llvm::alignTo(sizeof(OMPTargetExitDataDirective),
-                                       llvm::alignOf<OMPClause *>()) +
-                         sizeof(OMPClause *) * Clauses.size());
+  void *Mem = C.Allocate(
+      llvm::alignTo(sizeof(OMPTargetExitDataDirective), alignof(OMPClause *)) +
+      sizeof(OMPClause *) * Clauses.size());
   OMPTargetExitDataDirective *Dir =
       new (Mem) OMPTargetExitDataDirective(StartLoc, EndLoc, Clauses.size());
   Dir->setClauses(Clauses);
@@ -846,9 +834,9 @@ OMPTargetExitDataDirective::Create(const
 OMPTargetExitDataDirective *
 OMPTargetExitDataDirective::CreateEmpty(const ASTContext &C, unsigned N,
                                         EmptyShell) {
-  void *Mem = C.Allocate(llvm::alignTo(sizeof(OMPTargetExitDataDirective),
-                                       llvm::alignOf<OMPClause *>()) +
-                         sizeof(OMPClause *) * N);
+  void *Mem = C.Allocate(
+      llvm::alignTo(sizeof(OMPTargetExitDataDirective), alignof(OMPClause *)) +
+      sizeof(OMPClause *) * N);
   return new (Mem) OMPTargetExitDataDirective(N);
 }
 
@@ -858,7 +846,7 @@ OMPTeamsDirective *OMPTeamsDirective::Cr
                                              ArrayRef<OMPClause *> Clauses,
                                              Stmt *AssociatedStmt) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPTeamsDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPTeamsDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
   OMPTeamsDirective *Dir =
@@ -872,7 +860,7 @@ OMPTeamsDirective *OMPTeamsDirective::Cr
                                                   unsigned NumClauses,
                                                   EmptyShell) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPTeamsDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPTeamsDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
   return new (Mem) OMPTeamsDirective(NumClauses);
@@ -883,7 +871,7 @@ OMPTaskLoopDirective *OMPTaskLoopDirecti
     unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
     const HelperExprs &Exprs) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPTaskLoopDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPTaskLoopDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
                  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_taskloop));
@@ -922,7 +910,7 @@ OMPTaskLoopDirective *OMPTaskLoopDirecti
                                                         unsigned CollapsedNum,
                                                         EmptyShell) {
   unsigned Size =
-      llvm::alignTo(sizeof(OMPTaskLoopDirective), llvm::alignOf<OMPClause *>());
+      llvm::alignTo(sizeof(OMPTaskLoopDirective), alignof(OMPClause *));
   void *Mem =
       C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
                  sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_taskloop));
@@ -933,8 +921,8 @@ OMPTaskLoopSimdDirective *OMPTaskLoopSim
     const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
     unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
     const HelperExprs &Exprs) {
-  unsigned Size = llvm::alignTo(sizeof(OMPTaskLoopSimdDirective),
-                                llvm::alignOf<OMPClause *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPTaskLoopSimdDirective), alignof(OMPClause *));
   void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
                          sizeof(Stmt *) *
                              numLoopChildren(CollapsedNum, OMPD_taskloop_simd));
@@ -971,8 +959,8 @@ OMPTaskLoopSimdDirective *OMPTaskLoopSim
 OMPTaskLoopSimdDirective *
 OMPTaskLoopSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
                                       unsigned CollapsedNum, EmptyShell) {
-  unsigned Size = llvm::alignTo(sizeof(OMPTaskLoopSimdDirective),
-                                llvm::alignOf<OMPClause *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPTaskLoopSimdDirective), alignof(OMPClause *));
   void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
                          sizeof(Stmt *) *
                              numLoopChildren(CollapsedNum, OMPD_taskloop_simd));
@@ -983,8 +971,8 @@ OMPDistributeDirective *OMPDistributeDir
     const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
     unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
     const HelperExprs &Exprs) {
-  unsigned Size = llvm::alignTo(sizeof(OMPDistributeDirective),
-                                llvm::alignOf<OMPClause *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPDistributeDirective), alignof(OMPClause *));
   void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
                          sizeof(Stmt *) *
                              numLoopChildren(CollapsedNum, OMPD_distribute));
@@ -1021,8 +1009,8 @@ OMPDistributeDirective *OMPDistributeDir
 OMPDistributeDirective *
 OMPDistributeDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
                                     unsigned CollapsedNum, EmptyShell) {
-  unsigned Size = llvm::alignTo(sizeof(OMPDistributeDirective),
-                                llvm::alignOf<OMPClause *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPDistributeDirective), alignof(OMPClause *));
   void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
                          sizeof(Stmt *) *
                              numLoopChildren(CollapsedNum, OMPD_distribute));
@@ -1033,8 +1021,8 @@ OMPTargetUpdateDirective *
 OMPTargetUpdateDirective::Create(const ASTContext &C, SourceLocation StartLoc,
                                  SourceLocation EndLoc,
                                  ArrayRef<OMPClause *> Clauses) {
-  unsigned Size = llvm::alignTo(sizeof(OMPTargetUpdateDirective),
-                                llvm::alignOf<OMPClause *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPTargetUpdateDirective), alignof(OMPClause *));
   void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size());
   OMPTargetUpdateDirective *Dir =
       new (Mem) OMPTargetUpdateDirective(StartLoc, EndLoc, Clauses.size());
@@ -1045,8 +1033,8 @@ OMPTargetUpdateDirective::Create(const A
 OMPTargetUpdateDirective *
 OMPTargetUpdateDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
                                       EmptyShell) {
-  unsigned Size = llvm::alignTo(sizeof(OMPTargetUpdateDirective),
-                                llvm::alignOf<OMPClause *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPTargetUpdateDirective), alignof(OMPClause *));
   void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses);
   return new (Mem) OMPTargetUpdateDirective(NumClauses);
 }
@@ -1056,7 +1044,7 @@ OMPDistributeParallelForDirective *OMPDi
     unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
     const HelperExprs &Exprs) {
   unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective),
-                                llvm::alignOf<OMPClause *>());
+                                alignof(OMPClause *));
   void *Mem = C.Allocate(
       Size + sizeof(OMPClause *) * Clauses.size() +
       sizeof(Stmt *) *
@@ -1098,7 +1086,7 @@ OMPDistributeParallelForDirective::Creat
                                                unsigned CollapsedNum,
                                                EmptyShell) {
   unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective),
-                                llvm::alignOf<OMPClause *>());
+                                alignof(OMPClause *));
   void *Mem = C.Allocate(
       Size + sizeof(OMPClause *) * NumClauses +
       sizeof(Stmt *) *
@@ -1112,7 +1100,7 @@ OMPDistributeParallelForSimdDirective::C
     unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
     const HelperExprs &Exprs) {
   unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForSimdDirective),
-                                llvm::alignOf<OMPClause *>());
+                                alignof(OMPClause *));
   void *Mem = C.Allocate(
       Size + sizeof(OMPClause *) * Clauses.size() +
       sizeof(Stmt *) *
@@ -1154,7 +1142,7 @@ OMPDistributeParallelForSimdDirective::C
                                                    unsigned CollapsedNum,
                                                    EmptyShell) {
   unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForSimdDirective),
-                                llvm::alignOf<OMPClause *>());
+                                alignof(OMPClause *));
   void *Mem = C.Allocate(
       Size + sizeof(OMPClause *) * NumClauses +
       sizeof(Stmt *) *
@@ -1167,8 +1155,8 @@ OMPDistributeSimdDirective *OMPDistribut
     const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
     unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
     const HelperExprs &Exprs) {
-  unsigned Size = llvm::alignTo(sizeof(OMPDistributeSimdDirective),
-                                llvm::alignOf<OMPClause *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPDistributeSimdDirective), alignof(OMPClause *));
   void *Mem = C.Allocate(
       Size + sizeof(OMPClause *) * Clauses.size() +
       sizeof(Stmt *) *
@@ -1207,8 +1195,8 @@ OMPDistributeSimdDirective *
 OMPDistributeSimdDirective::CreateEmpty(const ASTContext &C,
                                         unsigned NumClauses,
                                         unsigned CollapsedNum, EmptyShell) {
-  unsigned Size = llvm::alignTo(sizeof(OMPDistributeSimdDirective),
-                                llvm::alignOf<OMPClause *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPDistributeSimdDirective), alignof(OMPClause *));
   void *Mem = C.Allocate(
       Size + sizeof(OMPClause *) * NumClauses +
       sizeof(Stmt *) *
@@ -1221,7 +1209,7 @@ OMPTargetParallelForSimdDirective *OMPTa
     unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
     const HelperExprs &Exprs) {
   unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForSimdDirective),
-                                llvm::alignOf<OMPClause *>());
+                                alignof(OMPClause *));
   void *Mem = C.Allocate(
       Size + sizeof(OMPClause *) * Clauses.size() +
       sizeof(Stmt *) * 
@@ -1263,7 +1251,7 @@ OMPTargetParallelForSimdDirective::Creat
                                                unsigned CollapsedNum,
                                                EmptyShell) {
   unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForSimdDirective),
-                                llvm::alignOf<OMPClause *>());
+                                alignof(OMPClause *));
   void *Mem = C.Allocate(
       Size + sizeof(OMPClause *) * NumClauses +
       sizeof(Stmt *) * 
@@ -1276,8 +1264,8 @@ OMPTargetSimdDirective::Create(const AST
                                SourceLocation EndLoc, unsigned CollapsedNum,
                                ArrayRef<OMPClause *> Clauses,
                                Stmt *AssociatedStmt, const HelperExprs &Exprs) {
-  unsigned Size = llvm::alignTo(sizeof(OMPTargetSimdDirective),
-                                llvm::alignOf<OMPClause *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPTargetSimdDirective), alignof(OMPClause *));
   void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
                          sizeof(Stmt *) * 
                              numLoopChildren(CollapsedNum, OMPD_target_simd));
@@ -1304,8 +1292,8 @@ OMPTargetSimdDirective::Create(const AST
 OMPTargetSimdDirective *
 OMPTargetSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
                                     unsigned CollapsedNum, EmptyShell) {
-  unsigned Size = llvm::alignTo(sizeof(OMPTargetSimdDirective),
-                                llvm::alignOf<OMPClause *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPTargetSimdDirective), alignof(OMPClause *));
   void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
                          sizeof(Stmt *) * 
                              numLoopChildren(CollapsedNum, OMPD_target_simd));
@@ -1316,8 +1304,8 @@ OMPTeamsDistributeDirective *OMPTeamsDis
     const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
     unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
     const HelperExprs &Exprs) {
-  unsigned Size = llvm::alignTo(sizeof(OMPTeamsDistributeDirective),
-                                llvm::alignOf<OMPClause *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPTeamsDistributeDirective), alignof(OMPClause *));
   void *Mem = C.Allocate(
       Size + sizeof(OMPClause *) * Clauses.size() +
       sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));
@@ -1355,8 +1343,8 @@ OMPTeamsDistributeDirective *
 OMPTeamsDistributeDirective::CreateEmpty(const ASTContext &C,
                                          unsigned NumClauses,
                                          unsigned CollapsedNum, EmptyShell) {
-  unsigned Size = llvm::alignTo(sizeof(OMPTeamsDistributeDirective),
-                                llvm::alignOf<OMPClause *>());
+  unsigned Size =
+      llvm::alignTo(sizeof(OMPTeamsDistributeDirective), alignof(OMPClause *));
   void *Mem = C.Allocate(
       Size + sizeof(OMPClause *) * NumClauses +
       sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));

Modified: cfe/trunk/lib/AST/TemplateBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TemplateBase.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/AST/TemplateBase.cpp (original)
+++ cfe/trunk/lib/AST/TemplateBase.cpp Thu Oct 20 09:27:22 2016
@@ -530,7 +530,7 @@ const ASTTemplateArgumentListInfo *
 ASTTemplateArgumentListInfo::Create(ASTContext &C,
                                     const TemplateArgumentListInfo &List) {
   std::size_t size = totalSizeToAlloc<TemplateArgumentLoc>(List.size());
-  void *Mem = C.Allocate(size, llvm::alignOf<ASTTemplateArgumentListInfo>());
+  void *Mem = C.Allocate(size, alignof(ASTTemplateArgumentListInfo));
   return new (Mem) ASTTemplateArgumentListInfo(List);
 }
 

Modified: cfe/trunk/lib/AST/TypeLoc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TypeLoc.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/AST/TypeLoc.cpp (original)
+++ cfe/trunk/lib/AST/TypeLoc.cpp Thu Oct 20 09:27:22 2016
@@ -18,7 +18,7 @@
 #include "llvm/Support/ErrorHandling.h"
 using namespace clang;
 
-static const unsigned TypeLocMaxDataAlign = llvm::alignOf<void *>();
+static const unsigned TypeLocMaxDataAlign = alignof(void *);
 
 //===----------------------------------------------------------------------===//
 // TypeLoc Implementation

Modified: cfe/trunk/lib/Analysis/CFG.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CFG.cpp (original)
+++ cfe/trunk/lib/Analysis/CFG.cpp Thu Oct 20 09:27:22 2016
@@ -2050,8 +2050,7 @@ CFGBlock *CFGBuilder::VisitDeclStmt(Decl
                                        E = DS->decl_rend();
        I != E; ++I) {
     // Get the alignment of the new DeclStmt, padding out to >=8 bytes.
-    unsigned A = llvm::AlignOf<DeclStmt>::Alignment < 8
-               ? 8 : llvm::AlignOf<DeclStmt>::Alignment;
+    unsigned A = alignof(DeclStmt) < 8 ? 8 : alignof(DeclStmt);
 
     // Allocate the DeclStmt using the BumpPtrAllocator.  It will get
     // automatically freed with the CFG.

Modified: cfe/trunk/lib/Basic/IdentifierTable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/IdentifierTable.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/IdentifierTable.cpp (original)
+++ cfe/trunk/lib/Basic/IdentifierTable.cpp Thu Oct 20 09:27:22 2016
@@ -621,8 +621,8 @@ Selector SelectorTable::getSelector(unsi
   // variable size array (for parameter types) at the end of them.
   unsigned Size = sizeof(MultiKeywordSelector) + nKeys*sizeof(IdentifierInfo *);
   MultiKeywordSelector *SI =
-    (MultiKeywordSelector*)SelTabImpl.Allocator.Allocate(Size,
-                                         llvm::alignOf<MultiKeywordSelector>());
+      (MultiKeywordSelector *)SelTabImpl.Allocator.Allocate(
+          Size, alignof(MultiKeywordSelector));
   new (SI) MultiKeywordSelector(nKeys, IIV);
   SelTabImpl.Table.InsertNode(SI, InsertPos);
   return Selector(SI);

Modified: cfe/trunk/lib/CodeGen/CGCleanup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCleanup.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCleanup.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCleanup.cpp Thu Oct 20 09:27:22 2016
@@ -445,7 +445,7 @@ CodeGenFunction::PopCleanupBlocks(EHScop
   for (size_t I = OldLifetimeExtendedSize,
               E = LifetimeExtendedCleanupStack.size(); I != E; /**/) {
     // Alignment should be guaranteed by the vptrs in the individual cleanups.
-    assert((I % llvm::alignOf<LifetimeExtendedCleanupHeader>() == 0) &&
+    assert((I % alignof(LifetimeExtendedCleanupHeader) == 0) &&
            "misaligned cleanup stack entry");
 
     LifetimeExtendedCleanupHeader &Header =

Modified: cfe/trunk/lib/CodeGen/CGCleanup.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCleanup.h?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCleanup.h (original)
+++ cfe/trunk/lib/CodeGen/CGCleanup.h Thu Oct 20 09:27:22 2016
@@ -427,8 +427,7 @@ public:
 // EHCleanupScope ought to have alignment equal to that -- not more
 // (would be misaligned by the stack allocator), and not less (would
 // break the appended classes).
-static_assert(llvm::AlignOf<EHCleanupScope>::Alignment ==
-                  EHScopeStack::ScopeStackAlignment,
+static_assert(alignof(EHCleanupScope) == EHScopeStack::ScopeStackAlignment,
               "EHCleanupScope expected alignment");
 
 /// An exceptions scope which filters exceptions thrown through it.

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Thu Oct 20 09:27:22 2016
@@ -441,7 +441,7 @@ public:
     LifetimeExtendedCleanupStack.resize(
         LifetimeExtendedCleanupStack.size() + sizeof(Header) + Header.Size);
 
-    static_assert(sizeof(Header) % llvm::AlignOf<T>::Alignment == 0,
+    static_assert(sizeof(Header) % alignof(T) == 0,
                   "Cleanup will be allocated on misaligned address");
     char *Buffer = &LifetimeExtendedCleanupStack[OldSize];
     new (Buffer) LifetimeExtendedCleanupHeader(Header);

Modified: cfe/trunk/lib/CodeGen/EHScopeStack.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/EHScopeStack.h?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/EHScopeStack.h (original)
+++ cfe/trunk/lib/CodeGen/EHScopeStack.h Thu Oct 20 09:27:22 2016
@@ -271,7 +271,7 @@ public:
 
   /// Push a lazily-created cleanup on the stack.
   template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
-    static_assert(llvm::AlignOf<T>::Alignment <= ScopeStackAlignment,
+    static_assert(alignof(T) <= ScopeStackAlignment,
                   "Cleanup's alignment is too large.");
     void *Buffer = pushCleanup(Kind, sizeof(T));
     Cleanup *Obj = new (Buffer) T(A...);
@@ -281,7 +281,7 @@ public:
   /// Push a lazily-created cleanup on the stack. Tuple version.
   template <class T, class... As>
   void pushCleanupTuple(CleanupKind Kind, std::tuple<As...> A) {
-    static_assert(llvm::AlignOf<T>::Alignment <= ScopeStackAlignment,
+    static_assert(alignof(T) <= ScopeStackAlignment,
                   "Cleanup's alignment is too large.");
     void *Buffer = pushCleanup(Kind, sizeof(T));
     Cleanup *Obj = new (Buffer) T(std::move(A));
@@ -303,7 +303,7 @@ public:
   /// stack is modified.
   template <class T, class... As>
   T *pushCleanupWithExtra(CleanupKind Kind, size_t N, As... A) {
-    static_assert(llvm::AlignOf<T>::Alignment <= ScopeStackAlignment,
+    static_assert(alignof(T) <= ScopeStackAlignment,
                   "Cleanup's alignment is too large.");
     void *Buffer = pushCleanup(Kind, sizeof(T) + T::getExtraSize(N));
     return new (Buffer) T(N, A...);

Modified: cfe/trunk/lib/Lex/MacroInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/MacroInfo.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/MacroInfo.cpp (original)
+++ cfe/trunk/lib/Lex/MacroInfo.cpp Thu Oct 20 09:27:22 2016
@@ -240,6 +240,6 @@ ModuleMacro *ModuleMacro::create(Preproc
                                  ArrayRef<ModuleMacro *> Overrides) {
   void *Mem = PP.getPreprocessorAllocator().Allocate(
       sizeof(ModuleMacro) + sizeof(ModuleMacro *) * Overrides.size(),
-      llvm::alignOf<ModuleMacro>());
+      alignof(ModuleMacro));
   return new (Mem) ModuleMacro(OwningModule, II, Macro, Overrides);
 }

Modified: cfe/trunk/lib/Lex/PPDirectives.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPDirectives.cpp (original)
+++ cfe/trunk/lib/Lex/PPDirectives.cpp Thu Oct 20 09:27:22 2016
@@ -69,7 +69,7 @@ MacroInfo *Preprocessor::AllocateMacroIn
 
 MacroInfo *Preprocessor::AllocateDeserializedMacroInfo(SourceLocation L,
                                                        unsigned SubModuleID) {
-  static_assert(llvm::AlignOf<MacroInfo>::Alignment >= sizeof(SubModuleID),
+  static_assert(alignof(MacroInfo) >= sizeof(SubModuleID),
                 "alignment for MacroInfo is less than the ID");
   DeserializedMacroInfoChain *MIChain =
       BP.Allocate<DeserializedMacroInfoChain>();

Modified: cfe/trunk/lib/Lex/PreprocessingRecord.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PreprocessingRecord.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PreprocessingRecord.cpp (original)
+++ cfe/trunk/lib/Lex/PreprocessingRecord.cpp Thu Oct 20 09:27:22 2016
@@ -21,18 +21,13 @@ using namespace clang;
 
 ExternalPreprocessingRecordSource::~ExternalPreprocessingRecordSource() { }
 
-
 InclusionDirective::InclusionDirective(PreprocessingRecord &PPRec,
-                                       InclusionKind Kind, 
-                                       StringRef FileName, 
+                                       InclusionKind Kind, StringRef FileName,
                                        bool InQuotes, bool ImportedModule,
-                                       const FileEntry *File,
-                                       SourceRange Range)
-  : PreprocessingDirective(InclusionDirectiveKind, Range), 
-    InQuotes(InQuotes), Kind(Kind), ImportedModule(ImportedModule), File(File)
-{ 
-  char *Memory 
-    = (char*)PPRec.Allocate(FileName.size() + 1, llvm::alignOf<char>());
+                                       const FileEntry *File, SourceRange Range)
+    : PreprocessingDirective(InclusionDirectiveKind, Range), InQuotes(InQuotes),
+      Kind(Kind), ImportedModule(ImportedModule), File(File) {
+  char *Memory = (char *)PPRec.Allocate(FileName.size() + 1, alignof(char));
   memcpy(Memory, FileName.data(), FileName.size());
   Memory[FileName.size()] = 0;
   this->FileName = StringRef(Memory, FileName.size());

Modified: cfe/trunk/lib/Sema/AttributeList.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AttributeList.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/AttributeList.cpp (original)
+++ cfe/trunk/lib/Sema/AttributeList.cpp Thu Oct 20 09:27:22 2016
@@ -62,7 +62,7 @@ void *AttributeFactory::allocate(size_t
   }
 
   // Otherwise, allocate something new.
-  return Alloc.Allocate(size, llvm::AlignOf<AttributeFactory>::Alignment);
+  return Alloc.Allocate(size, alignof(AttributeFactory));
 }
 
 void AttributeFactory::reclaimPool(AttributeList *cur) {

Modified: cfe/trunk/lib/Sema/CodeCompleteConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/CodeCompleteConsumer.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/CodeCompleteConsumer.cpp (original)
+++ cfe/trunk/lib/Sema/CodeCompleteConsumer.cpp Thu Oct 20 09:27:22 2016
@@ -328,9 +328,9 @@ StringRef CodeCompletionTUInfo::getParen
 
 CodeCompletionString *CodeCompletionBuilder::TakeString() {
   void *Mem = getAllocator().Allocate(
-                  sizeof(CodeCompletionString) + sizeof(Chunk) * Chunks.size()
-                                    + sizeof(const char *) * Annotations.size(),
-                                 llvm::alignOf<CodeCompletionString>());
+      sizeof(CodeCompletionString) + sizeof(Chunk) * Chunks.size() +
+          sizeof(const char *) * Annotations.size(),
+      alignof(CodeCompletionString));
   CodeCompletionString *Result 
     = new (Mem) CodeCompletionString(Chunks.data(), Chunks.size(),
                                      Priority, Availability,

Modified: cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCXXScopeSpec.cpp Thu Oct 20 09:27:22 2016
@@ -975,9 +975,9 @@ void *Sema::SaveNestedNameSpecifierAnnot
   if (SS.isEmpty() || SS.isInvalid())
     return nullptr;
 
-  void *Mem = Context.Allocate((sizeof(NestedNameSpecifierAnnotation) +
-                                                        SS.location_size()),
-                               llvm::alignOf<NestedNameSpecifierAnnotation>());
+  void *Mem = Context.Allocate(
+      (sizeof(NestedNameSpecifierAnnotation) + SS.location_size()),
+      alignof(NestedNameSpecifierAnnotation));
   NestedNameSpecifierAnnotation *Annotation
     = new (Mem) NestedNameSpecifierAnnotation;
   Annotation->NNS = SS.getScopeRep();

Modified: cfe/trunk/lib/Sema/TypeLocBuilder.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TypeLocBuilder.h?rev=284730&r1=284729&r2=284730&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TypeLocBuilder.h (original)
+++ cfe/trunk/lib/Sema/TypeLocBuilder.h Thu Oct 20 09:27:22 2016
@@ -39,7 +39,7 @@ class TypeLocBuilder {
 #endif
     
   /// The inline buffer.
-  enum { BufferMaxAlignment = llvm::AlignOf<void*>::Alignment };
+  enum { BufferMaxAlignment = alignof(void *) };
   llvm::AlignedCharArray<BufferMaxAlignment, InlineCapacity> InlineBuffer;
   unsigned NumBytesAtAlign4, NumBytesAtAlign8;
 




More information about the cfe-commits mailing list