On Sun, Nov 22, 2009 at 12:01 AM, Daniel Dunbar <[email protected]> wrote: >> @@ -38,7 +38,13 @@ >> I = CGRecordLayouts.begin(), E = CGRecordLayouts.end(); >> I != E; ++I) >> delete I->second; >> - CGRecordLayouts.clear(); >> + { >> + llvm::FoldingSet<CGFunctionInfo>::iterator >> + I = FunctionInfos.begin(), E = FunctionInfos.end(); >> + while (I != E) >> + delete &*I++; >> + } > > This isn't invalidating the infos, it could be a standard for loop?
FoldingSets are intrusive; the ++ operator accesses the current element pointed to by the iterator. This structure is based off a similar loop in ASTContext. -Eli _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
