mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
shoot a few more std::ostream print methods in the head.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79814 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -24,7 +24,6 @@
|
|||||||
#include "llvm/ADT/SmallVector.h"
|
#include "llvm/ADT/SmallVector.h"
|
||||||
#include "llvm/Support/Allocator.h"
|
#include "llvm/Support/Allocator.h"
|
||||||
#include "llvm/Support/AlignOf.h"
|
#include "llvm/Support/AlignOf.h"
|
||||||
#include <iosfwd>
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <climits>
|
#include <climits>
|
||||||
|
|
||||||
@ -49,7 +48,6 @@ namespace llvm {
|
|||||||
/// index of the MBB in which the PHI originally existed. This can be used
|
/// index of the MBB in which the PHI originally existed. This can be used
|
||||||
/// to insert code (spills or copies) which deals with the value, which will
|
/// to insert code (spills or copies) which deals with the value, which will
|
||||||
/// be live in to the block.
|
/// be live in to the block.
|
||||||
|
|
||||||
class VNInfo {
|
class VNInfo {
|
||||||
private:
|
private:
|
||||||
enum {
|
enum {
|
||||||
@ -183,7 +181,7 @@ namespace llvm {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline bool operator<(const VNInfo::KillInfo &k1, const VNInfo::KillInfo &k2) {
|
inline bool operator<(const VNInfo::KillInfo &k1, const VNInfo::KillInfo &k2){
|
||||||
return k1.killIdx < k2.killIdx;
|
return k1.killIdx < k2.killIdx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,16 +219,12 @@ namespace llvm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void dump() const;
|
void dump() const;
|
||||||
void print(std::ostream &os) const;
|
|
||||||
void print(std::ostream *os) const { if (os) print(*os); }
|
|
||||||
void print(raw_ostream &os) const;
|
void print(raw_ostream &os) const;
|
||||||
void print(raw_ostream *os) const { if (os) print(*os); }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LiveRange(); // DO NOT IMPLEMENT
|
LiveRange(); // DO NOT IMPLEMENT
|
||||||
};
|
};
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream& os, const LiveRange &LR);
|
|
||||||
raw_ostream& operator<<(raw_ostream& os, const LiveRange &LR);
|
raw_ostream& operator<<(raw_ostream& os, const LiveRange &LR);
|
||||||
|
|
||||||
|
|
||||||
@ -351,7 +345,7 @@ namespace llvm {
|
|||||||
/// getNextValue - Create a new value number and return it. MIIdx specifies
|
/// getNextValue - Create a new value number and return it. MIIdx specifies
|
||||||
/// the instruction that defines the value number.
|
/// the instruction that defines the value number.
|
||||||
VNInfo *getNextValue(unsigned MIIdx, MachineInstr *CopyMI,
|
VNInfo *getNextValue(unsigned MIIdx, MachineInstr *CopyMI,
|
||||||
bool isDefAccurate, BumpPtrAllocator &VNInfoAllocator) {
|
bool isDefAccurate, BumpPtrAllocator &VNInfoAllocator){
|
||||||
|
|
||||||
assert(MIIdx != ~0u && MIIdx != ~1u &&
|
assert(MIIdx != ~0u && MIIdx != ~1u &&
|
||||||
"PHI def / unused flags should now be passed explicitly.");
|
"PHI def / unused flags should now be passed explicitly.");
|
||||||
@ -366,7 +360,8 @@ namespace llvm {
|
|||||||
|
|
||||||
/// Create a copy of the given value. The new value will be identical except
|
/// Create a copy of the given value. The new value will be identical except
|
||||||
/// for the Value number.
|
/// for the Value number.
|
||||||
VNInfo *createValueCopy(const VNInfo *orig, BumpPtrAllocator &VNInfoAllocator) {
|
VNInfo *createValueCopy(const VNInfo *orig,
|
||||||
|
BumpPtrAllocator &VNInfoAllocator) {
|
||||||
|
|
||||||
VNInfo *VNI =
|
VNInfo *VNI =
|
||||||
static_cast<VNInfo*>(VNInfoAllocator.Allocate((unsigned)sizeof(VNInfo),
|
static_cast<VNInfo*>(VNInfoAllocator.Allocate((unsigned)sizeof(VNInfo),
|
||||||
@ -605,14 +600,7 @@ namespace llvm {
|
|||||||
return beginNumber() < other.beginNumber();
|
return beginNumber() < other.beginNumber();
|
||||||
}
|
}
|
||||||
|
|
||||||
void print(std::ostream &OS, const TargetRegisterInfo *TRI = 0) const;
|
|
||||||
void print(std::ostream *OS, const TargetRegisterInfo *TRI = 0) const {
|
|
||||||
if (OS) print(*OS, TRI);
|
|
||||||
}
|
|
||||||
void print(raw_ostream &OS, const TargetRegisterInfo *TRI = 0) const;
|
void print(raw_ostream &OS, const TargetRegisterInfo *TRI = 0) const;
|
||||||
void print(raw_ostream *OS, const TargetRegisterInfo *TRI = 0) const {
|
|
||||||
if (OS) print(*OS, TRI);
|
|
||||||
}
|
|
||||||
void dump() const;
|
void dump() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -624,10 +612,6 @@ namespace llvm {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline std::ostream &operator<<(std::ostream &OS, const LiveInterval &LI) {
|
|
||||||
LI.print(OS);
|
|
||||||
return OS;
|
|
||||||
}
|
|
||||||
inline raw_ostream &operator<<(raw_ostream &OS, const LiveInterval &LI) {
|
inline raw_ostream &operator<<(raw_ostream &OS, const LiveInterval &LI) {
|
||||||
LI.print(OS);
|
LI.print(OS);
|
||||||
return OS;
|
return OS;
|
||||||
|
@ -348,9 +348,6 @@ namespace llvm {
|
|||||||
|
|
||||||
/// print - Implement the dump method.
|
/// print - Implement the dump method.
|
||||||
virtual void print(std::ostream &O, const Module* = 0) const;
|
virtual void print(std::ostream &O, const Module* = 0) const;
|
||||||
void print(std::ostream *O, const Module* M = 0) const {
|
|
||||||
if (O) print(*O, M);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// addIntervalsForSpills - Create new intervals for spilled defs / uses of
|
/// addIntervalsForSpills - Create new intervals for spilled defs / uses of
|
||||||
/// the given interval. FIXME: It also returns the weight of the spill slot
|
/// the given interval. FIXME: It also returns the weight of the spill slot
|
||||||
|
@ -103,9 +103,6 @@ namespace llvm {
|
|||||||
|
|
||||||
/// print - Implement the dump method.
|
/// print - Implement the dump method.
|
||||||
virtual void print(std::ostream &O, const Module* = 0) const;
|
virtual void print(std::ostream &O, const Module* = 0) const;
|
||||||
void print(std::ostream *O, const Module* M = 0) const {
|
|
||||||
if (O) print(*O, M);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include "llvm/ADT/SmallSet.h"
|
#include "llvm/ADT/SmallSet.h"
|
||||||
#include "llvm/ADT/STLExtras.h"
|
#include "llvm/ADT/STLExtras.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
|
||||||
#include "llvm/Target/TargetRegisterInfo.h"
|
#include "llvm/Target/TargetRegisterInfo.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
@ -816,9 +815,6 @@ void LiveInterval::ComputeJoinedWeight(const LiveInterval &Other) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream& llvm::operator<<(std::ostream& os, const LiveRange &LR) {
|
|
||||||
return os << '[' << LR.start << ',' << LR.end << ':' << LR.valno->id << ")";
|
|
||||||
}
|
|
||||||
raw_ostream& llvm::operator<<(raw_ostream& os, const LiveRange &LR) {
|
raw_ostream& llvm::operator<<(raw_ostream& os, const LiveRange &LR) {
|
||||||
return os << '[' << LR.start << ',' << LR.end << ':' << LR.valno->id << ")";
|
return os << '[' << LR.start << ',' << LR.end << ':' << LR.valno->id << ")";
|
||||||
}
|
}
|
||||||
@ -827,14 +823,7 @@ void LiveRange::dump() const {
|
|||||||
errs() << *this << "\n";
|
errs() << *this << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void LiveInterval::print(std::ostream &OS,
|
void LiveInterval::print(raw_ostream &OS, const TargetRegisterInfo *TRI) const {
|
||||||
const TargetRegisterInfo *TRI) const {
|
|
||||||
raw_os_ostream RawOS(OS);
|
|
||||||
print(RawOS, TRI);
|
|
||||||
}
|
|
||||||
|
|
||||||
void LiveInterval::print(raw_ostream &OS,
|
|
||||||
const TargetRegisterInfo *TRI) const {
|
|
||||||
if (isStackSlot())
|
if (isStackSlot())
|
||||||
OS << "SS#" << getStackSlotIndex();
|
OS << "SS#" << getStackSlotIndex();
|
||||||
else if (TRI && TargetRegisterInfo::isPhysicalRegister(reg))
|
else if (TRI && TargetRegisterInfo::isPhysicalRegister(reg))
|
||||||
@ -896,9 +885,6 @@ void LiveInterval::dump() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LiveRange::print(std::ostream &os) const {
|
|
||||||
os << *this;
|
|
||||||
}
|
|
||||||
void LiveRange::print(raw_ostream &os) const {
|
void LiveRange::print(raw_ostream &os) const {
|
||||||
os << *this;
|
os << *this;
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "llvm/CodeGen/Passes.h"
|
#include "llvm/CodeGen/Passes.h"
|
||||||
#include "llvm/Target/TargetRegisterInfo.h"
|
#include "llvm/Target/TargetRegisterInfo.h"
|
||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
|
#include "llvm/Support/raw_ostream.h"
|
||||||
#include "llvm/ADT/Statistic.h"
|
#include "llvm/ADT/Statistic.h"
|
||||||
#include <limits>
|
#include <limits>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
@ -53,14 +54,16 @@ bool LiveStacks::runOnMachineFunction(MachineFunction &) {
|
|||||||
|
|
||||||
/// print - Implement the dump method.
|
/// print - Implement the dump method.
|
||||||
void LiveStacks::print(std::ostream &O, const Module*) const {
|
void LiveStacks::print(std::ostream &O, const Module*) const {
|
||||||
O << "********** INTERVALS **********\n";
|
raw_os_ostream OS(O);
|
||||||
|
|
||||||
|
OS << "********** INTERVALS **********\n";
|
||||||
for (const_iterator I = begin(), E = end(); I != E; ++I) {
|
for (const_iterator I = begin(), E = end(); I != E; ++I) {
|
||||||
I->second.print(O);
|
I->second.print(OS);
|
||||||
int Slot = I->first;
|
int Slot = I->first;
|
||||||
const TargetRegisterClass *RC = getIntervalRegClass(Slot);
|
const TargetRegisterClass *RC = getIntervalRegClass(Slot);
|
||||||
if (RC)
|
if (RC)
|
||||||
O << " [" << RC->getName() << "]\n";
|
OS << " [" << RC->getName() << "]\n";
|
||||||
else
|
else
|
||||||
O << " [Unknown]\n";
|
OS << " [Unknown]\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user