llvm.org GIT mirror llvm / 1ff1ff7
Fixes for PR341 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14843 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 16 years ago
3 changed file(s) with 16 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
2424
2525 #include "llvm/Analysis/FindUnsafePointerTypes.h"
2626 #include "llvm/Assembly/CachedWriter.h"
27 #include "llvm/Type.h"
27 #include "llvm/DerivedTypes.h"
2828 #include "llvm/Module.h"
2929 #include "llvm/Support/InstIterator.h"
3030 #include "Support/CommandLine.h"
31
32 namespace llvm {
31 using namespace llvm;
3332
3433 static RegisterAnalysis
3534 X("unsafepointertypes", "Find Unsafe Pointer Types");
7170 if (PrintFailures) {
7271 CachedWriter CW(F->getParent(), std::cerr);
7372 std::cerr << "FindUnsafePointerTypes: Type '";
74 CW << ITy;
73 CW << *ITy;
7574 std::cerr << "' marked unsafe in '" << F->getName() << "' by:\n";
7675 CW << *I;
7776 }
10099 E = getUnsafeTypes().end(); I != E; ++I, ++Counter) {
101100
102101 o << " #" << Counter << ". ";
103 CW << (Type*)*I << "\n";
102 CW << **I << "\n";
104103 }
105104 }
106105
107 } // End llvm namespace
9797 CachedWriter CW(M, o);
9898 for (std::set::const_iterator I = UsedTypes.begin(),
9999 E = UsedTypes.end(); I != E; ++I)
100 CW << " " << *I << "\n";
100 CW << " " << **I << "\n";
101101 } else
102102 for (std::set::const_iterator I = UsedTypes.begin(),
103103 E = UsedTypes.end(); I != E; ++I)
104 o << " " << *I << "\n";
104 o << " " << **I << "\n";
105105 }
4040 << "Interval Contents:\n";
4141
4242 // Print out all of the basic blocks in the interval...
43 std::copy(Nodes.begin(), Nodes.end(),
44 std::ostream_iterator(o, "\n"));
43 for (std::vector::const_iterator I = Nodes.begin(),
44 E = Nodes.end(); I != E; ++I)
45 o << **I << "\n";
4546
4647 o << "Interval Predecessors:\n";
47 std::copy(Predecessors.begin(), Predecessors.end(),
48 std::ostream_iterator(o, "\n"));
49
48 for (std::vector::const_iterator I = Predecessors.begin(),
49 E = Predecessors.end(); I != E; ++I)
50 o << **I << "\n";
51
5052 o << "Interval Successors:\n";
51 std::copy(Successors.begin(), Successors.end(),
52 std::ostream_iterator(o, "\n"));
53 for (std::vector::const_iterator I = Successors.begin(),
54 E = Successors.end(); I != E; ++I)
55 o << **I << "\n";
5356 }