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 | 9d1af97d02e9a0b985e940e950ed659b812c5f3f (patch) | |
tree | e864de3517a7e6f8922e5bf207670449853353ef /lib/Target/CBackend/CBackend.cpp | |
parent | c3fcaea8ac146984a0f4f5986764cb264d91d221 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13877 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/CBackend/CBackend.cpp')
-rw-r--r-- | lib/Target/CBackend/CBackend.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 4284dcc8c0..b73a4e40cd 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.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; |