Exemple #1
0
 void DeclCollector::AddedCXXImplicitMember(const CXXRecordDecl *RD,
                                            const Decl *D) {
   assert(D->isImplicit());
   // We need to mark the decls coming from the modules
   if (comesFromASTReader(RD) || comesFromASTReader(D)) {
     Decl* implicitD = const_cast<Decl*>(D);
     implicitD->addAttr(UsedAttr::CreateImplicit(implicitD->getASTContext()));
   }
 }
Exemple #2
0
const Decl* Slice::getBoogieDecl(Naming& naming, SmackRep& rep) {
  if (name == "")
    return 0;
  Naming localNaming(naming);
  vector< pair<string,string> > params;
  for (unordered_set<Value*>::iterator V = inputs.begin(), E = inputs.end(); V != E; ++V)
    params.push_back(getParameter(*V,localNaming,rep));
  Decl* D = Decl::function(getName(),params,"bool",getCode(localNaming,rep));
  D->addAttr(Attr::attr("inline"));
  return D;
}
Exemple #3
0
 void IncrementalParser::markWholeTransactionAsUsed(Transaction* T) const {
   for (size_t Idx = 0; Idx < T->size() /*can change in the loop!*/; ++Idx) {
     Transaction::DelayCallInfo I = (*T)[Idx];
     // FIXME: implement for multiple decls in a DGR.
     assert(I.m_DGR.isSingleDecl());
     Decl* D = I.m_DGR.getSingleDecl();
     if (!D->hasAttr<clang::UsedAttr>())
       D->addAttr(::new (D->getASTContext())
                  clang::UsedAttr(D->getSourceRange(), D->getASTContext(),
                                  0/*AttributeSpellingListIndex*/));
   }
 }