From d06a5493841d5c49dccdd97be5dd93762dc345f1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 28 May 2004 05:30:51 +0000 Subject: [PATCH] Minor changes. Switch to a SymbolTable remove that does not take linear time git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13874 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/CBackend/CBackend.cpp | 4 ++-- lib/Target/CBackend/Writer.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 491b3484119..4284dcc8c0d 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -226,7 +226,7 @@ bool CBackendNameAllUsedStructs::run(Module &M) { // If this is not used, remove it from the symbol table. std::set::iterator UTI = UT.find(STy); if (UTI == UT.end()) - MST.remove(I->first, (Type*)I->second); + MST.remove(I); else UT.erase(UTI); } @@ -239,7 +239,7 @@ bool CBackendNameAllUsedStructs::run(Module &M) { for (std::set::const_iterator I = UT.begin(), E = UT.end(); I != E; ++I) if (const StructType *ST = dyn_cast(*I)) { - ((Value*)ST)->setName("unnamed", &MST); + const_cast(ST)->setName("unnamed", &MST); Changed = true; } return Changed; diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp index 491b3484119..4284dcc8c0d 100644 --- a/lib/Target/CBackend/Writer.cpp +++ b/lib/Target/CBackend/Writer.cpp @@ -226,7 +226,7 @@ bool CBackendNameAllUsedStructs::run(Module &M) { // If this is not used, remove it from the symbol table. std::set::iterator UTI = UT.find(STy); if (UTI == UT.end()) - MST.remove(I->first, (Type*)I->second); + MST.remove(I); else UT.erase(UTI); } @@ -239,7 +239,7 @@ bool CBackendNameAllUsedStructs::run(Module &M) { for (std::set::const_iterator I = UT.begin(), E = UT.end(); I != E; ++I) if (const StructType *ST = dyn_cast(*I)) { - ((Value*)ST)->setName("unnamed", &MST); + const_cast(ST)->setName("unnamed", &MST); Changed = true; } return Changed;