#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Passes.h"
+#include "llvm/Analysis/DebugInfo.h"
+#include "llvm/Support/Debug.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetMachine.h"
}
void MachineFunction::dump() const {
- print(errs());
+ print(dbgs());
}
void MachineFunction::print(raw_ostream &OS) const {
if (I->second)
OS << " in reg%" << I->second;
- if (next(I) != E)
+ if (llvm::next(I) != E)
OS << ", ";
}
OS << '\n';
else
OS << "%physreg" << *I;
- if (next(I) != E)
+ if (llvm::next(I) != E)
OS << " ";
}
OS << '\n';
namespace llvm {
template<>
struct DOTGraphTraits<const MachineFunction*> : public DefaultDOTGraphTraits {
+
+ DOTGraphTraits (bool isSimple=false) : DefaultDOTGraphTraits(isSimple) {}
+
static std::string getGraphName(const MachineFunction *F) {
return "CFG for '" + F->getFunction()->getNameStr() + "' function";
}
- static std::string getNodeLabel(const MachineBasicBlock *Node,
- const MachineFunction *Graph,
- bool ShortNames) {
- if (ShortNames && Node->getBasicBlock() &&
+ std::string getNodeLabel(const MachineBasicBlock *Node,
+ const MachineFunction *Graph) {
+ if (isSimple () && Node->getBasicBlock() &&
!Node->getBasicBlock()->getName().empty())
return Node->getBasicBlock()->getNameStr() + ":";
{
raw_string_ostream OSS(OutStr);
- if (ShortNames)
+ if (isSimple())
OSS << Node->getNumber() << ':';
else
Node->print(OSS);
return VReg;
}
-/// getDebugLocTuple - Get the DebugLocTuple for a given DebugLoc object.
-DebugLocTuple MachineFunction::getDebugLocTuple(DebugLoc DL) const {
+/// getDILocation - Get the DILocation for a given DebugLoc object.
+DILocation MachineFunction::getDILocation(DebugLoc DL) const {
unsigned Idx = DL.getIndex();
assert(Idx < DebugLocInfo.DebugLocations.size() &&
"Invalid index into debug locations!");
- return DebugLocInfo.DebugLocations[Idx];
+ return DILocation(DebugLocInfo.DebugLocations[Idx]);
}
//===----------------------------------------------------------------------===//
}
void MachineFrameInfo::dump(const MachineFunction &MF) const {
- print(MF, errs());
+ print(MF, dbgs());
}
//===----------------------------------------------------------------------===//
OS << '\n';
}
-void MachineJumpTableInfo::dump() const { print(errs()); }
+void MachineJumpTableInfo::dump() const { print(dbgs()); }
//===----------------------------------------------------------------------===//
}
}
-void MachineConstantPool::dump() const { print(errs()); }
+void MachineConstantPool::dump() const { print(dbgs()); }