[lld] [lld][WebAssembly] Reset context object after each link (PR #78770)

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 12:16:57 PST 2024


sbc100 wrote:

> > > I wonder if we can replace these elaborate `reset()` methods with a placement new in the static data location? Would seems less error prone.
> > 
> > 
> > Or just `ctx = Ctx();` ?
> 
> Yeah, I'm guessing there was some reason the original author didn't take that much simpler approach. I'll go with the same method for now for consistency and we can perhaps followup with a simplification.

@MaskRay what would you think of such a simplification here?   Maybe it would result in a little more allocator churn.. but that doesn't seem like a big concern if it only happens between lldMain operations (i.e. infrequently) 

https://github.com/llvm/llvm-project/pull/78770


More information about the llvm-commits mailing list