[PATCH] D17792: Initialize much of AssemblyWriter lazily.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 31 17:58:13 PDT 2016


jlebar added a comment.

> Should I just stamp this patch?


If you're comfortable doing so!


================
Comment at: lib/IR/AsmWriter.cpp:461
@@ +460,3 @@
+  auto NextToUse = LazyNamedTypes->begin();
+  for (auto I = LazyNamedTypes->begin(), E = LazyNamedTypes->end(); I != E;
+       ++I) {
----------------
timshen wrote:
> Optional:
> 
>   LazyNamedTypes.erase(
>     std::remove_if(LazyNamedTypes.begin(), LazyNamedTypes.end(),
>       [&](...) { ... }),
>     LazyNamedTypes.end());
> 
> ?
> 
> I don't know if you like this half-functional style or pure imperative style.
Normally I like that, but here we're doing so much other stuff (building up LazyNumberedTypes), I think it's probably clearer as-is.


http://reviews.llvm.org/D17792





More information about the llvm-commits mailing list