当前位置: 首页>>代码示例>>C++>>正文


C++ ASTContext::Deallocate方法代码示例

本文整理汇总了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);
}
开发者ID:elfprince13,项目名称:clang,代码行数:30,代码来源:Stmt.cpp

示例2: Destroy

void CXXConstructExpr::Destroy(ASTContext &C) {
  DestroyChildren(C);
  if (Args)
    C.Deallocate(Args);
  this->~CXXConstructExpr();
  C.Deallocate(this);
}
开发者ID:blickly,项目名称:llvm-clang-PRETC,代码行数:7,代码来源:ExprCXX.cpp

示例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);
}
开发者ID:Gcrosby5269,项目名称:clamav-bytecode-compiler,代码行数:8,代码来源:DeclCXX.cpp

示例4: Destroy

void ClassTemplateDecl::Destroy(ASTContext& C) {
    if (!PreviousDeclaration) {
        CommonPtr->~Common();
        C.Deallocate((void*)CommonPtr);
    }
    CommonPtr = 0;

    this->~ClassTemplateDecl();
    C.Deallocate((void*)this);
}
开发者ID:silviubaranga,项目名称:SHP,代码行数:10,代码来源:DeclTemplate.cpp

示例5: Destroy

void ASTRecordLayout::Destroy(ASTContext &Ctx) {
  if (FieldOffsets)
    Ctx.Deallocate(FieldOffsets);
  if (CXXInfo) {
    Ctx.Deallocate(CXXInfo);
    CXXInfo->~CXXRecordLayoutInfo();
  }
  this->~ASTRecordLayout();
  Ctx.Deallocate(this);
}
开发者ID:ujhpc,项目名称:clang,代码行数:10,代码来源:RecordLayout.cpp

示例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);
}
开发者ID:,项目名称:,代码行数:12,代码来源:

示例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);
}
开发者ID:blickly,项目名称:llvm-clang-PRETC,代码行数:7,代码来源:Stmt.cpp

示例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);
}
开发者ID:AaronBallman,项目名称:tra-working,代码行数:8,代码来源:Stmt.cpp

示例9: setInit

void VarDecl::setInit(ASTContext &C, Expr *I) {
  if (EvaluatedStmt *Eval = Init.dyn_cast<EvaluatedStmt *>()) {
    Eval->~EvaluatedStmt();
    C.Deallocate(Eval);
  }

  Init = I;
}
开发者ID:,项目名称:,代码行数:8,代码来源:

示例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);
}
开发者ID:elfprince13,项目名称:clang,代码行数:10,代码来源:Stmt.cpp

示例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);
}
开发者ID:Killfrra,项目名称:llvm-kernel,代码行数:11,代码来源:Decl.cpp

示例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);
}
开发者ID:Gcrosby5269,项目名称:clamav-bytecode-compiler,代码行数:13,代码来源:FullExpr.cpp

示例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;
}
开发者ID:isanbard,项目名称:flang,代码行数:15,代码来源:Expr.cpp

示例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;
}
开发者ID:YabinHu,项目名称:mlang,代码行数:27,代码来源:Expr.cpp

示例15: Destroy

void NestedNameSpecifier::Destroy(ASTContext &Context) {
  this->~NestedNameSpecifier();
  Context.Deallocate((void *)this);
}
开发者ID:blickly,项目名称:llvm-clang-PRETC,代码行数:4,代码来源:NestedNameSpecifier.cpp


注:本文中的ASTContext::Deallocate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。