Hi, > + // Add llvm.global.annotations > + if (!AttributeAnnotateGlobals.empty()) { > + std::vector<Constant*> AttrList;
since you know how big this vector is going to be, you could reserve that much space here. > + for (unsigned i = 0, e = AttributeAnnotateGlobals.size(); i != e; ++i) { > + Constant *Elts[2] = {AttributeAnnotateGlobals[i].first, > + AttributeAnnotateGlobals[i].second }; > + AttrList.push_back(ConstantStruct::get(Elts, 2, false)); > + } You presumably could have done this at the point where values are added to AttributeAnnotateGlobals, eliminating the need for AttrList altogether. > + gv->setSection("llvm.metadata"); At this point you can presumably empty out AttributeAnnotateGlobals, freeing memory. > + if (!annotateAttr) > + return; No need for this return statement, since if annotateAttr is NULL then > + // There may be multiple annotate attributes. Pass return of lookup_attr > + // to successive lookups. > + while (annotateAttr) { this while loop is never executed. Ciao, Duncan. _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits