- // Try not to cause collisions by minimizing chances of renaming an
- // already-external symbol, so take in external globals and functions as-is.
- // The code should work correctly without disambiguation (assuming the same
- // mangler is used by the two code generators), but having symbols with the
- // same name causes warnings to be emitted by the code generator.
- Mangler Mang(*M);
- for (Module::global_iterator I = M->global_begin(), E = M->global_end(); I != E; ++I)
- I->setName(Mang.getValueName(I));
- for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
- I->setName(Mang.getValueName(I));
+ for (Module::global_iterator I = M->global_begin(), E = M->global_end();
+ I != E; ++I) {
+ // Don't mangle asm names.
+ if (!I->hasName())
+ I->setName("anon_global");
+ }
+ for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) {
+ if (!I->hasName())
+ I->setName("anon_fn");
+ }