erichkeane wrote: > > Which call in EmitGlobal is the one that calls it? I would expect that > > either of the two (not hte annotations one for obvious reasons) should be > > able to filter it THERE instead. Do we perhaps just mangle 'too early'? > > We use the mangle name as key to decide whether something was already used > haha > > ``` > StringRef MangledName = getMangledName(GD); > if (GetGlobalValue(MangledName) != nullptr) { > // The value has already been used and should therefore be emitted. > addDeferredDeclToEmit(GD); > } else if (MustBeEmitted(Global)) { > // The value must be emitted, but cannot be emitted eagerly. > assert(!MayBeEmittedEagerly(Global)); > addDeferredDeclToEmit(GD); > } else { > // Otherwise, remember that we saw a deferred decl with this name. The > // first use of the mangled name will cause it to move into > // DeferredDeclsToEmit. > DeferredDecls[MangledName] = GD; > } > ``` > > But really i don't think we should even get there from an unevaluated context
Yeah, I agree that we shouldn't get to that point on the decision. That said, I THINK the decision should be made in CodeGen, not Sema? Perhaps @efriedma-quic has comments? https://github.com/llvm/llvm-project/pull/124572 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits