summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/CBackend/Writer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-05-28 05:47:27 +0000
committerChris Lattner <sabre@nondot.org>2004-05-28 05:47:27 +0000
commitc53c2a3a625462869dd53cf0751468f092aff5a4 (patch)
treefdbbf37b5ceb7963d12f222348e55d27f62fc1ae /llvm/lib/Target/CBackend/Writer.cpp
parent1bb966181870ccaeeffa9fde947affe63ddf3591 (diff)
downloadbcm5719-llvm-c53c2a3a625462869dd53cf0751468f092aff5a4.tar.gz
bcm5719-llvm-c53c2a3a625462869dd53cf0751468f092aff5a4.zip
Fix the big regression that has been killing the nightly tester these last
few days. Apparently the old symbol table used to auto rename collisions in the type symbol table and the new one does not. It doesn't really make sense for the new one to do so, so we just make the client do it. llvm-svn: 13877
Diffstat (limited to 'llvm/lib/Target/CBackend/Writer.cpp')
-rw-r--r--llvm/lib/Target/CBackend/Writer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/CBackend/Writer.cpp b/llvm/lib/Target/CBackend/Writer.cpp
index 4284dcc8c0d..b73a4e40cd8 100644
--- a/llvm/lib/Target/CBackend/Writer.cpp
+++ b/llvm/lib/Target/CBackend/Writer.cpp
@@ -236,10 +236,12 @@ bool CBackendNameAllUsedStructs::run(Module &M) {
// structure types.
//
bool Changed = false;
+ unsigned RenameCounter = 0;
for (std::set<const Type *>::const_iterator I = UT.begin(), E = UT.end();
I != E; ++I)
if (const StructType *ST = dyn_cast<StructType>(*I)) {
- const_cast<StructType*>(ST)->setName("unnamed", &MST);
+ while (M.addTypeName("unnamed"+utostr(RenameCounter), ST))
+ ++RenameCounter;
Changed = true;
}
return Changed;
OpenPOWER on IntegriCloud