> On Jun 30, 2015, at 11:09 AM, David Blaikie <dblai...@gmail.com> wrote: > > Oh, and, assuming this function isn't recursive (ie: the process of building > the DIModule doesn't cause other DIModules to be created/inserted into > ModuleRefCache) you can avoid doing two map lookups: > > auto *&ModuleRef = ModuleRefCache[Mod.Signature]; > if (ModuleRef) > return ModuleRef > ... > ModuleRef = ...; > return ModuleRef;
Thanks for the hint — while it currently isn’t recursive, I want to extend it to support submodules, which will have to create a decl context chain of all the parent modules prior to creating a submodule, so I’ll skip this optimization for now. -- adrian _______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits