- if ( machoAtom.scope() >= ld::Atom::scopeLinkageUnit ) {
- CStringToAtom::iterator pos = _llvmAtoms.find(name);
- if ( pos != _llvmAtoms.end() ) {
- // turn Atom into a proxy for this mach-o atom
- pos->second->setCompiledAtom(machoAtom);
- lastProxiedAtom = &machoAtom;
- lastProxiedFile = pos->second->file();
- }
- else {
- // an atom of this name was not in the allAtoms list the linker gave us
- if ( _deadllvmAtoms.find(name) != _deadllvmAtoms.end() ) {
- // this corresponding to an atom that the linker coalesced away or marked not-live
- if ( _options.linkerDeadStripping ) {
- // llvm seems to want this atom and -dead_strip is enabled, so it will be deleted if not needed, so add back
- Atom* llvmAtom = _deadllvmAtoms[name];
- llvmAtom->setCompiledAtom(machoAtom);
- _newAtoms.push_back(&machoAtom);
- }
- else {
- // Don't pass it back as a new atom
- }
- }
- else
- {
- // this is something new that lto conjured up, tell ld its new
+ CStringToAtom::iterator pos = _llvmAtoms.find(name);
+ if ( pos != _llvmAtoms.end() ) {
+ // turn Atom into a proxy for this mach-o atom
+ pos->second->setCompiledAtom(machoAtom);
+ lastProxiedAtom = &machoAtom;
+ lastProxiedFile = pos->second->file();
+ if (log) fprintf(stderr, "AtomSyncer, mach-o atom %p synced to lto atom %p (name=%s)\n", &machoAtom, pos->second, machoAtom.name());
+ }
+ else {
+ // an atom of this name was not in the allAtoms list the linker gave us
+ if ( _deadllvmAtoms.find(name) != _deadllvmAtoms.end() ) {
+ // this corresponding to an atom that the linker coalesced away or marked not-live
+ if ( _options.linkerDeadStripping ) {
+ // llvm seems to want this atom and -dead_strip is enabled, so it will be deleted if not needed, so add back
+ Atom* llvmAtom = _deadllvmAtoms[name];
+ llvmAtom->setCompiledAtom(machoAtom);