[llvm-commits] [llvm] r53474 - in /llvm/trunk: include/llvm/Analysis/LoopInfo.h lib/Analysis/LoadValueNumbering.cpp lib/Support/Timer.cpp lib/Transforms/IPO/GlobalDCE.cpp lib/VMCore/Constants.cpp lib/VMCore/Type.cpp
Dan Gohman
gohman at apple.com
Fri Jul 11 13:58:19 PDT 2008
Author: djg
Date: Fri Jul 11 15:58:19 2008
New Revision: 53474
URL: http://llvm.org/viewvc/llvm-project?rev=53474&view=rev
Log:
Use find instead of lower_bound.
Modified:
llvm/trunk/include/llvm/Analysis/LoopInfo.h
llvm/trunk/lib/Analysis/LoadValueNumbering.cpp
llvm/trunk/lib/Support/Timer.cpp
llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp
llvm/trunk/lib/VMCore/Constants.cpp
llvm/trunk/lib/VMCore/Type.cpp
Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=53474&r1=53473&r2=53474&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Fri Jul 11 15:58:19 2008
@@ -823,8 +823,8 @@
for (typename std::vector<BlockT*>::iterator I = L->Blocks.begin(),
E = L->Blocks.end(); I != E; ++I) {
typename std::map<BlockT*, LoopBase<BlockT>*>::iterator BBMI =
- BBMap.lower_bound(*I);
- if (BBMI == BBMap.end() || BBMI->first != *I) // Not in map yet...
+ BBMap.find(*I);
+ if (BBMI == BBMap.end()) // Not in map yet...
BBMap.insert(BBMI, std::make_pair(*I, L)); // Must be at this level
}
Modified: llvm/trunk/lib/Analysis/LoadValueNumbering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoadValueNumbering.cpp?rev=53474&r1=53473&r2=53474&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LoadValueNumbering.cpp (original)
+++ llvm/trunk/lib/Analysis/LoadValueNumbering.cpp Fri Jul 11 15:58:19 2008
@@ -117,9 +117,9 @@
// Check whether this block is known transparent or not.
std::map<BasicBlock*, bool>::iterator TBI =
- TransparentBlocks.lower_bound(CurBlock);
+ TransparentBlocks.find(CurBlock);
- if (TBI == TransparentBlocks.end() || TBI->first != CurBlock) {
+ if (TBI == TransparentBlocks.end()) {
// If this basic block can modify the memory location, then the path is not
// transparent!
if (AA.canBasicBlockModify(*CurBlock, Ptr, Size)) {
Modified: llvm/trunk/lib/Support/Timer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Timer.cpp?rev=53474&r1=53473&r2=53474&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Timer.cpp (original)
+++ llvm/trunk/lib/Support/Timer.cpp Fri Jul 11 15:58:19 2008
@@ -185,8 +185,8 @@
static ManagedStatic<std::map<std::string, Timer> > NamedTimers;
static Timer &getNamedRegionTimer(const std::string &Name) {
- std::map<std::string, Timer>::iterator I = NamedTimers->lower_bound(Name);
- if (I != NamedTimers->end() && I->first == Name)
+ std::map<std::string, Timer>::iterator I = NamedTimers->find(Name);
+ if (I != NamedTimers->end())
return I->second;
return NamedTimers->insert(I, std::make_pair(Name, Timer(Name)))->second;
Modified: llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp?rev=53474&r1=53473&r2=53474&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp Fri Jul 11 15:58:19 2008
@@ -134,10 +134,10 @@
/// MarkGlobalIsNeeded - the specific global value as needed, and
/// recursively mark anything that it uses as also needed.
void GlobalDCE::GlobalIsNeeded(GlobalValue *G) {
- std::set<GlobalValue*>::iterator I = AliveGlobals.lower_bound(G);
+ std::set<GlobalValue*>::iterator I = AliveGlobals.find(G);
// If the global is already in the set, no need to reprocess it.
- if (I != AliveGlobals.end() && *I == G) return;
+ if (I != AliveGlobals.end()) return;
// Otherwise insert it now, so we do not infinitely recurse
AliveGlobals.insert(I, G);
Modified: llvm/trunk/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=53474&r1=53473&r2=53474&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Constants.cpp (original)
+++ llvm/trunk/lib/VMCore/Constants.cpp Fri Jul 11 15:58:19 2008
@@ -1100,9 +1100,9 @@
/// necessary.
ConstantClass *getOrCreate(const TypeClass *Ty, const ValType &V) {
MapKey Lookup(Ty, V);
- typename MapTy::iterator I = Map.lower_bound(Lookup);
+ typename MapTy::iterator I = Map.find(Lookup);
// Is it in the map?
- if (I != Map.end() && I->first == Lookup)
+ if (I != Map.end())
return static_cast<ConstantClass *>(I->second);
// If no preexisting value, create one now...
@@ -1119,10 +1119,9 @@
// If the type of the constant is abstract, make sure that an entry exists
// for it in the AbstractTypeMap.
if (Ty->isAbstract()) {
- typename AbstractTypeMapTy::iterator TI =
- AbstractTypeMap.lower_bound(Ty);
+ typename AbstractTypeMapTy::iterator TI = AbstractTypeMap.find(Ty);
- if (TI == AbstractTypeMap.end() || TI->first != Ty) {
+ if (TI == AbstractTypeMap.end()) {
// Add ourselves to the ATU list of the type.
cast<DerivedType>(Ty)->addAbstractTypeUser(this);
Modified: llvm/trunk/lib/VMCore/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Type.cpp?rev=53474&r1=53473&r2=53474&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Type.cpp (original)
+++ llvm/trunk/lib/VMCore/Type.cpp Fri Jul 11 15:58:19 2008
@@ -251,8 +251,8 @@
std::vector<const Type *> &TypeStack) {
if (isa<OpaqueType>(Ty)) { // Base case for the recursion
std::map<const Type*, std::string>::iterator I =
- AbstractTypeDescriptions->lower_bound(Ty);
- if (I != AbstractTypeDescriptions->end() && I->first == Ty)
+ AbstractTypeDescriptions->find(Ty);
+ if (I != AbstractTypeDescriptions->end())
return I->second;
std::string Desc = "opaque";
AbstractTypeDescriptions->insert(std::make_pair(Ty, Desc));
@@ -655,8 +655,8 @@
if (isa<OpaqueType>(Ty))
return false; // Two unequal opaque types are never equal
- std::map<const Type*, const Type*>::iterator It = EqTypes.lower_bound(Ty);
- if (It != EqTypes.end() && It->first == Ty)
+ std::map<const Type*, const Type*>::iterator It = EqTypes.find(Ty);
+ if (It != EqTypes.end())
return It->second == Ty2; // Looping back on a type, check for equality
// Otherwise, add the mapping to the table to make sure we don't get
More information about the llvm-commits
mailing list