本文整理汇总了C++中ASTContext::Deallocate方法的典型用法代码示例。如果您正苦于以下问题:C++ ASTContext::Deallocate方法的具体用法?C++ ASTContext::Deallocate怎么用?C++ ASTContext::Deallocate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ASTContext
的用法示例。
在下文中一共展示了ASTContext::Deallocate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setOutputsAndInputsAndClobbers
void GCCAsmStmt::setOutputsAndInputsAndClobbers(const ASTContext &C,
IdentifierInfo **Names,
StringLiteral **Constraints,
Stmt **Exprs,
unsigned NumOutputs,
unsigned NumInputs,
StringLiteral **Clobbers,
unsigned NumClobbers) {
this->NumOutputs = NumOutputs;
this->NumInputs = NumInputs;
this->NumClobbers = NumClobbers;
unsigned NumExprs = NumOutputs + NumInputs;
C.Deallocate(this->Names);
this->Names = new (C) IdentifierInfo*[NumExprs];
std::copy(Names, Names + NumExprs, this->Names);
C.Deallocate(this->Exprs);
this->Exprs = new (C) Stmt*[NumExprs];
std::copy(Exprs, Exprs + NumExprs, this->Exprs);
C.Deallocate(this->Constraints);
this->Constraints = new (C) StringLiteral*[NumExprs];
std::copy(Constraints, Constraints + NumExprs, this->Constraints);
C.Deallocate(this->Clobbers);
this->Clobbers = new (C) StringLiteral*[NumClobbers];
std::copy(Clobbers, Clobbers + NumClobbers, this->Clobbers);
}
示例2: Destroy
void CXXConstructExpr::Destroy(ASTContext &C) {
DestroyChildren(C);
if (Args)
C.Deallocate(Args);
this->~CXXConstructExpr();
C.Deallocate(this);
}
示例3: Destroy
void CXXRecordDecl::Destroy(ASTContext &C) {
if (data().Definition == this) {
C.Deallocate(data().Bases);
C.Deallocate(data().VBases);
C.Deallocate(&data());
}
this->RecordDecl::Destroy(C);
}
示例4: Destroy
void ClassTemplateDecl::Destroy(ASTContext& C) {
if (!PreviousDeclaration) {
CommonPtr->~Common();
C.Deallocate((void*)CommonPtr);
}
CommonPtr = 0;
this->~ClassTemplateDecl();
C.Deallocate((void*)this);
}
示例5: Destroy
void ASTRecordLayout::Destroy(ASTContext &Ctx) {
if (FieldOffsets)
Ctx.Deallocate(FieldOffsets);
if (CXXInfo) {
Ctx.Deallocate(CXXInfo);
CXXInfo->~CXXRecordLayoutInfo();
}
this->~ASTRecordLayout();
Ctx.Deallocate(this);
}
示例6: Destroy
void VarDecl::Destroy(ASTContext& C) {
Expr *Init = getInit();
if (Init) {
Init->Destroy(C);
if (EvaluatedStmt *Eval = this->Init.dyn_cast<EvaluatedStmt *>()) {
Eval->~EvaluatedStmt();
C.Deallocate(Eval);
}
}
this->~VarDecl();
C.Deallocate((void *)this);
}
示例7: Destroy
void Stmt::Destroy(ASTContext &C) {
DestroyChildren(C);
// FIXME: Eventually all Stmts should be allocated with the allocator
// in ASTContext, just like with Decls.
this->~Stmt();
C.Deallocate((void *)this);
}
示例8: setStmts
void CompoundStmt::setStmts(ASTContext &C, Stmt **Stmts, unsigned NumStmts) {
if (this->Body)
C.Deallocate(Body);
this->CompoundStmtBits.NumStmts = NumStmts;
Body = new (C) Stmt*[NumStmts];
memcpy(Body, Stmts, sizeof(Stmt *) * NumStmts);
}
示例9: setInit
void VarDecl::setInit(ASTContext &C, Expr *I) {
if (EvaluatedStmt *Eval = Init.dyn_cast<EvaluatedStmt *>()) {
Eval->~EvaluatedStmt();
C.Deallocate(Eval);
}
Init = I;
}
示例10: setStmts
void CompoundStmt::setStmts(const ASTContext &C, ArrayRef<Stmt *> Stmts) {
if (Body)
C.Deallocate(Body);
CompoundStmtBits.NumStmts = Stmts.size();
assert(CompoundStmtBits.NumStmts == Stmts.size() &&
"NumStmts doesn't fit in bits of CompoundStmtBits.NumStmts!");
Body = new (C) Stmt*[Stmts.size()];
std::copy(Stmts.begin(), Stmts.end(), Body);
}
示例11: Destroy
void FunctionDecl::Destroy(ASTContext& C) {
if (Body && Body.isOffset())
Body.get(C.getExternalSource())->Destroy(C);
for (param_iterator I=param_begin(), E=param_end(); I!=E; ++I)
(*I)->Destroy(C);
C.Deallocate(ParamInfo);
Decl::Destroy(C);
}
示例12: Destroy
void FullExpr::Destroy(ASTContext &Context) {
if (Expr *E = SubExpr.dyn_cast<Expr *>()) {
E->Destroy(Context);
return;
}
ExprAndTemporaries *ET = SubExpr.get<ExprAndTemporaries *>();
for (ExprAndTemporaries::temps_iterator i = ET->temps_begin(),
e = ET->temps_end(); i != e; ++i)
(*i)->Destroy(Context);
Context.Deallocate(ET);
}
示例13: setIntValue
void APNumericStorage::setIntValue(ASTContext &C, const APInt &Val) {
if (hasAllocation())
C.Deallocate(pVal);
BitWidth = Val.getBitWidth();
unsigned NumWords = Val.getNumWords();
const uint64_t* Words = Val.getRawData();
if (NumWords > 1) {
pVal = new (C) uint64_t[NumWords];
std::copy(Words, Words + NumWords, pVal);
} else if (NumWords == 1)
VAL = Words[0];
else
VAL = 0;
}
示例14: new
/// setNumArgs - This changes the number of arguments present in this call.
/// Any orphaned expressions are deleted by this, and any new operands are set
/// to null.
void
FunctionCall::setNumArgs(ASTContext& C, unsigned NumArgs) {
// No change, just return.
if (NumArgs == getNumArgs()) return;
// If shrinking # arguments, just delete the extras and forgot them.
if (NumArgs < getNumArgs()) {
this->NumArgs = NumArgs;
return;
}
// Otherwise, we are growing the # arguments. New an bigger argument array.
Stmt **NewSubExprs = new (C) Stmt*[NumArgs+1];
// Copy over args.
for (unsigned i = 0; i != getNumArgs()+ARGS_START; ++i)
NewSubExprs[i] = SubExprs[i];
// Null out new args.
for (unsigned i = getNumArgs()+ARGS_START; i != NumArgs+ARGS_START; ++i)
NewSubExprs[i] = 0;
if (SubExprs) C.Deallocate(SubExprs);
SubExprs = NewSubExprs;
this->NumArgs = NumArgs;
}
示例15: Destroy
void NestedNameSpecifier::Destroy(ASTContext &Context) {
this->~NestedNameSpecifier();
Context.Deallocate((void *)this);
}