From 7fc9fe34390c66ca58646d09a87f7dbaacb6c1f8 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 27 Jun 2001 23:41:11 +0000 Subject: Miscellaneous cleanups: * Convert post to pre-increment for for loops * Use generic programming more * Use new Value::cast* instructions * Use new Module, Method, & BasicBlock forwarding methods * Use new facilities in STLExtras.h * Use new Instruction::isPHINode() method git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/ConstantPool.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'lib/VMCore/ConstantPool.cpp') diff --git a/lib/VMCore/ConstantPool.cpp b/lib/VMCore/ConstantPool.cpp index d624c8dad0..77ed50ae26 100644 --- a/lib/VMCore/ConstantPool.cpp +++ b/lib/VMCore/ConstantPool.cpp @@ -85,9 +85,8 @@ void ConstantPool::delete_all() { void ConstantPool::dropAllReferences() { for (unsigned i = 0; i < Planes.size(); i++) - for (PlaneType::iterator I = Planes[i]->begin(); - I != Planes[i]->end(); I++) - (*I)->dropAllReferences(); + for_each(Planes[i]->begin(), Planes[i]->end(), + mem_fun(&ConstPoolVal::dropAllReferences)); } struct EqualsConstant { @@ -280,10 +279,7 @@ ConstPoolStruct::ConstPoolStruct(const ConstPoolStruct &CPS) // getStrValue implementations string ConstPoolBool::getStrValue() const { - if (Val) - return "true"; - else - return "false"; + return Val ? "true" : "false"; } string ConstPoolSInt::getStrValue() const { -- cgit v1.2.3-18-g5258