Indent to 2 spaces and cleanup excess whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16188 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alkis Evlogimenos
2004-09-05 18:41:35 +00:00
parent a63828619f
commit 76d9dacceb

View File

@@ -32,7 +32,7 @@
using namespace llvm;
static AnnotationID MF_AID(
AnnotationManager::getID("CodeGen::MachineCodeForFunction"));
AnnotationManager::getID("CodeGen::MachineCodeForFunction"));
namespace {
@@ -91,19 +91,19 @@ FunctionPass *llvm::createMachineCodeDeleter() {
//===---------------------------------------------------------------------===//
MachineBasicBlock* ilist_traits<MachineBasicBlock>::createNode()
{
MachineBasicBlock* dummy = new MachineBasicBlock();
LeakDetector::removeGarbageObject(dummy);
return dummy;
MachineBasicBlock* dummy = new MachineBasicBlock();
LeakDetector::removeGarbageObject(dummy);
return dummy;
}
void ilist_traits<MachineBasicBlock>::transferNodesFromList(
iplist<MachineBasicBlock, ilist_traits<MachineBasicBlock> >& toList,
ilist_iterator<MachineBasicBlock> first,
ilist_iterator<MachineBasicBlock> last)
iplist<MachineBasicBlock, ilist_traits<MachineBasicBlock> >& toList,
ilist_iterator<MachineBasicBlock> first,
ilist_iterator<MachineBasicBlock> last)
{
if (Parent != toList.Parent)
for (; first != last; ++first)
first->Parent = toList.Parent;
if (Parent != toList.Parent)
for (; first != last; ++first)
first->Parent = toList.Parent;
}
MachineFunction::MachineFunction(const Function *F,
@@ -148,38 +148,38 @@ void MachineFunction::print(std::ostream &OS) const {
static bool CFGOnly = false;
namespace llvm {
template<>
struct DOTGraphTraits<const MachineFunction*> : public DefaultDOTGraphTraits {
static std::string getGraphName(const MachineFunction *F) {
return "CFG for '" + F->getFunction()->getName() + "' function";
}
static std::string getNodeLabel(const MachineBasicBlock *Node,
const MachineFunction *Graph) {
if (CFGOnly && Node->getBasicBlock() &&
!Node->getBasicBlock()->getName().empty())
return Node->getBasicBlock()->getName() + ":";
std::ostringstream Out;
if (CFGOnly) {
Out << Node->getNumber() << ':';
return Out.str();
template<>
struct DOTGraphTraits<const MachineFunction*> : public DefaultDOTGraphTraits {
static std::string getGraphName(const MachineFunction *F) {
return "CFG for '" + F->getFunction()->getName() + "' function";
}
Node->print(Out);
static std::string getNodeLabel(const MachineBasicBlock *Node,
const MachineFunction *Graph) {
if (CFGOnly && Node->getBasicBlock() &&
!Node->getBasicBlock()->getName().empty())
return Node->getBasicBlock()->getName() + ":";
std::string OutStr = Out.str();
if (OutStr[0] == '\n') OutStr.erase(OutStr.begin());
// Process string output to make it nicer...
for (unsigned i = 0; i != OutStr.length(); ++i)
if (OutStr[i] == '\n') { // Left justify
OutStr[i] = '\\';
OutStr.insert(OutStr.begin()+i+1, 'l');
std::ostringstream Out;
if (CFGOnly) {
Out << Node->getNumber() << ':';
return Out.str();
}
return OutStr;
}
};
Node->print(Out);
std::string OutStr = Out.str();
if (OutStr[0] == '\n') OutStr.erase(OutStr.begin());
// Process string output to make it nicer...
for (unsigned i = 0; i != OutStr.length(); ++i)
if (OutStr[i] == '\n') { // Left justify
OutStr[i] = '\\';
OutStr.insert(OutStr.begin()+i+1, 'l');
}
return OutStr;
}
};
}
void MachineFunction::viewCFG() const
@@ -277,9 +277,9 @@ void MachineFrameInfo::print(const MachineFunction &MF, std::ostream &OS) const{
int Off = SO.SPOffset - ValOffset;
OS << " at location [SP";
if (Off > 0)
OS << "+" << Off;
OS << "+" << Off;
else if (Off < 0)
OS << Off;
OS << Off;
OS << "]";
}
OS << "\n";
@@ -304,4 +304,3 @@ void MachineConstantPool::print(std::ostream &OS) const {
}
void MachineConstantPool::dump() const { print(std::cerr); }