[llvm-commits] CVS: llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp FindUsedTypes.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Apr 27 10:13:06 PDT 2004


Changes in directory llvm/lib/Analysis/IPA:

FindUnsafePointerTypes.cpp updated: 1.21 -> 1.22
FindUsedTypes.cpp updated: 1.24 -> 1.25

---
Log message:

Changes to fix up the inst_iterator to pass to boost iterator checks.  This 
patch was graciously contributed by Vladimir Prus.



---
Diffs of the changes:  (+6 -6)

Index: llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp
diff -u llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp:1.21 llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp:1.22
--- llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp:1.21	Tue Nov 11 16:41:32 2003
+++ llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp	Tue Apr 27 10:12:48 2004
@@ -42,8 +42,8 @@
 PrintFailures("printunsafeptrinst", cl::Hidden,
               cl::desc("Print Unsafe Pointer Access Instructions"));
 
-static inline bool isSafeInstruction(const Instruction *I) {
-  switch (I->getOpcode()) {
+static inline bool isSafeInstruction(const Instruction &I) {
+  switch (I.getOpcode()) {
   case Instruction::Alloca:
   case Instruction::Malloc:
   case Instruction::Free:
@@ -72,7 +72,7 @@
           if (PrintFailures) {
             CachedWriter CW(F->getParent(), std::cerr);
             CW << "FindUnsafePointerTypes: Type '" << ITy
-               << "' marked unsafe in '" << F->getName() << "' by:\n" << **I;
+               << "' marked unsafe in '" << F->getName() << "' by:\n" << *I;
           }
         }
     }


Index: llvm/lib/Analysis/IPA/FindUsedTypes.cpp
diff -u llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.24 llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.25
--- llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.24	Tue Nov 11 16:41:32 2003
+++ llvm/lib/Analysis/IPA/FindUsedTypes.cpp	Tue Apr 27 10:12:48 2004
@@ -79,11 +79,11 @@
     //
     for (const_inst_iterator II = inst_begin(F), IE = inst_end(F);
          II != IE; ++II) {
-      const Instruction *I = *II;
-      const Type *Ty = I->getType();
+      const Instruction &I = *II;
+      const Type *Ty = I.getType();
     
       IncorporateType(Ty);  // Incorporate the type of the instruction
-      for (User::const_op_iterator OI = I->op_begin(), OE = I->op_end();
+      for (User::const_op_iterator OI = I.op_begin(), OE = I.op_end();
            OI != OE; ++OI)
         IncorporateValue(*OI);  // Insert inst operand types as well
     }





More information about the llvm-commits mailing list