mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-27 12:26:08 +00:00
Fixes for PR341
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14843 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -25,12 +25,11 @@
|
|||||||
|
|
||||||
#include "llvm/Analysis/FindUnsafePointerTypes.h"
|
#include "llvm/Analysis/FindUnsafePointerTypes.h"
|
||||||
#include "llvm/Assembly/CachedWriter.h"
|
#include "llvm/Assembly/CachedWriter.h"
|
||||||
#include "llvm/Type.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/Support/InstIterator.h"
|
#include "llvm/Support/InstIterator.h"
|
||||||
#include "Support/CommandLine.h"
|
#include "Support/CommandLine.h"
|
||||||
|
using namespace llvm;
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
static RegisterAnalysis<FindUnsafePointerTypes>
|
static RegisterAnalysis<FindUnsafePointerTypes>
|
||||||
X("unsafepointertypes", "Find Unsafe Pointer Types");
|
X("unsafepointertypes", "Find Unsafe Pointer Types");
|
||||||
@@ -72,7 +71,7 @@ bool FindUnsafePointerTypes::run(Module &Mod) {
|
|||||||
if (PrintFailures) {
|
if (PrintFailures) {
|
||||||
CachedWriter CW(F->getParent(), std::cerr);
|
CachedWriter CW(F->getParent(), std::cerr);
|
||||||
std::cerr << "FindUnsafePointerTypes: Type '";
|
std::cerr << "FindUnsafePointerTypes: Type '";
|
||||||
CW << ITy;
|
CW << *ITy;
|
||||||
std::cerr << "' marked unsafe in '" << F->getName() << "' by:\n";
|
std::cerr << "' marked unsafe in '" << F->getName() << "' by:\n";
|
||||||
CW << *I;
|
CW << *I;
|
||||||
}
|
}
|
||||||
@@ -101,8 +100,7 @@ void FindUnsafePointerTypes::print(std::ostream &o, const Module *M) const {
|
|||||||
E = getUnsafeTypes().end(); I != E; ++I, ++Counter) {
|
E = getUnsafeTypes().end(); I != E; ++I, ++Counter) {
|
||||||
|
|
||||||
o << " #" << Counter << ". ";
|
o << " #" << Counter << ". ";
|
||||||
CW << (Type*)*I << "\n";
|
CW << **I << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
|
||||||
|
@@ -98,9 +98,9 @@ void FindUsedTypes::print(std::ostream &o, const Module *M) const {
|
|||||||
CachedWriter CW(M, o);
|
CachedWriter CW(M, o);
|
||||||
for (std::set<const Type *>::const_iterator I = UsedTypes.begin(),
|
for (std::set<const Type *>::const_iterator I = UsedTypes.begin(),
|
||||||
E = UsedTypes.end(); I != E; ++I)
|
E = UsedTypes.end(); I != E; ++I)
|
||||||
CW << " " << *I << "\n";
|
CW << " " << **I << "\n";
|
||||||
} else
|
} else
|
||||||
for (std::set<const Type *>::const_iterator I = UsedTypes.begin(),
|
for (std::set<const Type *>::const_iterator I = UsedTypes.begin(),
|
||||||
E = UsedTypes.end(); I != E; ++I)
|
E = UsedTypes.end(); I != E; ++I)
|
||||||
o << " " << *I << "\n";
|
o << " " << **I << "\n";
|
||||||
}
|
}
|
||||||
|
@@ -41,14 +41,17 @@ void Interval::print(std::ostream &o) const {
|
|||||||
<< "Interval Contents:\n";
|
<< "Interval Contents:\n";
|
||||||
|
|
||||||
// Print out all of the basic blocks in the interval...
|
// Print out all of the basic blocks in the interval...
|
||||||
std::copy(Nodes.begin(), Nodes.end(),
|
for (std::vector<BasicBlock*>::const_iterator I = Nodes.begin(),
|
||||||
std::ostream_iterator<BasicBlock*>(o, "\n"));
|
E = Nodes.end(); I != E; ++I)
|
||||||
|
o << **I << "\n";
|
||||||
|
|
||||||
o << "Interval Predecessors:\n";
|
o << "Interval Predecessors:\n";
|
||||||
std::copy(Predecessors.begin(), Predecessors.end(),
|
for (std::vector<BasicBlock*>::const_iterator I = Predecessors.begin(),
|
||||||
std::ostream_iterator<BasicBlock*>(o, "\n"));
|
E = Predecessors.end(); I != E; ++I)
|
||||||
|
o << **I << "\n";
|
||||||
|
|
||||||
o << "Interval Successors:\n";
|
o << "Interval Successors:\n";
|
||||||
std::copy(Successors.begin(), Successors.end(),
|
for (std::vector<BasicBlock*>::const_iterator I = Successors.begin(),
|
||||||
std::ostream_iterator<BasicBlock*>(o, "\n"));
|
E = Successors.end(); I != E; ++I)
|
||||||
|
o << **I << "\n";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user