forked from OSchip/llvm-project
Retire llvm::alignOf in favor of C++11 alignof.
No functionality change intended. llvm-svn: 284730
This commit is contained in:
parent
e9f132d3f4
commit
c3f89253ae
|
@ -582,7 +582,7 @@ public:
|
||||||
return BumpAlloc.Allocate(Size, Align);
|
return BumpAlloc.Allocate(Size, Align);
|
||||||
}
|
}
|
||||||
template <typename T> T *Allocate(size_t Num = 1) const {
|
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 { }
|
void Deallocate(void *Ptr) const { }
|
||||||
|
|
||||||
|
|
|
@ -380,7 +380,7 @@ void ASTVector<T>::grow(const ASTContext &C, size_t MinSize) {
|
||||||
NewCapacity = MinSize;
|
NewCapacity = MinSize;
|
||||||
|
|
||||||
// Allocate the memory from the ASTContext.
|
// 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.
|
// Copy the elements over.
|
||||||
if (Begin != End) {
|
if (Begin != End) {
|
||||||
|
|
|
@ -340,7 +340,7 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Stmt(StmtClass SC) {
|
Stmt(StmtClass SC) {
|
||||||
static_assert(sizeof(*this) % llvm::AlignOf<void *>::Alignment == 0,
|
static_assert(sizeof(*this) % alignof(void *) == 0,
|
||||||
"Insufficient alignment!");
|
"Insufficient alignment!");
|
||||||
StmtBits.sClass = SC;
|
StmtBits.sClass = SC;
|
||||||
if (StatisticsEnabled) Stmt::addStmtClass(SC);
|
if (StatisticsEnabled) Stmt::addStmtClass(SC);
|
||||||
|
|
|
@ -70,7 +70,7 @@ protected:
|
||||||
: Stmt(SC), Kind(K), StartLoc(std::move(StartLoc)),
|
: Stmt(SC), Kind(K), StartLoc(std::move(StartLoc)),
|
||||||
EndLoc(std::move(EndLoc)), NumClauses(NumClauses),
|
EndLoc(std::move(EndLoc)), NumClauses(NumClauses),
|
||||||
NumChildren(NumChildren),
|
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.
|
/// \brief Sets the list of variables for this clause.
|
||||||
///
|
///
|
||||||
|
|
|
@ -347,7 +347,7 @@ class ConcreteTypeLoc : public Base {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
unsigned getLocalDataAlignment() const {
|
unsigned getLocalDataAlignment() const {
|
||||||
return std::max(llvm::alignOf<LocalData>(),
|
return std::max(unsigned(alignof(LocalData)),
|
||||||
asDerived()->getExtraLocalDataAlignment());
|
asDerived()->getExtraLocalDataAlignment());
|
||||||
}
|
}
|
||||||
unsigned getLocalDataSize() const {
|
unsigned getLocalDataSize() const {
|
||||||
|
@ -487,8 +487,10 @@ class TypeSpecTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
|
||||||
Type,
|
Type,
|
||||||
TypeSpecLocInfo> {
|
TypeSpecLocInfo> {
|
||||||
public:
|
public:
|
||||||
enum { LocalDataSize = sizeof(TypeSpecLocInfo),
|
enum {
|
||||||
LocalDataAlignment = llvm::AlignOf<TypeSpecLocInfo>::Alignment };
|
LocalDataSize = sizeof(TypeSpecLocInfo),
|
||||||
|
LocalDataAlignment = alignof(TypeSpecLocInfo)
|
||||||
|
};
|
||||||
|
|
||||||
SourceLocation getNameLoc() const {
|
SourceLocation getNameLoc() const {
|
||||||
return this->getLocalData()->NameLoc;
|
return this->getLocalData()->NameLoc;
|
||||||
|
@ -548,7 +550,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned getExtraLocalDataAlignment() const {
|
unsigned getExtraLocalDataAlignment() const {
|
||||||
return needsExtraLocalData() ? llvm::alignOf<WrittenBuiltinSpecs>() : 1;
|
return needsExtraLocalData() ? alignof(WrittenBuiltinSpecs) : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
SourceRange getLocalSourceRange() const {
|
SourceRange getLocalSourceRange() const {
|
||||||
|
@ -768,7 +770,7 @@ public:
|
||||||
return (this->getNumProtocols() + 2) * sizeof(SourceLocation) ;
|
return (this->getNumProtocols() + 2) * sizeof(SourceLocation) ;
|
||||||
}
|
}
|
||||||
unsigned getExtraLocalDataAlignment() const {
|
unsigned getExtraLocalDataAlignment() const {
|
||||||
return llvm::alignOf<SourceLocation>();
|
return alignof(SourceLocation);
|
||||||
}
|
}
|
||||||
SourceRange getLocalSourceRange() const {
|
SourceRange getLocalSourceRange() const {
|
||||||
SourceLocation start = getNameLoc();
|
SourceLocation start = getNameLoc();
|
||||||
|
@ -1045,10 +1047,9 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned getExtraLocalDataAlignment() const {
|
unsigned getExtraLocalDataAlignment() const {
|
||||||
assert(llvm::alignOf<ObjCObjectTypeLoc>()
|
static_assert(alignof(ObjCObjectTypeLoc) >= alignof(TypeSourceInfo *),
|
||||||
>= llvm::alignOf<TypeSourceInfo *>() &&
|
"not enough alignment for tail-allocated data");
|
||||||
"not enough alignment for tail-allocated data");
|
return alignof(TypeSourceInfo *);
|
||||||
return llvm::alignOf<TypeSourceInfo *>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QualType getInnerType() const {
|
QualType getInnerType() const {
|
||||||
|
@ -1414,9 +1415,7 @@ public:
|
||||||
return getNumParams() * sizeof(ParmVarDecl *);
|
return getNumParams() * sizeof(ParmVarDecl *);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned getExtraLocalDataAlignment() const {
|
unsigned getExtraLocalDataAlignment() const { return alignof(ParmVarDecl *); }
|
||||||
return llvm::alignOf<ParmVarDecl*>();
|
|
||||||
}
|
|
||||||
|
|
||||||
QualType getInnerType() const { return getTypePtr()->getReturnType(); }
|
QualType getInnerType() const { return getTypePtr()->getReturnType(); }
|
||||||
};
|
};
|
||||||
|
@ -1610,7 +1609,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned getExtraLocalDataAlignment() const {
|
unsigned getExtraLocalDataAlignment() const {
|
||||||
return llvm::alignOf<TemplateArgumentLocInfo>();
|
return alignof(TemplateArgumentLocInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -2020,7 +2019,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned getExtraLocalDataAlignment() const {
|
unsigned getExtraLocalDataAlignment() const {
|
||||||
return llvm::alignOf<TemplateArgumentLocInfo>();
|
return alignof(TemplateArgumentLocInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -45,7 +45,7 @@ public:
|
||||||
MemRegionRef(llvm::BumpPtrAllocator *A) : Allocator(A) {}
|
MemRegionRef(llvm::BumpPtrAllocator *A) : Allocator(A) {}
|
||||||
|
|
||||||
void *allocate(size_t Sz) {
|
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>(); }
|
template <typename T> T *allocateT() { return Allocator->Allocate<T>(); }
|
||||||
|
|
|
@ -44,7 +44,6 @@
|
||||||
#include "llvm/ADT/DenseSet.h"
|
#include "llvm/ADT/DenseSet.h"
|
||||||
#include "llvm/ADT/IntrusiveRefCntPtr.h"
|
#include "llvm/ADT/IntrusiveRefCntPtr.h"
|
||||||
#include "llvm/ADT/PointerIntPair.h"
|
#include "llvm/ADT/PointerIntPair.h"
|
||||||
#include "llvm/Support/AlignOf.h"
|
|
||||||
#include "llvm/Support/Allocator.h"
|
#include "llvm/Support/Allocator.h"
|
||||||
#include "llvm/Support/DataTypes.h"
|
#include "llvm/Support/DataTypes.h"
|
||||||
#include "llvm/Support/MemoryBuffer.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
|
// 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.
|
// 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.");
|
"ContentCache must be 8-byte aligned.");
|
||||||
|
|
||||||
/// \brief Information about a FileID, basically just the logical file
|
/// \brief Information about a FileID, basically just the logical file
|
||||||
|
|
|
@ -727,8 +727,9 @@ namespace clang {
|
||||||
CandidateSetKind Kind;
|
CandidateSetKind Kind;
|
||||||
|
|
||||||
unsigned NumInlineSequences;
|
unsigned NumInlineSequences;
|
||||||
llvm::AlignedCharArray<llvm::AlignOf<ImplicitConversionSequence>::Alignment,
|
llvm::AlignedCharArray<alignof(ImplicitConversionSequence),
|
||||||
16 * sizeof(ImplicitConversionSequence)> InlineSpace;
|
16 * sizeof(ImplicitConversionSequence)>
|
||||||
|
InlineSpace;
|
||||||
|
|
||||||
OverloadCandidateSet(const OverloadCandidateSet &) = delete;
|
OverloadCandidateSet(const OverloadCandidateSet &) = delete;
|
||||||
void operator=(const OverloadCandidateSet &) = delete;
|
void operator=(const OverloadCandidateSet &) = delete;
|
||||||
|
|
|
@ -6887,7 +6887,7 @@ ASTContext::getQualifiedTemplateName(NestedNameSpecifier *NNS,
|
||||||
QualifiedTemplateName *QTN =
|
QualifiedTemplateName *QTN =
|
||||||
QualifiedTemplateNames.FindNodeOrInsertPos(ID, InsertPos);
|
QualifiedTemplateNames.FindNodeOrInsertPos(ID, InsertPos);
|
||||||
if (!QTN) {
|
if (!QTN) {
|
||||||
QTN = new (*this, llvm::alignOf<QualifiedTemplateName>())
|
QTN = new (*this, alignof(QualifiedTemplateName))
|
||||||
QualifiedTemplateName(NNS, TemplateKeyword, Template);
|
QualifiedTemplateName(NNS, TemplateKeyword, Template);
|
||||||
QualifiedTemplateNames.InsertNode(QTN, InsertPos);
|
QualifiedTemplateNames.InsertNode(QTN, InsertPos);
|
||||||
}
|
}
|
||||||
|
@ -6915,11 +6915,11 @@ ASTContext::getDependentTemplateName(NestedNameSpecifier *NNS,
|
||||||
|
|
||||||
NestedNameSpecifier *CanonNNS = getCanonicalNestedNameSpecifier(NNS);
|
NestedNameSpecifier *CanonNNS = getCanonicalNestedNameSpecifier(NNS);
|
||||||
if (CanonNNS == NNS) {
|
if (CanonNNS == NNS) {
|
||||||
QTN = new (*this, llvm::alignOf<DependentTemplateName>())
|
QTN = new (*this, alignof(DependentTemplateName))
|
||||||
DependentTemplateName(NNS, Name);
|
DependentTemplateName(NNS, Name);
|
||||||
} else {
|
} else {
|
||||||
TemplateName Canon = getDependentTemplateName(CanonNNS, Name);
|
TemplateName Canon = getDependentTemplateName(CanonNNS, Name);
|
||||||
QTN = new (*this, llvm::alignOf<DependentTemplateName>())
|
QTN = new (*this, alignof(DependentTemplateName))
|
||||||
DependentTemplateName(NNS, Name, Canon);
|
DependentTemplateName(NNS, Name, Canon);
|
||||||
DependentTemplateName *CheckQTN =
|
DependentTemplateName *CheckQTN =
|
||||||
DependentTemplateNames.FindNodeOrInsertPos(ID, InsertPos);
|
DependentTemplateNames.FindNodeOrInsertPos(ID, InsertPos);
|
||||||
|
@ -6951,13 +6951,13 @@ ASTContext::getDependentTemplateName(NestedNameSpecifier *NNS,
|
||||||
|
|
||||||
NestedNameSpecifier *CanonNNS = getCanonicalNestedNameSpecifier(NNS);
|
NestedNameSpecifier *CanonNNS = getCanonicalNestedNameSpecifier(NNS);
|
||||||
if (CanonNNS == NNS) {
|
if (CanonNNS == NNS) {
|
||||||
QTN = new (*this, llvm::alignOf<DependentTemplateName>())
|
QTN = new (*this, alignof(DependentTemplateName))
|
||||||
DependentTemplateName(NNS, Operator);
|
DependentTemplateName(NNS, Operator);
|
||||||
} else {
|
} else {
|
||||||
TemplateName Canon = getDependentTemplateName(CanonNNS, Operator);
|
TemplateName Canon = getDependentTemplateName(CanonNNS, Operator);
|
||||||
QTN = new (*this, llvm::alignOf<DependentTemplateName>())
|
QTN = new (*this, alignof(DependentTemplateName))
|
||||||
DependentTemplateName(NNS, Operator, Canon);
|
DependentTemplateName(NNS, Operator, Canon);
|
||||||
|
|
||||||
DependentTemplateName *CheckQTN
|
DependentTemplateName *CheckQTN
|
||||||
= DependentTemplateNames.FindNodeOrInsertPos(ID, InsertPos);
|
= DependentTemplateNames.FindNodeOrInsertPos(ID, InsertPos);
|
||||||
assert(!CheckQTN && "Dependent template name canonicalization broken");
|
assert(!CheckQTN && "Dependent template name canonicalization broken");
|
||||||
|
|
|
@ -45,8 +45,7 @@ void Decl::updateOutOfDate(IdentifierInfo &II) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DECL(DERIVED, BASE) \
|
#define DECL(DERIVED, BASE) \
|
||||||
static_assert(llvm::AlignOf<Decl>::Alignment >= \
|
static_assert(alignof(Decl) >= alignof(DERIVED##Decl), \
|
||||||
llvm::AlignOf<DERIVED##Decl>::Alignment, \
|
|
||||||
"Alignment sufficient after objects prepended to " #DERIVED);
|
"Alignment sufficient after objects prepended to " #DERIVED);
|
||||||
#define ABSTRACT_DECL(DECL)
|
#define ABSTRACT_DECL(DECL)
|
||||||
#include "clang/AST/DeclNodes.inc"
|
#include "clang/AST/DeclNodes.inc"
|
||||||
|
@ -55,7 +54,7 @@ void *Decl::operator new(std::size_t Size, const ASTContext &Context,
|
||||||
unsigned ID, std::size_t Extra) {
|
unsigned ID, std::size_t Extra) {
|
||||||
// Allocate an extra 8 bytes worth of storage, which ensures that the
|
// Allocate an extra 8 bytes worth of storage, which ensures that the
|
||||||
// resulting pointer will still be 8-byte aligned.
|
// 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");
|
"Decl won't be misaligned");
|
||||||
void *Start = Context.Allocate(Size + Extra + 8);
|
void *Start = Context.Allocate(Size + Extra + 8);
|
||||||
void *Result = (char*)Start + 8;
|
void *Result = (char*)Start + 8;
|
||||||
|
@ -80,8 +79,7 @@ void *Decl::operator new(std::size_t Size, const ASTContext &Ctx,
|
||||||
// Ensure required alignment of the resulting object by adding extra
|
// Ensure required alignment of the resulting object by adding extra
|
||||||
// padding at the start if required.
|
// padding at the start if required.
|
||||||
size_t ExtraAlign =
|
size_t ExtraAlign =
|
||||||
llvm::OffsetToAlignment(sizeof(Module *),
|
llvm::OffsetToAlignment(sizeof(Module *), alignof(Decl));
|
||||||
llvm::AlignOf<Decl>::Alignment);
|
|
||||||
char *Buffer = reinterpret_cast<char *>(
|
char *Buffer = reinterpret_cast<char *>(
|
||||||
::operator new(ExtraAlign + sizeof(Module *) + Size + Extra, Ctx));
|
::operator new(ExtraAlign + sizeof(Module *) + Size + Extra, Ctx));
|
||||||
Buffer += ExtraAlign;
|
Buffer += ExtraAlign;
|
||||||
|
|
|
@ -1797,7 +1797,7 @@ CXXCtorInitializer *CXXCtorInitializer::Create(ASTContext &Context,
|
||||||
VarDecl **Indices,
|
VarDecl **Indices,
|
||||||
unsigned NumIndices) {
|
unsigned NumIndices) {
|
||||||
void *Mem = Context.Allocate(totalSizeToAlloc<VarDecl *>(NumIndices),
|
void *Mem = Context.Allocate(totalSizeToAlloc<VarDecl *>(NumIndices),
|
||||||
llvm::alignOf<CXXCtorInitializer>());
|
alignof(CXXCtorInitializer));
|
||||||
return new (Mem) CXXCtorInitializer(Context, Member, MemberLoc, L, Init, R,
|
return new (Mem) CXXCtorInitializer(Context, Member, MemberLoc, L, Init, R,
|
||||||
Indices, NumIndices);
|
Indices, NumIndices);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ using namespace clang;
|
||||||
DeclGroup* DeclGroup::Create(ASTContext &C, Decl **Decls, unsigned NumDecls) {
|
DeclGroup* DeclGroup::Create(ASTContext &C, Decl **Decls, unsigned NumDecls) {
|
||||||
assert(NumDecls > 1 && "Invalid DeclGroup");
|
assert(NumDecls > 1 && "Invalid DeclGroup");
|
||||||
unsigned Size = totalSizeToAlloc<Decl *>(NumDecls);
|
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);
|
new (Mem) DeclGroup(NumDecls, Decls);
|
||||||
return static_cast<DeclGroup*>(Mem);
|
return static_cast<DeclGroup*>(Mem);
|
||||||
}
|
}
|
||||||
|
|
|
@ -800,8 +800,7 @@ void ObjCMethodDecl::setParamsAndSelLocs(ASTContext &C,
|
||||||
if (Params.empty() && SelLocs.empty())
|
if (Params.empty() && SelLocs.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
static_assert(llvm::AlignOf<ParmVarDecl *>::Alignment >=
|
static_assert(alignof(ParmVarDecl *) >= alignof(SourceLocation),
|
||||||
llvm::AlignOf<SourceLocation>::Alignment,
|
|
||||||
"Alignment not sufficient for SourceLocation");
|
"Alignment not sufficient for SourceLocation");
|
||||||
|
|
||||||
unsigned Size = sizeof(ParmVarDecl *) * NumParams +
|
unsigned Size = sizeof(ParmVarDecl *) * NumParams +
|
||||||
|
@ -1374,7 +1373,7 @@ ObjCTypeParamList *ObjCTypeParamList::create(
|
||||||
SourceLocation rAngleLoc) {
|
SourceLocation rAngleLoc) {
|
||||||
void *mem =
|
void *mem =
|
||||||
ctx.Allocate(totalSizeToAlloc<ObjCTypeParamDecl *>(typeParams.size()),
|
ctx.Allocate(totalSizeToAlloc<ObjCTypeParamDecl *>(typeParams.size()),
|
||||||
llvm::alignOf<ObjCTypeParamList>());
|
alignof(ObjCTypeParamList));
|
||||||
return new (mem) ObjCTypeParamList(lAngleLoc, typeParams, rAngleLoc);
|
return new (mem) ObjCTypeParamList(lAngleLoc, typeParams, rAngleLoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ TemplateParameterList::Create(const ASTContext &C, SourceLocation TemplateLoc,
|
||||||
SourceLocation RAngleLoc, Expr *RequiresClause) {
|
SourceLocation RAngleLoc, Expr *RequiresClause) {
|
||||||
void *Mem = C.Allocate(totalSizeToAlloc<NamedDecl *, Expr *>(
|
void *Mem = C.Allocate(totalSizeToAlloc<NamedDecl *, Expr *>(
|
||||||
Params.size(), RequiresClause ? 1u : 0u),
|
Params.size(), RequiresClause ? 1u : 0u),
|
||||||
llvm::alignOf<TemplateParameterList>());
|
alignof(TemplateParameterList));
|
||||||
return new (Mem) TemplateParameterList(TemplateLoc, LAngleLoc, Params,
|
return new (Mem) TemplateParameterList(TemplateLoc, LAngleLoc, Params,
|
||||||
RAngleLoc, RequiresClause);
|
RAngleLoc, RequiresClause);
|
||||||
}
|
}
|
||||||
|
|
|
@ -402,7 +402,7 @@ DeclRefExpr *DeclRefExpr::Create(const ASTContext &Context,
|
||||||
HasTemplateKWAndArgsInfo ? 1 : 0,
|
HasTemplateKWAndArgsInfo ? 1 : 0,
|
||||||
TemplateArgs ? TemplateArgs->size() : 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,
|
return new (Mem) DeclRefExpr(Context, QualifierLoc, TemplateKWLoc, D,
|
||||||
RefersToEnclosingVariableOrCapture,
|
RefersToEnclosingVariableOrCapture,
|
||||||
NameInfo, FoundD, TemplateArgs, T, VK);
|
NameInfo, FoundD, TemplateArgs, T, VK);
|
||||||
|
@ -419,7 +419,7 @@ DeclRefExpr *DeclRefExpr::CreateEmpty(const ASTContext &Context,
|
||||||
ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
|
ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
|
||||||
HasQualifier ? 1 : 0, HasFoundDecl ? 1 : 0, HasTemplateKWAndArgsInfo,
|
HasQualifier ? 1 : 0, HasFoundDecl ? 1 : 0, HasTemplateKWAndArgsInfo,
|
||||||
NumTemplateArgs);
|
NumTemplateArgs);
|
||||||
void *Mem = Context.Allocate(Size, llvm::alignOf<DeclRefExpr>());
|
void *Mem = Context.Allocate(Size, alignof(DeclRefExpr));
|
||||||
return new (Mem) DeclRefExpr(EmptyShell());
|
return new (Mem) DeclRefExpr(EmptyShell());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -831,9 +831,9 @@ StringLiteral *StringLiteral::Create(const ASTContext &C, StringRef Str,
|
||||||
|
|
||||||
// Allocate enough space for the StringLiteral plus an array of locations for
|
// Allocate enough space for the StringLiteral plus an array of locations for
|
||||||
// any concatenated string tokens.
|
// any concatenated string tokens.
|
||||||
void *Mem = C.Allocate(sizeof(StringLiteral)+
|
void *Mem =
|
||||||
sizeof(SourceLocation)*(NumStrs-1),
|
C.Allocate(sizeof(StringLiteral) + sizeof(SourceLocation) * (NumStrs - 1),
|
||||||
llvm::alignOf<StringLiteral>());
|
alignof(StringLiteral));
|
||||||
StringLiteral *SL = new (Mem) StringLiteral(Ty);
|
StringLiteral *SL = new (Mem) StringLiteral(Ty);
|
||||||
|
|
||||||
// OPTIMIZE: could allocate this appended to the StringLiteral.
|
// OPTIMIZE: could allocate this appended to the StringLiteral.
|
||||||
|
@ -849,9 +849,9 @@ StringLiteral *StringLiteral::Create(const ASTContext &C, StringRef Str,
|
||||||
|
|
||||||
StringLiteral *StringLiteral::CreateEmpty(const ASTContext &C,
|
StringLiteral *StringLiteral::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumStrs) {
|
unsigned NumStrs) {
|
||||||
void *Mem = C.Allocate(sizeof(StringLiteral)+
|
void *Mem =
|
||||||
sizeof(SourceLocation)*(NumStrs-1),
|
C.Allocate(sizeof(StringLiteral) + sizeof(SourceLocation) * (NumStrs - 1),
|
||||||
llvm::alignOf<StringLiteral>());
|
alignof(StringLiteral));
|
||||||
StringLiteral *SL = new (Mem) StringLiteral(QualType());
|
StringLiteral *SL = new (Mem) StringLiteral(QualType());
|
||||||
SL->CharByteWidth = 0;
|
SL->CharByteWidth = 0;
|
||||||
SL->Length = 0;
|
SL->Length = 0;
|
||||||
|
@ -1416,7 +1416,7 @@ MemberExpr *MemberExpr::Create(
|
||||||
HasTemplateKWAndArgsInfo ? 1 : 0,
|
HasTemplateKWAndArgsInfo ? 1 : 0,
|
||||||
targs ? targs->size() : 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 *E = new (Mem)
|
||||||
MemberExpr(base, isarrow, OperatorLoc, memberdecl, nameinfo, ty, vk, ok);
|
MemberExpr(base, isarrow, OperatorLoc, memberdecl, nameinfo, ty, vk, ok);
|
||||||
|
|
||||||
|
@ -3604,7 +3604,7 @@ DesignatedInitExpr::Create(const ASTContext &C,
|
||||||
SourceLocation ColonOrEqualLoc,
|
SourceLocation ColonOrEqualLoc,
|
||||||
bool UsesColonSyntax, Expr *Init) {
|
bool UsesColonSyntax, Expr *Init) {
|
||||||
void *Mem = C.Allocate(totalSizeToAlloc<Stmt *>(IndexExprs.size() + 1),
|
void *Mem = C.Allocate(totalSizeToAlloc<Stmt *>(IndexExprs.size() + 1),
|
||||||
llvm::alignOf<DesignatedInitExpr>());
|
alignof(DesignatedInitExpr));
|
||||||
return new (Mem) DesignatedInitExpr(C, C.VoidTy, Designators,
|
return new (Mem) DesignatedInitExpr(C, C.VoidTy, Designators,
|
||||||
ColonOrEqualLoc, UsesColonSyntax,
|
ColonOrEqualLoc, UsesColonSyntax,
|
||||||
IndexExprs, Init);
|
IndexExprs, Init);
|
||||||
|
@ -3613,7 +3613,7 @@ DesignatedInitExpr::Create(const ASTContext &C,
|
||||||
DesignatedInitExpr *DesignatedInitExpr::CreateEmpty(const ASTContext &C,
|
DesignatedInitExpr *DesignatedInitExpr::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumIndexExprs) {
|
unsigned NumIndexExprs) {
|
||||||
void *Mem = C.Allocate(totalSizeToAlloc<Stmt *>(NumIndexExprs + 1),
|
void *Mem = C.Allocate(totalSizeToAlloc<Stmt *>(NumIndexExprs + 1),
|
||||||
llvm::alignOf<DesignatedInitExpr>());
|
alignof(DesignatedInitExpr));
|
||||||
return new (Mem) DesignatedInitExpr(NumIndexExprs + 1);
|
return new (Mem) DesignatedInitExpr(NumIndexExprs + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3753,7 +3753,7 @@ PseudoObjectExpr *PseudoObjectExpr::Create(const ASTContext &Context,
|
||||||
unsigned numSemanticExprs) {
|
unsigned numSemanticExprs) {
|
||||||
void *buffer =
|
void *buffer =
|
||||||
Context.Allocate(totalSizeToAlloc<Expr *>(1 + numSemanticExprs),
|
Context.Allocate(totalSizeToAlloc<Expr *>(1 + numSemanticExprs),
|
||||||
llvm::alignOf<PseudoObjectExpr>());
|
alignof(PseudoObjectExpr));
|
||||||
return new(buffer) PseudoObjectExpr(sh, numSemanticExprs);
|
return new(buffer) PseudoObjectExpr(sh, numSemanticExprs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3781,7 +3781,7 @@ PseudoObjectExpr *PseudoObjectExpr::Create(const ASTContext &C, Expr *syntax,
|
||||||
}
|
}
|
||||||
|
|
||||||
void *buffer = C.Allocate(totalSizeToAlloc<Expr *>(semantics.size() + 1),
|
void *buffer = C.Allocate(totalSizeToAlloc<Expr *>(semantics.size() + 1),
|
||||||
llvm::alignOf<PseudoObjectExpr>());
|
alignof(PseudoObjectExpr));
|
||||||
return new(buffer) PseudoObjectExpr(type, VK, syntax, semantics,
|
return new(buffer) PseudoObjectExpr(type, VK, syntax, semantics,
|
||||||
resultIndex);
|
resultIndex);
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,7 +243,7 @@ UnresolvedLookupExpr::Create(const ASTContext &C,
|
||||||
std::size_t Size =
|
std::size_t Size =
|
||||||
totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(1,
|
totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(1,
|
||||||
num_args);
|
num_args);
|
||||||
void *Mem = C.Allocate(Size, llvm::alignOf<UnresolvedLookupExpr>());
|
void *Mem = C.Allocate(Size, alignof(UnresolvedLookupExpr));
|
||||||
return new (Mem) UnresolvedLookupExpr(C, NamingClass, QualifierLoc,
|
return new (Mem) UnresolvedLookupExpr(C, NamingClass, QualifierLoc,
|
||||||
TemplateKWLoc, NameInfo,
|
TemplateKWLoc, NameInfo,
|
||||||
ADL, /*Overload*/ true, Args,
|
ADL, /*Overload*/ true, Args,
|
||||||
|
@ -258,7 +258,7 @@ UnresolvedLookupExpr::CreateEmpty(const ASTContext &C,
|
||||||
std::size_t Size =
|
std::size_t Size =
|
||||||
totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
|
totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
|
||||||
HasTemplateKWAndArgsInfo, NumTemplateArgs);
|
HasTemplateKWAndArgsInfo, NumTemplateArgs);
|
||||||
void *Mem = C.Allocate(Size, llvm::alignOf<UnresolvedLookupExpr>());
|
void *Mem = C.Allocate(Size, alignof(UnresolvedLookupExpr));
|
||||||
UnresolvedLookupExpr *E = new (Mem) UnresolvedLookupExpr(EmptyShell());
|
UnresolvedLookupExpr *E = new (Mem) UnresolvedLookupExpr(EmptyShell());
|
||||||
E->HasTemplateKWAndArgsInfo = HasTemplateKWAndArgsInfo;
|
E->HasTemplateKWAndArgsInfo = HasTemplateKWAndArgsInfo;
|
||||||
return E;
|
return E;
|
||||||
|
@ -301,9 +301,8 @@ OverloadExpr::OverloadExpr(StmtClass K, const ASTContext &C,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Results = static_cast<DeclAccessPair *>(
|
Results = static_cast<DeclAccessPair *>(C.Allocate(
|
||||||
C.Allocate(sizeof(DeclAccessPair) * NumResults,
|
sizeof(DeclAccessPair) * NumResults, alignof(DeclAccessPair)));
|
||||||
llvm::alignOf<DeclAccessPair>()));
|
|
||||||
memcpy(Results, Begin.I, NumResults * sizeof(DeclAccessPair));
|
memcpy(Results, Begin.I, NumResults * sizeof(DeclAccessPair));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,11 +339,11 @@ void OverloadExpr::initializeResults(const ASTContext &C,
|
||||||
assert(!Results && "Results already initialized!");
|
assert(!Results && "Results already initialized!");
|
||||||
NumResults = End - Begin;
|
NumResults = End - Begin;
|
||||||
if (NumResults) {
|
if (NumResults) {
|
||||||
Results = static_cast<DeclAccessPair *>(
|
Results = static_cast<DeclAccessPair *>(
|
||||||
C.Allocate(sizeof(DeclAccessPair) * NumResults,
|
C.Allocate(sizeof(DeclAccessPair) * NumResults,
|
||||||
|
|
||||||
llvm::alignOf<DeclAccessPair>()));
|
alignof(DeclAccessPair)));
|
||||||
memcpy(Results, Begin.I, NumResults * sizeof(DeclAccessPair));
|
memcpy(Results, Begin.I, NumResults * sizeof(DeclAccessPair));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1058,7 +1057,7 @@ ExprWithCleanups *ExprWithCleanups::Create(const ASTContext &C, Expr *subexpr,
|
||||||
bool CleanupsHaveSideEffects,
|
bool CleanupsHaveSideEffects,
|
||||||
ArrayRef<CleanupObject> objects) {
|
ArrayRef<CleanupObject> objects) {
|
||||||
void *buffer = C.Allocate(totalSizeToAlloc<CleanupObject>(objects.size()),
|
void *buffer = C.Allocate(totalSizeToAlloc<CleanupObject>(objects.size()),
|
||||||
llvm::alignOf<ExprWithCleanups>());
|
alignof(ExprWithCleanups));
|
||||||
return new (buffer)
|
return new (buffer)
|
||||||
ExprWithCleanups(subexpr, CleanupsHaveSideEffects, objects);
|
ExprWithCleanups(subexpr, CleanupsHaveSideEffects, objects);
|
||||||
}
|
}
|
||||||
|
@ -1072,7 +1071,7 @@ ExprWithCleanups *ExprWithCleanups::Create(const ASTContext &C,
|
||||||
EmptyShell empty,
|
EmptyShell empty,
|
||||||
unsigned numObjects) {
|
unsigned numObjects) {
|
||||||
void *buffer = C.Allocate(totalSizeToAlloc<CleanupObject>(numObjects),
|
void *buffer = C.Allocate(totalSizeToAlloc<CleanupObject>(numObjects),
|
||||||
llvm::alignOf<ExprWithCleanups>());
|
alignof(ExprWithCleanups));
|
||||||
return new (buffer) ExprWithCleanups(empty, numObjects);
|
return new (buffer) ExprWithCleanups(empty, numObjects);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1171,7 +1170,7 @@ CXXDependentScopeMemberExpr::Create(const ASTContext &C,
|
||||||
totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
|
totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
|
||||||
HasTemplateKWAndArgsInfo, NumTemplateArgs);
|
HasTemplateKWAndArgsInfo, NumTemplateArgs);
|
||||||
|
|
||||||
void *Mem = C.Allocate(Size, llvm::alignOf<CXXDependentScopeMemberExpr>());
|
void *Mem = C.Allocate(Size, alignof(CXXDependentScopeMemberExpr));
|
||||||
return new (Mem) CXXDependentScopeMemberExpr(C, Base, BaseType,
|
return new (Mem) CXXDependentScopeMemberExpr(C, Base, BaseType,
|
||||||
IsArrow, OperatorLoc,
|
IsArrow, OperatorLoc,
|
||||||
QualifierLoc,
|
QualifierLoc,
|
||||||
|
@ -1188,7 +1187,7 @@ CXXDependentScopeMemberExpr::CreateEmpty(const ASTContext &C,
|
||||||
std::size_t Size =
|
std::size_t Size =
|
||||||
totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
|
totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
|
||||||
HasTemplateKWAndArgsInfo, NumTemplateArgs);
|
HasTemplateKWAndArgsInfo, NumTemplateArgs);
|
||||||
void *Mem = C.Allocate(Size, llvm::alignOf<CXXDependentScopeMemberExpr>());
|
void *Mem = C.Allocate(Size, alignof(CXXDependentScopeMemberExpr));
|
||||||
CXXDependentScopeMemberExpr *E
|
CXXDependentScopeMemberExpr *E
|
||||||
= new (Mem) CXXDependentScopeMemberExpr(C, nullptr, QualType(),
|
= new (Mem) CXXDependentScopeMemberExpr(C, nullptr, QualType(),
|
||||||
0, SourceLocation(),
|
0, SourceLocation(),
|
||||||
|
@ -1272,7 +1271,7 @@ UnresolvedMemberExpr *UnresolvedMemberExpr::Create(
|
||||||
totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
|
totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
|
||||||
HasTemplateKWAndArgsInfo, TemplateArgs ? TemplateArgs->size() : 0);
|
HasTemplateKWAndArgsInfo, TemplateArgs ? TemplateArgs->size() : 0);
|
||||||
|
|
||||||
void *Mem = C.Allocate(Size, llvm::alignOf<UnresolvedMemberExpr>());
|
void *Mem = C.Allocate(Size, alignof(UnresolvedMemberExpr));
|
||||||
return new (Mem) UnresolvedMemberExpr(
|
return new (Mem) UnresolvedMemberExpr(
|
||||||
C, HasUnresolvedUsing, Base, BaseType, IsArrow, OperatorLoc, QualifierLoc,
|
C, HasUnresolvedUsing, Base, BaseType, IsArrow, OperatorLoc, QualifierLoc,
|
||||||
TemplateKWLoc, MemberNameInfo, TemplateArgs, Begin, End);
|
TemplateKWLoc, MemberNameInfo, TemplateArgs, Begin, End);
|
||||||
|
@ -1287,7 +1286,7 @@ UnresolvedMemberExpr::CreateEmpty(const ASTContext &C,
|
||||||
totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
|
totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(
|
||||||
HasTemplateKWAndArgsInfo, NumTemplateArgs);
|
HasTemplateKWAndArgsInfo, NumTemplateArgs);
|
||||||
|
|
||||||
void *Mem = C.Allocate(Size, llvm::alignOf<UnresolvedMemberExpr>());
|
void *Mem = C.Allocate(Size, alignof(UnresolvedMemberExpr));
|
||||||
UnresolvedMemberExpr *E = new (Mem) UnresolvedMemberExpr(EmptyShell());
|
UnresolvedMemberExpr *E = new (Mem) UnresolvedMemberExpr(EmptyShell());
|
||||||
E->HasTemplateKWAndArgsInfo = HasTemplateKWAndArgsInfo;
|
E->HasTemplateKWAndArgsInfo = HasTemplateKWAndArgsInfo;
|
||||||
return E;
|
return E;
|
||||||
|
|
|
@ -278,7 +278,7 @@ ObjCMessageExpr *ObjCMessageExpr::alloc(const ASTContext &C, unsigned NumArgs,
|
||||||
unsigned NumStoredSelLocs) {
|
unsigned NumStoredSelLocs) {
|
||||||
return (ObjCMessageExpr *)C.Allocate(
|
return (ObjCMessageExpr *)C.Allocate(
|
||||||
totalSizeToAlloc<void *, SourceLocation>(NumArgs + 1, NumStoredSelLocs),
|
totalSizeToAlloc<void *, SourceLocation>(NumArgs + 1, NumStoredSelLocs),
|
||||||
llvm::AlignOf<ObjCMessageExpr>::Alignment);
|
alignof(ObjCMessageExpr));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjCMessageExpr::getSelectorLocs(
|
void ObjCMessageExpr::getSelectorLocs(
|
||||||
|
|
|
@ -34,8 +34,8 @@ NestedNameSpecifier::FindOrInsert(const ASTContext &Context,
|
||||||
NestedNameSpecifier *NNS
|
NestedNameSpecifier *NNS
|
||||||
= Context.NestedNameSpecifiers.FindNodeOrInsertPos(ID, InsertPos);
|
= Context.NestedNameSpecifiers.FindNodeOrInsertPos(ID, InsertPos);
|
||||||
if (!NNS) {
|
if (!NNS) {
|
||||||
NNS = new (Context, llvm::alignOf<NestedNameSpecifier>())
|
NNS =
|
||||||
NestedNameSpecifier(Mockup);
|
new (Context, alignof(NestedNameSpecifier)) NestedNameSpecifier(Mockup);
|
||||||
Context.NestedNameSpecifiers.InsertNode(NNS, InsertPos);
|
Context.NestedNameSpecifiers.InsertNode(NNS, InsertPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,8 +113,7 @@ NestedNameSpecifier *
|
||||||
NestedNameSpecifier::GlobalSpecifier(const ASTContext &Context) {
|
NestedNameSpecifier::GlobalSpecifier(const ASTContext &Context) {
|
||||||
if (!Context.GlobalNestedNameSpecifier)
|
if (!Context.GlobalNestedNameSpecifier)
|
||||||
Context.GlobalNestedNameSpecifier =
|
Context.GlobalNestedNameSpecifier =
|
||||||
new (Context, llvm::alignOf<NestedNameSpecifier>())
|
new (Context, alignof(NestedNameSpecifier)) NestedNameSpecifier();
|
||||||
NestedNameSpecifier();
|
|
||||||
return Context.GlobalNestedNameSpecifier;
|
return Context.GlobalNestedNameSpecifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -687,7 +686,7 @@ NestedNameSpecifierLocBuilder::getWithLocInContext(ASTContext &Context) const {
|
||||||
// FIXME: After copying the source-location information, should we free
|
// FIXME: After copying the source-location information, should we free
|
||||||
// our (temporary) buffer and adopt the ASTContext-allocated memory?
|
// our (temporary) buffer and adopt the ASTContext-allocated memory?
|
||||||
// Doing so would optimize repeated calls to getWithLocInContext().
|
// 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);
|
memcpy(Mem, Buffer, BufferSize);
|
||||||
return NestedNameSpecifierLoc(Representation, Mem);
|
return NestedNameSpecifierLoc(Representation, Mem);
|
||||||
}
|
}
|
||||||
|
|
|
@ -315,7 +315,7 @@ AttributedStmt *AttributedStmt::Create(const ASTContext &C, SourceLocation Loc,
|
||||||
Stmt *SubStmt) {
|
Stmt *SubStmt) {
|
||||||
assert(!Attrs.empty() && "Attrs should not be empty");
|
assert(!Attrs.empty() && "Attrs should not be empty");
|
||||||
void *Mem = C.Allocate(sizeof(AttributedStmt) + sizeof(Attr *) * Attrs.size(),
|
void *Mem = C.Allocate(sizeof(AttributedStmt) + sizeof(Attr *) * Attrs.size(),
|
||||||
llvm::alignOf<AttributedStmt>());
|
alignof(AttributedStmt));
|
||||||
return new (Mem) AttributedStmt(Loc, Attrs, SubStmt);
|
return new (Mem) AttributedStmt(Loc, Attrs, SubStmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,7 +323,7 @@ AttributedStmt *AttributedStmt::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumAttrs) {
|
unsigned NumAttrs) {
|
||||||
assert(NumAttrs > 0 && "NumAttrs should be greater than zero");
|
assert(NumAttrs > 0 && "NumAttrs should be greater than zero");
|
||||||
void *Mem = C.Allocate(sizeof(AttributedStmt) + sizeof(Attr *) * NumAttrs,
|
void *Mem = C.Allocate(sizeof(AttributedStmt) + sizeof(Attr *) * NumAttrs,
|
||||||
llvm::alignOf<AttributedStmt>());
|
alignof(AttributedStmt));
|
||||||
return new (Mem) AttributedStmt(EmptyShell(), NumAttrs);
|
return new (Mem) AttributedStmt(EmptyShell(), NumAttrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1002,7 +1002,7 @@ CapturedStmt::Capture *CapturedStmt::getStoredCaptures() const {
|
||||||
unsigned Size = sizeof(CapturedStmt) + sizeof(Stmt *) * (NumCaptures + 1);
|
unsigned Size = sizeof(CapturedStmt) + sizeof(Stmt *) * (NumCaptures + 1);
|
||||||
|
|
||||||
// Offset of the first Capture object.
|
// 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 *>(
|
return reinterpret_cast<Capture *>(
|
||||||
reinterpret_cast<char *>(const_cast<CapturedStmt *>(this))
|
reinterpret_cast<char *>(const_cast<CapturedStmt *>(this))
|
||||||
|
@ -1059,7 +1059,7 @@ CapturedStmt *CapturedStmt::Create(const ASTContext &Context, Stmt *S,
|
||||||
unsigned Size = sizeof(CapturedStmt) + sizeof(Stmt *) * (Captures.size() + 1);
|
unsigned Size = sizeof(CapturedStmt) + sizeof(Stmt *) * (Captures.size() + 1);
|
||||||
if (!Captures.empty()) {
|
if (!Captures.empty()) {
|
||||||
// Realign for the following Capture array.
|
// Realign for the following Capture array.
|
||||||
Size = llvm::alignTo(Size, llvm::alignOf<Capture>());
|
Size = llvm::alignTo(Size, alignof(Capture));
|
||||||
Size += sizeof(Capture) * Captures.size();
|
Size += sizeof(Capture) * Captures.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1072,7 +1072,7 @@ CapturedStmt *CapturedStmt::CreateDeserialized(const ASTContext &Context,
|
||||||
unsigned Size = sizeof(CapturedStmt) + sizeof(Stmt *) * (NumCaptures + 1);
|
unsigned Size = sizeof(CapturedStmt) + sizeof(Stmt *) * (NumCaptures + 1);
|
||||||
if (NumCaptures > 0) {
|
if (NumCaptures > 0) {
|
||||||
// Realign for the following Capture array.
|
// Realign for the following Capture array.
|
||||||
Size = llvm::alignTo(Size, llvm::alignOf<Capture>());
|
Size = llvm::alignTo(Size, alignof(Capture));
|
||||||
Size += sizeof(Capture) * NumCaptures;
|
Size += sizeof(Capture) * NumCaptures;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ CXXTryStmt *CXXTryStmt::Create(const ASTContext &C, SourceLocation tryLoc,
|
||||||
std::size_t Size = sizeof(CXXTryStmt);
|
std::size_t Size = sizeof(CXXTryStmt);
|
||||||
Size += ((handlers.size() + 1) * sizeof(Stmt *));
|
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);
|
return new (Mem) CXXTryStmt(tryLoc, tryBlock, handlers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ CXXTryStmt *CXXTryStmt::Create(const ASTContext &C, EmptyShell Empty,
|
||||||
std::size_t Size = sizeof(CXXTryStmt);
|
std::size_t Size = sizeof(CXXTryStmt);
|
||||||
Size += ((numHandlers + 1) * sizeof(Stmt *));
|
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);
|
return new (Mem) CXXTryStmt(Empty, numHandlers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ ObjCAtTryStmt *ObjCAtTryStmt::Create(const ASTContext &Context,
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
sizeof(ObjCAtTryStmt) +
|
sizeof(ObjCAtTryStmt) +
|
||||||
(1 + NumCatchStmts + (atFinallyStmt != nullptr)) * sizeof(Stmt *);
|
(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,
|
return new (Mem) ObjCAtTryStmt(atTryLoc, atTryStmt, CatchStmts, NumCatchStmts,
|
||||||
atFinallyStmt);
|
atFinallyStmt);
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ ObjCAtTryStmt *ObjCAtTryStmt::CreateEmpty(const ASTContext &Context,
|
||||||
bool HasFinally) {
|
bool HasFinally) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
sizeof(ObjCAtTryStmt) + (1 + NumCatchStmts + HasFinally) * sizeof(Stmt *);
|
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);
|
return new (Mem) ObjCAtTryStmt(EmptyShell(), NumCatchStmts, HasFinally);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ OMPParallelDirective *OMPParallelDirective::Create(
|
||||||
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
||||||
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPParallelDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPParallelDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
||||||
OMPParallelDirective *Dir =
|
OMPParallelDirective *Dir =
|
||||||
|
@ -73,7 +73,7 @@ OMPParallelDirective *OMPParallelDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumClauses,
|
unsigned NumClauses,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPParallelDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPParallelDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
||||||
return new (Mem) OMPParallelDirective(NumClauses);
|
return new (Mem) OMPParallelDirective(NumClauses);
|
||||||
|
@ -84,8 +84,7 @@ OMPSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
||||||
SourceLocation EndLoc, unsigned CollapsedNum,
|
SourceLocation EndLoc, unsigned CollapsedNum,
|
||||||
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
||||||
const HelperExprs &Exprs) {
|
const HelperExprs &Exprs) {
|
||||||
unsigned Size =
|
unsigned Size = llvm::alignTo(sizeof(OMPSimdDirective), alignof(OMPClause *));
|
||||||
llvm::alignTo(sizeof(OMPSimdDirective), llvm::alignOf<OMPClause *>());
|
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
||||||
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd));
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd));
|
||||||
|
@ -113,8 +112,7 @@ OMPSimdDirective *OMPSimdDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumClauses,
|
unsigned NumClauses,
|
||||||
unsigned CollapsedNum,
|
unsigned CollapsedNum,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size =
|
unsigned Size = llvm::alignTo(sizeof(OMPSimdDirective), alignof(OMPClause *));
|
||||||
llvm::alignTo(sizeof(OMPSimdDirective), llvm::alignOf<OMPClause *>());
|
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
||||||
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd));
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd));
|
||||||
|
@ -126,8 +124,7 @@ OMPForDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
||||||
SourceLocation EndLoc, unsigned CollapsedNum,
|
SourceLocation EndLoc, unsigned CollapsedNum,
|
||||||
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
||||||
const HelperExprs &Exprs, bool HasCancel) {
|
const HelperExprs &Exprs, bool HasCancel) {
|
||||||
unsigned Size =
|
unsigned Size = llvm::alignTo(sizeof(OMPForDirective), alignof(OMPClause *));
|
||||||
llvm::alignTo(sizeof(OMPForDirective), llvm::alignOf<OMPClause *>());
|
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
||||||
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for));
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for));
|
||||||
|
@ -166,8 +163,7 @@ OMPForDirective *OMPForDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumClauses,
|
unsigned NumClauses,
|
||||||
unsigned CollapsedNum,
|
unsigned CollapsedNum,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size =
|
unsigned Size = llvm::alignTo(sizeof(OMPForDirective), alignof(OMPClause *));
|
||||||
llvm::alignTo(sizeof(OMPForDirective), llvm::alignOf<OMPClause *>());
|
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
||||||
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for));
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for));
|
||||||
|
@ -180,7 +176,7 @@ OMPForSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
||||||
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
||||||
const HelperExprs &Exprs) {
|
const HelperExprs &Exprs) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPForSimdDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPForSimdDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
||||||
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd));
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd));
|
||||||
|
@ -219,7 +215,7 @@ OMPForSimdDirective *OMPForSimdDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned CollapsedNum,
|
unsigned CollapsedNum,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPForSimdDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPForSimdDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
||||||
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd));
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd));
|
||||||
|
@ -230,7 +226,7 @@ OMPSectionsDirective *OMPSectionsDirective::Create(
|
||||||
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
||||||
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPSectionsDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPSectionsDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
||||||
OMPSectionsDirective *Dir =
|
OMPSectionsDirective *Dir =
|
||||||
|
@ -245,7 +241,7 @@ OMPSectionsDirective *OMPSectionsDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumClauses,
|
unsigned NumClauses,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPSectionsDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPSectionsDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
||||||
return new (Mem) OMPSectionsDirective(NumClauses);
|
return new (Mem) OMPSectionsDirective(NumClauses);
|
||||||
|
@ -256,8 +252,7 @@ OMPSectionDirective *OMPSectionDirective::Create(const ASTContext &C,
|
||||||
SourceLocation EndLoc,
|
SourceLocation EndLoc,
|
||||||
Stmt *AssociatedStmt,
|
Stmt *AssociatedStmt,
|
||||||
bool HasCancel) {
|
bool HasCancel) {
|
||||||
unsigned Size =
|
unsigned Size = llvm::alignTo(sizeof(OMPSectionDirective), alignof(Stmt *));
|
||||||
llvm::alignTo(sizeof(OMPSectionDirective), llvm::alignOf<Stmt *>());
|
|
||||||
void *Mem = C.Allocate(Size + sizeof(Stmt *));
|
void *Mem = C.Allocate(Size + sizeof(Stmt *));
|
||||||
OMPSectionDirective *Dir = new (Mem) OMPSectionDirective(StartLoc, EndLoc);
|
OMPSectionDirective *Dir = new (Mem) OMPSectionDirective(StartLoc, EndLoc);
|
||||||
Dir->setAssociatedStmt(AssociatedStmt);
|
Dir->setAssociatedStmt(AssociatedStmt);
|
||||||
|
@ -267,8 +262,7 @@ OMPSectionDirective *OMPSectionDirective::Create(const ASTContext &C,
|
||||||
|
|
||||||
OMPSectionDirective *OMPSectionDirective::CreateEmpty(const ASTContext &C,
|
OMPSectionDirective *OMPSectionDirective::CreateEmpty(const ASTContext &C,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size =
|
unsigned Size = llvm::alignTo(sizeof(OMPSectionDirective), alignof(Stmt *));
|
||||||
llvm::alignTo(sizeof(OMPSectionDirective), llvm::alignOf<Stmt *>());
|
|
||||||
void *Mem = C.Allocate(Size + sizeof(Stmt *));
|
void *Mem = C.Allocate(Size + sizeof(Stmt *));
|
||||||
return new (Mem) OMPSectionDirective();
|
return new (Mem) OMPSectionDirective();
|
||||||
}
|
}
|
||||||
|
@ -279,7 +273,7 @@ OMPSingleDirective *OMPSingleDirective::Create(const ASTContext &C,
|
||||||
ArrayRef<OMPClause *> Clauses,
|
ArrayRef<OMPClause *> Clauses,
|
||||||
Stmt *AssociatedStmt) {
|
Stmt *AssociatedStmt) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPSingleDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPSingleDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
||||||
OMPSingleDirective *Dir =
|
OMPSingleDirective *Dir =
|
||||||
|
@ -293,7 +287,7 @@ OMPSingleDirective *OMPSingleDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumClauses,
|
unsigned NumClauses,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPSingleDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPSingleDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
||||||
return new (Mem) OMPSingleDirective(NumClauses);
|
return new (Mem) OMPSingleDirective(NumClauses);
|
||||||
|
@ -303,8 +297,7 @@ OMPMasterDirective *OMPMasterDirective::Create(const ASTContext &C,
|
||||||
SourceLocation StartLoc,
|
SourceLocation StartLoc,
|
||||||
SourceLocation EndLoc,
|
SourceLocation EndLoc,
|
||||||
Stmt *AssociatedStmt) {
|
Stmt *AssociatedStmt) {
|
||||||
unsigned Size =
|
unsigned Size = llvm::alignTo(sizeof(OMPMasterDirective), alignof(Stmt *));
|
||||||
llvm::alignTo(sizeof(OMPMasterDirective), llvm::alignOf<Stmt *>());
|
|
||||||
void *Mem = C.Allocate(Size + sizeof(Stmt *));
|
void *Mem = C.Allocate(Size + sizeof(Stmt *));
|
||||||
OMPMasterDirective *Dir = new (Mem) OMPMasterDirective(StartLoc, EndLoc);
|
OMPMasterDirective *Dir = new (Mem) OMPMasterDirective(StartLoc, EndLoc);
|
||||||
Dir->setAssociatedStmt(AssociatedStmt);
|
Dir->setAssociatedStmt(AssociatedStmt);
|
||||||
|
@ -313,8 +306,7 @@ OMPMasterDirective *OMPMasterDirective::Create(const ASTContext &C,
|
||||||
|
|
||||||
OMPMasterDirective *OMPMasterDirective::CreateEmpty(const ASTContext &C,
|
OMPMasterDirective *OMPMasterDirective::CreateEmpty(const ASTContext &C,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size =
|
unsigned Size = llvm::alignTo(sizeof(OMPMasterDirective), alignof(Stmt *));
|
||||||
llvm::alignTo(sizeof(OMPMasterDirective), llvm::alignOf<Stmt *>());
|
|
||||||
void *Mem = C.Allocate(Size + sizeof(Stmt *));
|
void *Mem = C.Allocate(Size + sizeof(Stmt *));
|
||||||
return new (Mem) OMPMasterDirective();
|
return new (Mem) OMPMasterDirective();
|
||||||
}
|
}
|
||||||
|
@ -324,7 +316,7 @@ OMPCriticalDirective *OMPCriticalDirective::Create(
|
||||||
SourceLocation StartLoc, SourceLocation EndLoc,
|
SourceLocation StartLoc, SourceLocation EndLoc,
|
||||||
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPCriticalDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPCriticalDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
||||||
OMPCriticalDirective *Dir =
|
OMPCriticalDirective *Dir =
|
||||||
|
@ -338,7 +330,7 @@ OMPCriticalDirective *OMPCriticalDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumClauses,
|
unsigned NumClauses,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPCriticalDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPCriticalDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
||||||
return new (Mem) OMPCriticalDirective(NumClauses);
|
return new (Mem) OMPCriticalDirective(NumClauses);
|
||||||
|
@ -348,8 +340,8 @@ OMPParallelForDirective *OMPParallelForDirective::Create(
|
||||||
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
||||||
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
||||||
const HelperExprs &Exprs, bool HasCancel) {
|
const HelperExprs &Exprs, bool HasCancel) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPParallelForDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPParallelForDirective), alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
||||||
sizeof(Stmt *) *
|
sizeof(Stmt *) *
|
||||||
numLoopChildren(CollapsedNum, OMPD_parallel_for));
|
numLoopChildren(CollapsedNum, OMPD_parallel_for));
|
||||||
|
@ -387,8 +379,8 @@ OMPParallelForDirective *OMPParallelForDirective::Create(
|
||||||
OMPParallelForDirective *
|
OMPParallelForDirective *
|
||||||
OMPParallelForDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
|
OMPParallelForDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
|
||||||
unsigned CollapsedNum, EmptyShell) {
|
unsigned CollapsedNum, EmptyShell) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPParallelForDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPParallelForDirective), alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
||||||
sizeof(Stmt *) *
|
sizeof(Stmt *) *
|
||||||
numLoopChildren(CollapsedNum, OMPD_parallel_for));
|
numLoopChildren(CollapsedNum, OMPD_parallel_for));
|
||||||
|
@ -399,8 +391,8 @@ OMPParallelForSimdDirective *OMPParallelForSimdDirective::Create(
|
||||||
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
||||||
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
||||||
const HelperExprs &Exprs) {
|
const HelperExprs &Exprs) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPParallelForSimdDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPParallelForSimdDirective), alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(
|
void *Mem = C.Allocate(
|
||||||
Size + sizeof(OMPClause *) * Clauses.size() +
|
Size + sizeof(OMPClause *) * Clauses.size() +
|
||||||
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd));
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd));
|
||||||
|
@ -438,8 +430,8 @@ OMPParallelForSimdDirective *
|
||||||
OMPParallelForSimdDirective::CreateEmpty(const ASTContext &C,
|
OMPParallelForSimdDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumClauses,
|
unsigned NumClauses,
|
||||||
unsigned CollapsedNum, EmptyShell) {
|
unsigned CollapsedNum, EmptyShell) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPParallelForSimdDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPParallelForSimdDirective), alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(
|
void *Mem = C.Allocate(
|
||||||
Size + sizeof(OMPClause *) * NumClauses +
|
Size + sizeof(OMPClause *) * NumClauses +
|
||||||
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd));
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd));
|
||||||
|
@ -449,8 +441,8 @@ OMPParallelForSimdDirective::CreateEmpty(const ASTContext &C,
|
||||||
OMPParallelSectionsDirective *OMPParallelSectionsDirective::Create(
|
OMPParallelSectionsDirective *OMPParallelSectionsDirective::Create(
|
||||||
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
||||||
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPParallelSectionsDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPParallelSectionsDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
||||||
OMPParallelSectionsDirective *Dir =
|
OMPParallelSectionsDirective *Dir =
|
||||||
|
@ -464,8 +456,8 @@ OMPParallelSectionsDirective *OMPParallelSectionsDirective::Create(
|
||||||
OMPParallelSectionsDirective *
|
OMPParallelSectionsDirective *
|
||||||
OMPParallelSectionsDirective::CreateEmpty(const ASTContext &C,
|
OMPParallelSectionsDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumClauses, EmptyShell) {
|
unsigned NumClauses, EmptyShell) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPParallelSectionsDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPParallelSectionsDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
||||||
return new (Mem) OMPParallelSectionsDirective(NumClauses);
|
return new (Mem) OMPParallelSectionsDirective(NumClauses);
|
||||||
|
@ -475,8 +467,7 @@ OMPTaskDirective *
|
||||||
OMPTaskDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
OMPTaskDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
||||||
SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
|
SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
|
||||||
Stmt *AssociatedStmt, bool HasCancel) {
|
Stmt *AssociatedStmt, bool HasCancel) {
|
||||||
unsigned Size =
|
unsigned Size = llvm::alignTo(sizeof(OMPTaskDirective), alignof(OMPClause *));
|
||||||
llvm::alignTo(sizeof(OMPTaskDirective), llvm::alignOf<OMPClause *>());
|
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
||||||
OMPTaskDirective *Dir =
|
OMPTaskDirective *Dir =
|
||||||
|
@ -490,8 +481,7 @@ OMPTaskDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
||||||
OMPTaskDirective *OMPTaskDirective::CreateEmpty(const ASTContext &C,
|
OMPTaskDirective *OMPTaskDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumClauses,
|
unsigned NumClauses,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size =
|
unsigned Size = llvm::alignTo(sizeof(OMPTaskDirective), alignof(OMPClause *));
|
||||||
llvm::alignTo(sizeof(OMPTaskDirective), llvm::alignOf<OMPClause *>());
|
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
||||||
return new (Mem) OMPTaskDirective(NumClauses);
|
return new (Mem) OMPTaskDirective(NumClauses);
|
||||||
|
@ -544,8 +534,7 @@ OMPTaskgroupDirective *OMPTaskgroupDirective::Create(const ASTContext &C,
|
||||||
SourceLocation StartLoc,
|
SourceLocation StartLoc,
|
||||||
SourceLocation EndLoc,
|
SourceLocation EndLoc,
|
||||||
Stmt *AssociatedStmt) {
|
Stmt *AssociatedStmt) {
|
||||||
unsigned Size =
|
unsigned Size = llvm::alignTo(sizeof(OMPTaskgroupDirective), alignof(Stmt *));
|
||||||
llvm::alignTo(sizeof(OMPTaskgroupDirective), llvm::alignOf<Stmt *>());
|
|
||||||
void *Mem = C.Allocate(Size + sizeof(Stmt *));
|
void *Mem = C.Allocate(Size + sizeof(Stmt *));
|
||||||
OMPTaskgroupDirective *Dir =
|
OMPTaskgroupDirective *Dir =
|
||||||
new (Mem) OMPTaskgroupDirective(StartLoc, EndLoc);
|
new (Mem) OMPTaskgroupDirective(StartLoc, EndLoc);
|
||||||
|
@ -555,8 +544,7 @@ OMPTaskgroupDirective *OMPTaskgroupDirective::Create(const ASTContext &C,
|
||||||
|
|
||||||
OMPTaskgroupDirective *OMPTaskgroupDirective::CreateEmpty(const ASTContext &C,
|
OMPTaskgroupDirective *OMPTaskgroupDirective::CreateEmpty(const ASTContext &C,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size =
|
unsigned Size = llvm::alignTo(sizeof(OMPTaskgroupDirective), alignof(Stmt *));
|
||||||
llvm::alignTo(sizeof(OMPTaskgroupDirective), llvm::alignOf<Stmt *>());
|
|
||||||
void *Mem = C.Allocate(Size + sizeof(Stmt *));
|
void *Mem = C.Allocate(Size + sizeof(Stmt *));
|
||||||
return new (Mem) OMPTaskgroupDirective();
|
return new (Mem) OMPTaskgroupDirective();
|
||||||
}
|
}
|
||||||
|
@ -564,8 +552,8 @@ OMPTaskgroupDirective *OMPTaskgroupDirective::CreateEmpty(const ASTContext &C,
|
||||||
OMPCancellationPointDirective *OMPCancellationPointDirective::Create(
|
OMPCancellationPointDirective *OMPCancellationPointDirective::Create(
|
||||||
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
||||||
OpenMPDirectiveKind CancelRegion) {
|
OpenMPDirectiveKind CancelRegion) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPCancellationPointDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<Stmt *>());
|
llvm::alignTo(sizeof(OMPCancellationPointDirective), alignof(Stmt *));
|
||||||
void *Mem = C.Allocate(Size);
|
void *Mem = C.Allocate(Size);
|
||||||
OMPCancellationPointDirective *Dir =
|
OMPCancellationPointDirective *Dir =
|
||||||
new (Mem) OMPCancellationPointDirective(StartLoc, EndLoc);
|
new (Mem) OMPCancellationPointDirective(StartLoc, EndLoc);
|
||||||
|
@ -575,8 +563,8 @@ OMPCancellationPointDirective *OMPCancellationPointDirective::Create(
|
||||||
|
|
||||||
OMPCancellationPointDirective *
|
OMPCancellationPointDirective *
|
||||||
OMPCancellationPointDirective::CreateEmpty(const ASTContext &C, EmptyShell) {
|
OMPCancellationPointDirective::CreateEmpty(const ASTContext &C, EmptyShell) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPCancellationPointDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<Stmt *>());
|
llvm::alignTo(sizeof(OMPCancellationPointDirective), alignof(Stmt *));
|
||||||
void *Mem = C.Allocate(Size);
|
void *Mem = C.Allocate(Size);
|
||||||
return new (Mem) OMPCancellationPointDirective();
|
return new (Mem) OMPCancellationPointDirective();
|
||||||
}
|
}
|
||||||
|
@ -587,7 +575,7 @@ OMPCancelDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
||||||
OpenMPDirectiveKind CancelRegion) {
|
OpenMPDirectiveKind CancelRegion) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPCancelDirective) +
|
unsigned Size = llvm::alignTo(sizeof(OMPCancelDirective) +
|
||||||
sizeof(OMPClause *) * Clauses.size(),
|
sizeof(OMPClause *) * Clauses.size(),
|
||||||
llvm::alignOf<Stmt *>());
|
alignof(Stmt *));
|
||||||
void *Mem = C.Allocate(Size);
|
void *Mem = C.Allocate(Size);
|
||||||
OMPCancelDirective *Dir =
|
OMPCancelDirective *Dir =
|
||||||
new (Mem) OMPCancelDirective(StartLoc, EndLoc, Clauses.size());
|
new (Mem) OMPCancelDirective(StartLoc, EndLoc, Clauses.size());
|
||||||
|
@ -601,7 +589,7 @@ OMPCancelDirective *OMPCancelDirective::CreateEmpty(const ASTContext &C,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPCancelDirective) +
|
unsigned Size = llvm::alignTo(sizeof(OMPCancelDirective) +
|
||||||
sizeof(OMPClause *) * NumClauses,
|
sizeof(OMPClause *) * NumClauses,
|
||||||
llvm::alignOf<Stmt *>());
|
alignof(Stmt *));
|
||||||
void *Mem = C.Allocate(Size);
|
void *Mem = C.Allocate(Size);
|
||||||
return new (Mem) OMPCancelDirective(NumClauses);
|
return new (Mem) OMPCancelDirective(NumClauses);
|
||||||
}
|
}
|
||||||
|
@ -611,7 +599,7 @@ OMPFlushDirective *OMPFlushDirective::Create(const ASTContext &C,
|
||||||
SourceLocation EndLoc,
|
SourceLocation EndLoc,
|
||||||
ArrayRef<OMPClause *> Clauses) {
|
ArrayRef<OMPClause *> Clauses) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPFlushDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPFlushDirective), alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size());
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size());
|
||||||
OMPFlushDirective *Dir =
|
OMPFlushDirective *Dir =
|
||||||
new (Mem) OMPFlushDirective(StartLoc, EndLoc, Clauses.size());
|
new (Mem) OMPFlushDirective(StartLoc, EndLoc, Clauses.size());
|
||||||
|
@ -623,7 +611,7 @@ OMPFlushDirective *OMPFlushDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumClauses,
|
unsigned NumClauses,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPFlushDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPFlushDirective), alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses);
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses);
|
||||||
return new (Mem) OMPFlushDirective(NumClauses);
|
return new (Mem) OMPFlushDirective(NumClauses);
|
||||||
}
|
}
|
||||||
|
@ -634,7 +622,7 @@ OMPOrderedDirective *OMPOrderedDirective::Create(const ASTContext &C,
|
||||||
ArrayRef<OMPClause *> Clauses,
|
ArrayRef<OMPClause *> Clauses,
|
||||||
Stmt *AssociatedStmt) {
|
Stmt *AssociatedStmt) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPOrderedDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPOrderedDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(Stmt *) + sizeof(OMPClause *) * Clauses.size());
|
C.Allocate(Size + sizeof(Stmt *) + sizeof(OMPClause *) * Clauses.size());
|
||||||
OMPOrderedDirective *Dir =
|
OMPOrderedDirective *Dir =
|
||||||
|
@ -648,7 +636,7 @@ OMPOrderedDirective *OMPOrderedDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumClauses,
|
unsigned NumClauses,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPOrderedDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPOrderedDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(Stmt *) + sizeof(OMPClause *) * NumClauses);
|
C.Allocate(Size + sizeof(Stmt *) + sizeof(OMPClause *) * NumClauses);
|
||||||
return new (Mem) OMPOrderedDirective(NumClauses);
|
return new (Mem) OMPOrderedDirective(NumClauses);
|
||||||
|
@ -659,7 +647,7 @@ OMPAtomicDirective *OMPAtomicDirective::Create(
|
||||||
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *X, Expr *V,
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *X, Expr *V,
|
||||||
Expr *E, Expr *UE, bool IsXLHSInRHSPart, bool IsPostfixUpdate) {
|
Expr *E, Expr *UE, bool IsXLHSInRHSPart, bool IsPostfixUpdate) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPAtomicDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPAtomicDirective), alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
||||||
5 * sizeof(Stmt *));
|
5 * sizeof(Stmt *));
|
||||||
OMPAtomicDirective *Dir =
|
OMPAtomicDirective *Dir =
|
||||||
|
@ -679,7 +667,7 @@ OMPAtomicDirective *OMPAtomicDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumClauses,
|
unsigned NumClauses,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPAtomicDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPAtomicDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 5 * sizeof(Stmt *));
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 5 * sizeof(Stmt *));
|
||||||
return new (Mem) OMPAtomicDirective(NumClauses);
|
return new (Mem) OMPAtomicDirective(NumClauses);
|
||||||
|
@ -691,7 +679,7 @@ OMPTargetDirective *OMPTargetDirective::Create(const ASTContext &C,
|
||||||
ArrayRef<OMPClause *> Clauses,
|
ArrayRef<OMPClause *> Clauses,
|
||||||
Stmt *AssociatedStmt) {
|
Stmt *AssociatedStmt) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPTargetDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPTargetDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
||||||
OMPTargetDirective *Dir =
|
OMPTargetDirective *Dir =
|
||||||
|
@ -705,7 +693,7 @@ OMPTargetDirective *OMPTargetDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumClauses,
|
unsigned NumClauses,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPTargetDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPTargetDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
||||||
return new (Mem) OMPTargetDirective(NumClauses);
|
return new (Mem) OMPTargetDirective(NumClauses);
|
||||||
|
@ -714,8 +702,8 @@ OMPTargetDirective *OMPTargetDirective::CreateEmpty(const ASTContext &C,
|
||||||
OMPTargetParallelDirective *OMPTargetParallelDirective::Create(
|
OMPTargetParallelDirective *OMPTargetParallelDirective::Create(
|
||||||
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
||||||
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPTargetParallelDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
||||||
OMPTargetParallelDirective *Dir =
|
OMPTargetParallelDirective *Dir =
|
||||||
|
@ -728,8 +716,8 @@ OMPTargetParallelDirective *OMPTargetParallelDirective::Create(
|
||||||
OMPTargetParallelDirective *
|
OMPTargetParallelDirective *
|
||||||
OMPTargetParallelDirective::CreateEmpty(const ASTContext &C,
|
OMPTargetParallelDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumClauses, EmptyShell) {
|
unsigned NumClauses, EmptyShell) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPTargetParallelDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
||||||
return new (Mem) OMPTargetParallelDirective(NumClauses);
|
return new (Mem) OMPTargetParallelDirective(NumClauses);
|
||||||
|
@ -740,7 +728,7 @@ OMPTargetParallelForDirective *OMPTargetParallelForDirective::Create(
|
||||||
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
||||||
const HelperExprs &Exprs, bool HasCancel) {
|
const HelperExprs &Exprs, bool HasCancel) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForDirective),
|
unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForDirective),
|
||||||
llvm::alignOf<OMPClause *>());
|
alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(
|
void *Mem = C.Allocate(
|
||||||
Size + sizeof(OMPClause *) * Clauses.size() +
|
Size + sizeof(OMPClause *) * Clauses.size() +
|
||||||
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for));
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for));
|
||||||
|
@ -780,7 +768,7 @@ OMPTargetParallelForDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumClauses,
|
unsigned NumClauses,
|
||||||
unsigned CollapsedNum, EmptyShell) {
|
unsigned CollapsedNum, EmptyShell) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForDirective),
|
unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForDirective),
|
||||||
llvm::alignOf<OMPClause *>());
|
alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(
|
void *Mem = C.Allocate(
|
||||||
Size + sizeof(OMPClause *) * NumClauses +
|
Size + sizeof(OMPClause *) * NumClauses +
|
||||||
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for));
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for));
|
||||||
|
@ -790,9 +778,9 @@ OMPTargetParallelForDirective::CreateEmpty(const ASTContext &C,
|
||||||
OMPTargetDataDirective *OMPTargetDataDirective::Create(
|
OMPTargetDataDirective *OMPTargetDataDirective::Create(
|
||||||
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
||||||
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
|
||||||
void *Mem = C.Allocate(llvm::alignTo(sizeof(OMPTargetDataDirective),
|
void *Mem = C.Allocate(
|
||||||
llvm::alignOf<OMPClause *>()) +
|
llvm::alignTo(sizeof(OMPTargetDataDirective), alignof(OMPClause *)) +
|
||||||
sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
||||||
OMPTargetDataDirective *Dir =
|
OMPTargetDataDirective *Dir =
|
||||||
new (Mem) OMPTargetDataDirective(StartLoc, EndLoc, Clauses.size());
|
new (Mem) OMPTargetDataDirective(StartLoc, EndLoc, Clauses.size());
|
||||||
Dir->setClauses(Clauses);
|
Dir->setClauses(Clauses);
|
||||||
|
@ -803,18 +791,18 @@ OMPTargetDataDirective *OMPTargetDataDirective::Create(
|
||||||
OMPTargetDataDirective *OMPTargetDataDirective::CreateEmpty(const ASTContext &C,
|
OMPTargetDataDirective *OMPTargetDataDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned N,
|
unsigned N,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
void *Mem = C.Allocate(llvm::alignTo(sizeof(OMPTargetDataDirective),
|
void *Mem = C.Allocate(
|
||||||
llvm::alignOf<OMPClause *>()) +
|
llvm::alignTo(sizeof(OMPTargetDataDirective), alignof(OMPClause *)) +
|
||||||
sizeof(OMPClause *) * N + sizeof(Stmt *));
|
sizeof(OMPClause *) * N + sizeof(Stmt *));
|
||||||
return new (Mem) OMPTargetDataDirective(N);
|
return new (Mem) OMPTargetDataDirective(N);
|
||||||
}
|
}
|
||||||
|
|
||||||
OMPTargetEnterDataDirective *OMPTargetEnterDataDirective::Create(
|
OMPTargetEnterDataDirective *OMPTargetEnterDataDirective::Create(
|
||||||
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
||||||
ArrayRef<OMPClause *> Clauses) {
|
ArrayRef<OMPClause *> Clauses) {
|
||||||
void *Mem = C.Allocate(llvm::alignTo(sizeof(OMPTargetEnterDataDirective),
|
void *Mem = C.Allocate(
|
||||||
llvm::alignOf<OMPClause *>()) +
|
llvm::alignTo(sizeof(OMPTargetEnterDataDirective), alignof(OMPClause *)) +
|
||||||
sizeof(OMPClause *) * Clauses.size());
|
sizeof(OMPClause *) * Clauses.size());
|
||||||
OMPTargetEnterDataDirective *Dir =
|
OMPTargetEnterDataDirective *Dir =
|
||||||
new (Mem) OMPTargetEnterDataDirective(StartLoc, EndLoc, Clauses.size());
|
new (Mem) OMPTargetEnterDataDirective(StartLoc, EndLoc, Clauses.size());
|
||||||
Dir->setClauses(Clauses);
|
Dir->setClauses(Clauses);
|
||||||
|
@ -824,9 +812,9 @@ OMPTargetEnterDataDirective *OMPTargetEnterDataDirective::Create(
|
||||||
OMPTargetEnterDataDirective *
|
OMPTargetEnterDataDirective *
|
||||||
OMPTargetEnterDataDirective::CreateEmpty(const ASTContext &C, unsigned N,
|
OMPTargetEnterDataDirective::CreateEmpty(const ASTContext &C, unsigned N,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
void *Mem = C.Allocate(llvm::alignTo(sizeof(OMPTargetEnterDataDirective),
|
void *Mem = C.Allocate(
|
||||||
llvm::alignOf<OMPClause *>()) +
|
llvm::alignTo(sizeof(OMPTargetEnterDataDirective), alignof(OMPClause *)) +
|
||||||
sizeof(OMPClause *) * N);
|
sizeof(OMPClause *) * N);
|
||||||
return new (Mem) OMPTargetEnterDataDirective(N);
|
return new (Mem) OMPTargetEnterDataDirective(N);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -834,9 +822,9 @@ OMPTargetExitDataDirective *
|
||||||
OMPTargetExitDataDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
OMPTargetExitDataDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
||||||
SourceLocation EndLoc,
|
SourceLocation EndLoc,
|
||||||
ArrayRef<OMPClause *> Clauses) {
|
ArrayRef<OMPClause *> Clauses) {
|
||||||
void *Mem = C.Allocate(llvm::alignTo(sizeof(OMPTargetExitDataDirective),
|
void *Mem = C.Allocate(
|
||||||
llvm::alignOf<OMPClause *>()) +
|
llvm::alignTo(sizeof(OMPTargetExitDataDirective), alignof(OMPClause *)) +
|
||||||
sizeof(OMPClause *) * Clauses.size());
|
sizeof(OMPClause *) * Clauses.size());
|
||||||
OMPTargetExitDataDirective *Dir =
|
OMPTargetExitDataDirective *Dir =
|
||||||
new (Mem) OMPTargetExitDataDirective(StartLoc, EndLoc, Clauses.size());
|
new (Mem) OMPTargetExitDataDirective(StartLoc, EndLoc, Clauses.size());
|
||||||
Dir->setClauses(Clauses);
|
Dir->setClauses(Clauses);
|
||||||
|
@ -846,9 +834,9 @@ OMPTargetExitDataDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
||||||
OMPTargetExitDataDirective *
|
OMPTargetExitDataDirective *
|
||||||
OMPTargetExitDataDirective::CreateEmpty(const ASTContext &C, unsigned N,
|
OMPTargetExitDataDirective::CreateEmpty(const ASTContext &C, unsigned N,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
void *Mem = C.Allocate(llvm::alignTo(sizeof(OMPTargetExitDataDirective),
|
void *Mem = C.Allocate(
|
||||||
llvm::alignOf<OMPClause *>()) +
|
llvm::alignTo(sizeof(OMPTargetExitDataDirective), alignof(OMPClause *)) +
|
||||||
sizeof(OMPClause *) * N);
|
sizeof(OMPClause *) * N);
|
||||||
return new (Mem) OMPTargetExitDataDirective(N);
|
return new (Mem) OMPTargetExitDataDirective(N);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -858,7 +846,7 @@ OMPTeamsDirective *OMPTeamsDirective::Create(const ASTContext &C,
|
||||||
ArrayRef<OMPClause *> Clauses,
|
ArrayRef<OMPClause *> Clauses,
|
||||||
Stmt *AssociatedStmt) {
|
Stmt *AssociatedStmt) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPTeamsDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPTeamsDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
||||||
OMPTeamsDirective *Dir =
|
OMPTeamsDirective *Dir =
|
||||||
|
@ -872,7 +860,7 @@ OMPTeamsDirective *OMPTeamsDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumClauses,
|
unsigned NumClauses,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPTeamsDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPTeamsDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
||||||
return new (Mem) OMPTeamsDirective(NumClauses);
|
return new (Mem) OMPTeamsDirective(NumClauses);
|
||||||
|
@ -883,7 +871,7 @@ OMPTaskLoopDirective *OMPTaskLoopDirective::Create(
|
||||||
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
||||||
const HelperExprs &Exprs) {
|
const HelperExprs &Exprs) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPTaskLoopDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPTaskLoopDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
||||||
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_taskloop));
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_taskloop));
|
||||||
|
@ -922,7 +910,7 @@ OMPTaskLoopDirective *OMPTaskLoopDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned CollapsedNum,
|
unsigned CollapsedNum,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size =
|
unsigned Size =
|
||||||
llvm::alignTo(sizeof(OMPTaskLoopDirective), llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPTaskLoopDirective), alignof(OMPClause *));
|
||||||
void *Mem =
|
void *Mem =
|
||||||
C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
||||||
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_taskloop));
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_taskloop));
|
||||||
|
@ -933,8 +921,8 @@ OMPTaskLoopSimdDirective *OMPTaskLoopSimdDirective::Create(
|
||||||
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
||||||
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
||||||
const HelperExprs &Exprs) {
|
const HelperExprs &Exprs) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPTaskLoopSimdDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPTaskLoopSimdDirective), alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
||||||
sizeof(Stmt *) *
|
sizeof(Stmt *) *
|
||||||
numLoopChildren(CollapsedNum, OMPD_taskloop_simd));
|
numLoopChildren(CollapsedNum, OMPD_taskloop_simd));
|
||||||
|
@ -971,8 +959,8 @@ OMPTaskLoopSimdDirective *OMPTaskLoopSimdDirective::Create(
|
||||||
OMPTaskLoopSimdDirective *
|
OMPTaskLoopSimdDirective *
|
||||||
OMPTaskLoopSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
|
OMPTaskLoopSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
|
||||||
unsigned CollapsedNum, EmptyShell) {
|
unsigned CollapsedNum, EmptyShell) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPTaskLoopSimdDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPTaskLoopSimdDirective), alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
||||||
sizeof(Stmt *) *
|
sizeof(Stmt *) *
|
||||||
numLoopChildren(CollapsedNum, OMPD_taskloop_simd));
|
numLoopChildren(CollapsedNum, OMPD_taskloop_simd));
|
||||||
|
@ -983,8 +971,8 @@ OMPDistributeDirective *OMPDistributeDirective::Create(
|
||||||
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
||||||
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
||||||
const HelperExprs &Exprs) {
|
const HelperExprs &Exprs) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPDistributeDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPDistributeDirective), alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
||||||
sizeof(Stmt *) *
|
sizeof(Stmt *) *
|
||||||
numLoopChildren(CollapsedNum, OMPD_distribute));
|
numLoopChildren(CollapsedNum, OMPD_distribute));
|
||||||
|
@ -1021,8 +1009,8 @@ OMPDistributeDirective *OMPDistributeDirective::Create(
|
||||||
OMPDistributeDirective *
|
OMPDistributeDirective *
|
||||||
OMPDistributeDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
|
OMPDistributeDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
|
||||||
unsigned CollapsedNum, EmptyShell) {
|
unsigned CollapsedNum, EmptyShell) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPDistributeDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPDistributeDirective), alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
||||||
sizeof(Stmt *) *
|
sizeof(Stmt *) *
|
||||||
numLoopChildren(CollapsedNum, OMPD_distribute));
|
numLoopChildren(CollapsedNum, OMPD_distribute));
|
||||||
|
@ -1033,8 +1021,8 @@ OMPTargetUpdateDirective *
|
||||||
OMPTargetUpdateDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
OMPTargetUpdateDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
||||||
SourceLocation EndLoc,
|
SourceLocation EndLoc,
|
||||||
ArrayRef<OMPClause *> Clauses) {
|
ArrayRef<OMPClause *> Clauses) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPTargetUpdateDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPTargetUpdateDirective), alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size());
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size());
|
||||||
OMPTargetUpdateDirective *Dir =
|
OMPTargetUpdateDirective *Dir =
|
||||||
new (Mem) OMPTargetUpdateDirective(StartLoc, EndLoc, Clauses.size());
|
new (Mem) OMPTargetUpdateDirective(StartLoc, EndLoc, Clauses.size());
|
||||||
|
@ -1045,8 +1033,8 @@ OMPTargetUpdateDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
||||||
OMPTargetUpdateDirective *
|
OMPTargetUpdateDirective *
|
||||||
OMPTargetUpdateDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
|
OMPTargetUpdateDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPTargetUpdateDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPTargetUpdateDirective), alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses);
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses);
|
||||||
return new (Mem) OMPTargetUpdateDirective(NumClauses);
|
return new (Mem) OMPTargetUpdateDirective(NumClauses);
|
||||||
}
|
}
|
||||||
|
@ -1056,7 +1044,7 @@ OMPDistributeParallelForDirective *OMPDistributeParallelForDirective::Create(
|
||||||
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
||||||
const HelperExprs &Exprs) {
|
const HelperExprs &Exprs) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective),
|
unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective),
|
||||||
llvm::alignOf<OMPClause *>());
|
alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(
|
void *Mem = C.Allocate(
|
||||||
Size + sizeof(OMPClause *) * Clauses.size() +
|
Size + sizeof(OMPClause *) * Clauses.size() +
|
||||||
sizeof(Stmt *) *
|
sizeof(Stmt *) *
|
||||||
|
@ -1098,7 +1086,7 @@ OMPDistributeParallelForDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned CollapsedNum,
|
unsigned CollapsedNum,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective),
|
unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective),
|
||||||
llvm::alignOf<OMPClause *>());
|
alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(
|
void *Mem = C.Allocate(
|
||||||
Size + sizeof(OMPClause *) * NumClauses +
|
Size + sizeof(OMPClause *) * NumClauses +
|
||||||
sizeof(Stmt *) *
|
sizeof(Stmt *) *
|
||||||
|
@ -1112,7 +1100,7 @@ OMPDistributeParallelForSimdDirective::Create(
|
||||||
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
||||||
const HelperExprs &Exprs) {
|
const HelperExprs &Exprs) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForSimdDirective),
|
unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForSimdDirective),
|
||||||
llvm::alignOf<OMPClause *>());
|
alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(
|
void *Mem = C.Allocate(
|
||||||
Size + sizeof(OMPClause *) * Clauses.size() +
|
Size + sizeof(OMPClause *) * Clauses.size() +
|
||||||
sizeof(Stmt *) *
|
sizeof(Stmt *) *
|
||||||
|
@ -1154,7 +1142,7 @@ OMPDistributeParallelForSimdDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned CollapsedNum,
|
unsigned CollapsedNum,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForSimdDirective),
|
unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForSimdDirective),
|
||||||
llvm::alignOf<OMPClause *>());
|
alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(
|
void *Mem = C.Allocate(
|
||||||
Size + sizeof(OMPClause *) * NumClauses +
|
Size + sizeof(OMPClause *) * NumClauses +
|
||||||
sizeof(Stmt *) *
|
sizeof(Stmt *) *
|
||||||
|
@ -1167,8 +1155,8 @@ OMPDistributeSimdDirective *OMPDistributeSimdDirective::Create(
|
||||||
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
||||||
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
||||||
const HelperExprs &Exprs) {
|
const HelperExprs &Exprs) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPDistributeSimdDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPDistributeSimdDirective), alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(
|
void *Mem = C.Allocate(
|
||||||
Size + sizeof(OMPClause *) * Clauses.size() +
|
Size + sizeof(OMPClause *) * Clauses.size() +
|
||||||
sizeof(Stmt *) *
|
sizeof(Stmt *) *
|
||||||
|
@ -1207,8 +1195,8 @@ OMPDistributeSimdDirective *
|
||||||
OMPDistributeSimdDirective::CreateEmpty(const ASTContext &C,
|
OMPDistributeSimdDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumClauses,
|
unsigned NumClauses,
|
||||||
unsigned CollapsedNum, EmptyShell) {
|
unsigned CollapsedNum, EmptyShell) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPDistributeSimdDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPDistributeSimdDirective), alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(
|
void *Mem = C.Allocate(
|
||||||
Size + sizeof(OMPClause *) * NumClauses +
|
Size + sizeof(OMPClause *) * NumClauses +
|
||||||
sizeof(Stmt *) *
|
sizeof(Stmt *) *
|
||||||
|
@ -1221,7 +1209,7 @@ OMPTargetParallelForSimdDirective *OMPTargetParallelForSimdDirective::Create(
|
||||||
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
||||||
const HelperExprs &Exprs) {
|
const HelperExprs &Exprs) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForSimdDirective),
|
unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForSimdDirective),
|
||||||
llvm::alignOf<OMPClause *>());
|
alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(
|
void *Mem = C.Allocate(
|
||||||
Size + sizeof(OMPClause *) * Clauses.size() +
|
Size + sizeof(OMPClause *) * Clauses.size() +
|
||||||
sizeof(Stmt *) *
|
sizeof(Stmt *) *
|
||||||
|
@ -1263,7 +1251,7 @@ OMPTargetParallelForSimdDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned CollapsedNum,
|
unsigned CollapsedNum,
|
||||||
EmptyShell) {
|
EmptyShell) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForSimdDirective),
|
unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForSimdDirective),
|
||||||
llvm::alignOf<OMPClause *>());
|
alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(
|
void *Mem = C.Allocate(
|
||||||
Size + sizeof(OMPClause *) * NumClauses +
|
Size + sizeof(OMPClause *) * NumClauses +
|
||||||
sizeof(Stmt *) *
|
sizeof(Stmt *) *
|
||||||
|
@ -1276,8 +1264,8 @@ OMPTargetSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
||||||
SourceLocation EndLoc, unsigned CollapsedNum,
|
SourceLocation EndLoc, unsigned CollapsedNum,
|
||||||
ArrayRef<OMPClause *> Clauses,
|
ArrayRef<OMPClause *> Clauses,
|
||||||
Stmt *AssociatedStmt, const HelperExprs &Exprs) {
|
Stmt *AssociatedStmt, const HelperExprs &Exprs) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPTargetSimdDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPTargetSimdDirective), alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
||||||
sizeof(Stmt *) *
|
sizeof(Stmt *) *
|
||||||
numLoopChildren(CollapsedNum, OMPD_target_simd));
|
numLoopChildren(CollapsedNum, OMPD_target_simd));
|
||||||
|
@ -1304,8 +1292,8 @@ OMPTargetSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
||||||
OMPTargetSimdDirective *
|
OMPTargetSimdDirective *
|
||||||
OMPTargetSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
|
OMPTargetSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
|
||||||
unsigned CollapsedNum, EmptyShell) {
|
unsigned CollapsedNum, EmptyShell) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPTargetSimdDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPTargetSimdDirective), alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
||||||
sizeof(Stmt *) *
|
sizeof(Stmt *) *
|
||||||
numLoopChildren(CollapsedNum, OMPD_target_simd));
|
numLoopChildren(CollapsedNum, OMPD_target_simd));
|
||||||
|
@ -1316,8 +1304,8 @@ OMPTeamsDistributeDirective *OMPTeamsDistributeDirective::Create(
|
||||||
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
||||||
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
||||||
const HelperExprs &Exprs) {
|
const HelperExprs &Exprs) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPTeamsDistributeDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPTeamsDistributeDirective), alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(
|
void *Mem = C.Allocate(
|
||||||
Size + sizeof(OMPClause *) * Clauses.size() +
|
Size + sizeof(OMPClause *) * Clauses.size() +
|
||||||
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));
|
||||||
|
@ -1355,8 +1343,8 @@ OMPTeamsDistributeDirective *
|
||||||
OMPTeamsDistributeDirective::CreateEmpty(const ASTContext &C,
|
OMPTeamsDistributeDirective::CreateEmpty(const ASTContext &C,
|
||||||
unsigned NumClauses,
|
unsigned NumClauses,
|
||||||
unsigned CollapsedNum, EmptyShell) {
|
unsigned CollapsedNum, EmptyShell) {
|
||||||
unsigned Size = llvm::alignTo(sizeof(OMPTeamsDistributeDirective),
|
unsigned Size =
|
||||||
llvm::alignOf<OMPClause *>());
|
llvm::alignTo(sizeof(OMPTeamsDistributeDirective), alignof(OMPClause *));
|
||||||
void *Mem = C.Allocate(
|
void *Mem = C.Allocate(
|
||||||
Size + sizeof(OMPClause *) * NumClauses +
|
Size + sizeof(OMPClause *) * NumClauses +
|
||||||
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));
|
||||||
|
|
|
@ -530,7 +530,7 @@ const ASTTemplateArgumentListInfo *
|
||||||
ASTTemplateArgumentListInfo::Create(ASTContext &C,
|
ASTTemplateArgumentListInfo::Create(ASTContext &C,
|
||||||
const TemplateArgumentListInfo &List) {
|
const TemplateArgumentListInfo &List) {
|
||||||
std::size_t size = totalSizeToAlloc<TemplateArgumentLoc>(List.size());
|
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);
|
return new (Mem) ASTTemplateArgumentListInfo(List);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include "llvm/Support/ErrorHandling.h"
|
#include "llvm/Support/ErrorHandling.h"
|
||||||
using namespace clang;
|
using namespace clang;
|
||||||
|
|
||||||
static const unsigned TypeLocMaxDataAlign = llvm::alignOf<void *>();
|
static const unsigned TypeLocMaxDataAlign = alignof(void *);
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// TypeLoc Implementation
|
// TypeLoc Implementation
|
||||||
|
|
|
@ -2050,8 +2050,7 @@ CFGBlock *CFGBuilder::VisitDeclStmt(DeclStmt *DS) {
|
||||||
E = DS->decl_rend();
|
E = DS->decl_rend();
|
||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
// Get the alignment of the new DeclStmt, padding out to >=8 bytes.
|
// Get the alignment of the new DeclStmt, padding out to >=8 bytes.
|
||||||
unsigned A = llvm::AlignOf<DeclStmt>::Alignment < 8
|
unsigned A = alignof(DeclStmt) < 8 ? 8 : alignof(DeclStmt);
|
||||||
? 8 : llvm::AlignOf<DeclStmt>::Alignment;
|
|
||||||
|
|
||||||
// Allocate the DeclStmt using the BumpPtrAllocator. It will get
|
// Allocate the DeclStmt using the BumpPtrAllocator. It will get
|
||||||
// automatically freed with the CFG.
|
// automatically freed with the CFG.
|
||||||
|
|
|
@ -621,8 +621,8 @@ Selector SelectorTable::getSelector(unsigned nKeys, IdentifierInfo **IIV) {
|
||||||
// variable size array (for parameter types) at the end of them.
|
// variable size array (for parameter types) at the end of them.
|
||||||
unsigned Size = sizeof(MultiKeywordSelector) + nKeys*sizeof(IdentifierInfo *);
|
unsigned Size = sizeof(MultiKeywordSelector) + nKeys*sizeof(IdentifierInfo *);
|
||||||
MultiKeywordSelector *SI =
|
MultiKeywordSelector *SI =
|
||||||
(MultiKeywordSelector*)SelTabImpl.Allocator.Allocate(Size,
|
(MultiKeywordSelector *)SelTabImpl.Allocator.Allocate(
|
||||||
llvm::alignOf<MultiKeywordSelector>());
|
Size, alignof(MultiKeywordSelector));
|
||||||
new (SI) MultiKeywordSelector(nKeys, IIV);
|
new (SI) MultiKeywordSelector(nKeys, IIV);
|
||||||
SelTabImpl.Table.InsertNode(SI, InsertPos);
|
SelTabImpl.Table.InsertNode(SI, InsertPos);
|
||||||
return Selector(SI);
|
return Selector(SI);
|
||||||
|
|
|
@ -445,7 +445,7 @@ CodeGenFunction::PopCleanupBlocks(EHScopeStack::stable_iterator Old,
|
||||||
for (size_t I = OldLifetimeExtendedSize,
|
for (size_t I = OldLifetimeExtendedSize,
|
||||||
E = LifetimeExtendedCleanupStack.size(); I != E; /**/) {
|
E = LifetimeExtendedCleanupStack.size(); I != E; /**/) {
|
||||||
// Alignment should be guaranteed by the vptrs in the individual cleanups.
|
// 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");
|
"misaligned cleanup stack entry");
|
||||||
|
|
||||||
LifetimeExtendedCleanupHeader &Header =
|
LifetimeExtendedCleanupHeader &Header =
|
||||||
|
|
|
@ -427,8 +427,7 @@ public:
|
||||||
// EHCleanupScope ought to have alignment equal to that -- not more
|
// EHCleanupScope ought to have alignment equal to that -- not more
|
||||||
// (would be misaligned by the stack allocator), and not less (would
|
// (would be misaligned by the stack allocator), and not less (would
|
||||||
// break the appended classes).
|
// break the appended classes).
|
||||||
static_assert(llvm::AlignOf<EHCleanupScope>::Alignment ==
|
static_assert(alignof(EHCleanupScope) == EHScopeStack::ScopeStackAlignment,
|
||||||
EHScopeStack::ScopeStackAlignment,
|
|
||||||
"EHCleanupScope expected alignment");
|
"EHCleanupScope expected alignment");
|
||||||
|
|
||||||
/// An exceptions scope which filters exceptions thrown through it.
|
/// An exceptions scope which filters exceptions thrown through it.
|
||||||
|
|
|
@ -441,7 +441,7 @@ public:
|
||||||
LifetimeExtendedCleanupStack.resize(
|
LifetimeExtendedCleanupStack.resize(
|
||||||
LifetimeExtendedCleanupStack.size() + sizeof(Header) + Header.Size);
|
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");
|
"Cleanup will be allocated on misaligned address");
|
||||||
char *Buffer = &LifetimeExtendedCleanupStack[OldSize];
|
char *Buffer = &LifetimeExtendedCleanupStack[OldSize];
|
||||||
new (Buffer) LifetimeExtendedCleanupHeader(Header);
|
new (Buffer) LifetimeExtendedCleanupHeader(Header);
|
||||||
|
|
|
@ -271,7 +271,7 @@ public:
|
||||||
|
|
||||||
/// Push a lazily-created cleanup on the stack.
|
/// Push a lazily-created cleanup on the stack.
|
||||||
template <class T, class... As> void pushCleanup(CleanupKind Kind, As... A) {
|
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.");
|
"Cleanup's alignment is too large.");
|
||||||
void *Buffer = pushCleanup(Kind, sizeof(T));
|
void *Buffer = pushCleanup(Kind, sizeof(T));
|
||||||
Cleanup *Obj = new (Buffer) T(A...);
|
Cleanup *Obj = new (Buffer) T(A...);
|
||||||
|
@ -281,7 +281,7 @@ public:
|
||||||
/// Push a lazily-created cleanup on the stack. Tuple version.
|
/// Push a lazily-created cleanup on the stack. Tuple version.
|
||||||
template <class T, class... As>
|
template <class T, class... As>
|
||||||
void pushCleanupTuple(CleanupKind Kind, std::tuple<As...> A) {
|
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.");
|
"Cleanup's alignment is too large.");
|
||||||
void *Buffer = pushCleanup(Kind, sizeof(T));
|
void *Buffer = pushCleanup(Kind, sizeof(T));
|
||||||
Cleanup *Obj = new (Buffer) T(std::move(A));
|
Cleanup *Obj = new (Buffer) T(std::move(A));
|
||||||
|
@ -303,7 +303,7 @@ public:
|
||||||
/// stack is modified.
|
/// stack is modified.
|
||||||
template <class T, class... As>
|
template <class T, class... As>
|
||||||
T *pushCleanupWithExtra(CleanupKind Kind, size_t N, As... A) {
|
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.");
|
"Cleanup's alignment is too large.");
|
||||||
void *Buffer = pushCleanup(Kind, sizeof(T) + T::getExtraSize(N));
|
void *Buffer = pushCleanup(Kind, sizeof(T) + T::getExtraSize(N));
|
||||||
return new (Buffer) T(N, A...);
|
return new (Buffer) T(N, A...);
|
||||||
|
|
|
@ -240,6 +240,6 @@ ModuleMacro *ModuleMacro::create(Preprocessor &PP, Module *OwningModule,
|
||||||
ArrayRef<ModuleMacro *> Overrides) {
|
ArrayRef<ModuleMacro *> Overrides) {
|
||||||
void *Mem = PP.getPreprocessorAllocator().Allocate(
|
void *Mem = PP.getPreprocessorAllocator().Allocate(
|
||||||
sizeof(ModuleMacro) + sizeof(ModuleMacro *) * Overrides.size(),
|
sizeof(ModuleMacro) + sizeof(ModuleMacro *) * Overrides.size(),
|
||||||
llvm::alignOf<ModuleMacro>());
|
alignof(ModuleMacro));
|
||||||
return new (Mem) ModuleMacro(OwningModule, II, Macro, Overrides);
|
return new (Mem) ModuleMacro(OwningModule, II, Macro, Overrides);
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ MacroInfo *Preprocessor::AllocateMacroInfo(SourceLocation L) {
|
||||||
|
|
||||||
MacroInfo *Preprocessor::AllocateDeserializedMacroInfo(SourceLocation L,
|
MacroInfo *Preprocessor::AllocateDeserializedMacroInfo(SourceLocation L,
|
||||||
unsigned SubModuleID) {
|
unsigned SubModuleID) {
|
||||||
static_assert(llvm::AlignOf<MacroInfo>::Alignment >= sizeof(SubModuleID),
|
static_assert(alignof(MacroInfo) >= sizeof(SubModuleID),
|
||||||
"alignment for MacroInfo is less than the ID");
|
"alignment for MacroInfo is less than the ID");
|
||||||
DeserializedMacroInfoChain *MIChain =
|
DeserializedMacroInfoChain *MIChain =
|
||||||
BP.Allocate<DeserializedMacroInfoChain>();
|
BP.Allocate<DeserializedMacroInfoChain>();
|
||||||
|
|
|
@ -21,18 +21,13 @@ using namespace clang;
|
||||||
|
|
||||||
ExternalPreprocessingRecordSource::~ExternalPreprocessingRecordSource() { }
|
ExternalPreprocessingRecordSource::~ExternalPreprocessingRecordSource() { }
|
||||||
|
|
||||||
|
|
||||||
InclusionDirective::InclusionDirective(PreprocessingRecord &PPRec,
|
InclusionDirective::InclusionDirective(PreprocessingRecord &PPRec,
|
||||||
InclusionKind Kind,
|
InclusionKind Kind, StringRef FileName,
|
||||||
StringRef FileName,
|
|
||||||
bool InQuotes, bool ImportedModule,
|
bool InQuotes, bool ImportedModule,
|
||||||
const FileEntry *File,
|
const FileEntry *File, SourceRange Range)
|
||||||
SourceRange Range)
|
: PreprocessingDirective(InclusionDirectiveKind, Range), InQuotes(InQuotes),
|
||||||
: PreprocessingDirective(InclusionDirectiveKind, Range),
|
Kind(Kind), ImportedModule(ImportedModule), File(File) {
|
||||||
InQuotes(InQuotes), Kind(Kind), ImportedModule(ImportedModule), File(File)
|
char *Memory = (char *)PPRec.Allocate(FileName.size() + 1, alignof(char));
|
||||||
{
|
|
||||||
char *Memory
|
|
||||||
= (char*)PPRec.Allocate(FileName.size() + 1, llvm::alignOf<char>());
|
|
||||||
memcpy(Memory, FileName.data(), FileName.size());
|
memcpy(Memory, FileName.data(), FileName.size());
|
||||||
Memory[FileName.size()] = 0;
|
Memory[FileName.size()] = 0;
|
||||||
this->FileName = StringRef(Memory, FileName.size());
|
this->FileName = StringRef(Memory, FileName.size());
|
||||||
|
|
|
@ -62,7 +62,7 @@ void *AttributeFactory::allocate(size_t size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, allocate something new.
|
// Otherwise, allocate something new.
|
||||||
return Alloc.Allocate(size, llvm::AlignOf<AttributeFactory>::Alignment);
|
return Alloc.Allocate(size, alignof(AttributeFactory));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AttributeFactory::reclaimPool(AttributeList *cur) {
|
void AttributeFactory::reclaimPool(AttributeList *cur) {
|
||||||
|
|
|
@ -328,9 +328,9 @@ StringRef CodeCompletionTUInfo::getParentName(const DeclContext *DC) {
|
||||||
|
|
||||||
CodeCompletionString *CodeCompletionBuilder::TakeString() {
|
CodeCompletionString *CodeCompletionBuilder::TakeString() {
|
||||||
void *Mem = getAllocator().Allocate(
|
void *Mem = getAllocator().Allocate(
|
||||||
sizeof(CodeCompletionString) + sizeof(Chunk) * Chunks.size()
|
sizeof(CodeCompletionString) + sizeof(Chunk) * Chunks.size() +
|
||||||
+ sizeof(const char *) * Annotations.size(),
|
sizeof(const char *) * Annotations.size(),
|
||||||
llvm::alignOf<CodeCompletionString>());
|
alignof(CodeCompletionString));
|
||||||
CodeCompletionString *Result
|
CodeCompletionString *Result
|
||||||
= new (Mem) CodeCompletionString(Chunks.data(), Chunks.size(),
|
= new (Mem) CodeCompletionString(Chunks.data(), Chunks.size(),
|
||||||
Priority, Availability,
|
Priority, Availability,
|
||||||
|
|
|
@ -975,9 +975,9 @@ void *Sema::SaveNestedNameSpecifierAnnotation(CXXScopeSpec &SS) {
|
||||||
if (SS.isEmpty() || SS.isInvalid())
|
if (SS.isEmpty() || SS.isInvalid())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
void *Mem = Context.Allocate((sizeof(NestedNameSpecifierAnnotation) +
|
void *Mem = Context.Allocate(
|
||||||
SS.location_size()),
|
(sizeof(NestedNameSpecifierAnnotation) + SS.location_size()),
|
||||||
llvm::alignOf<NestedNameSpecifierAnnotation>());
|
alignof(NestedNameSpecifierAnnotation));
|
||||||
NestedNameSpecifierAnnotation *Annotation
|
NestedNameSpecifierAnnotation *Annotation
|
||||||
= new (Mem) NestedNameSpecifierAnnotation;
|
= new (Mem) NestedNameSpecifierAnnotation;
|
||||||
Annotation->NNS = SS.getScopeRep();
|
Annotation->NNS = SS.getScopeRep();
|
||||||
|
|
|
@ -39,7 +39,7 @@ class TypeLocBuilder {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// The inline buffer.
|
/// The inline buffer.
|
||||||
enum { BufferMaxAlignment = llvm::AlignOf<void*>::Alignment };
|
enum { BufferMaxAlignment = alignof(void *) };
|
||||||
llvm::AlignedCharArray<BufferMaxAlignment, InlineCapacity> InlineBuffer;
|
llvm::AlignedCharArray<BufferMaxAlignment, InlineCapacity> InlineBuffer;
|
||||||
unsigned NumBytesAtAlign4, NumBytesAtAlign8;
|
unsigned NumBytesAtAlign4, NumBytesAtAlign8;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue