diff options
| author | Chris Lattner <sabre@nondot.org> | 2004-05-28 05:47:27 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2004-05-28 05:47:27 +0000 |
| commit | c53c2a3a625462869dd53cf0751468f092aff5a4 (patch) | |
| tree | fdbbf37b5ceb7963d12f222348e55d27f62fc1ae /llvm/lib/Target/CBackend/Writer.cpp | |
| parent | 1bb966181870ccaeeffa9fde947affe63ddf3591 (diff) | |
| download | bcm5719-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.cpp | 4 |
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; |

