diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-12-10 02:55:06 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-12-10 02:55:06 +0000 |
commit | 2d5023bbcf816de39e37d9fea6dfa8f7aadb393f (patch) | |
tree | c20ff755a7daf5926dddb5340b8c0b82b1d99913 /lib | |
parent | f3aefb56def210eb0c23ecb8f2e0bf7f4be78a37 (diff) | |
download | llvm-2d5023bbcf816de39e37d9fea6dfa8f7aadb393f.tar.gz llvm-2d5023bbcf816de39e37d9fea6dfa8f7aadb393f.tar.bz2 llvm-2d5023bbcf816de39e37d9fea6dfa8f7aadb393f.tar.xz |
More debug output formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146313 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/ARM/ARMConstantIslandPass.cpp | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/lib/Target/ARM/ARMConstantIslandPass.cpp b/lib/Target/ARM/ARMConstantIslandPass.cpp index e2dafc4184..53433354df 100644 --- a/lib/Target/ARM/ARMConstantIslandPass.cpp +++ b/lib/Target/ARM/ARMConstantIslandPass.cpp @@ -26,6 +26,7 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/Format.h" #include "llvm/Support/raw_ostream.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" @@ -317,10 +318,16 @@ void ARMConstantIslands::verify(MachineFunction &MF) { /// print block size and offset information - debugging void ARMConstantIslands::dumpBBs() { - for (unsigned J = 0, E = BBInfo.size(); J !=E; ++J) { - DEBUG(dbgs() << "block " << J << " offset " << BBInfo[J].Offset - << " size " << BBInfo[J].Size << "\n"); - } + DEBUG({ + for (unsigned J = 0, E = BBInfo.size(); J !=E; ++J) { + const BasicBlockInfo &BBI = BBInfo[J]; + dbgs() << format("%08x BB#%u\t", BBI.Offset, J) + << " kb=" << unsigned(BBI.KnownBits) + << " ua=" << unsigned(BBI.Unalign) + << " pa=" << unsigned(BBI.PostAlign) + << format(" size=%#x\n", BBInfo[J].Size); + } + }); } /// createARMConstantIslandPass - returns an instance of the constpool @@ -332,6 +339,10 @@ FunctionPass *llvm::createARMConstantIslandPass() { bool ARMConstantIslands::runOnMachineFunction(MachineFunction &MF) { MachineConstantPool &MCP = *MF.getConstantPool(); + DEBUG(dbgs() << "***** ARMConstantIslands: " + << MCP.getConstants().size() << " CP entries, aligned to " + << MCP.getConstantPoolAlignment() << " bytes *****\n"); + TII = (const ARMInstrInfo*)MF.getTarget().getInstrInfo(); AFI = MF.getInfo<ARMFunctionInfo>(); STI = &MF.getTarget().getSubtarget<ARMSubtarget>(); @@ -916,11 +927,11 @@ bool ARMConstantIslands::CPEIsInRange(MachineInstr *MI, unsigned UserOffset, const BasicBlockInfo &BBI = BBInfo[Block]; dbgs() << "User of CPE#" << CPEMI->getOperand(0).getImm() << " max delta=" << MaxDisp - << " insn address=" << UserOffset + << format(" insn address=%#x", UserOffset) << " in BB#" << Block << ": " - << BBI.Offset << " - " << BBI.postOffset() << "\t" << *MI - << "CPE address=" << CPEOffset - << " offset=" << int(CPEOffset-UserOffset) << ": "; + << format("%#x-%x\t", BBI.Offset, BBI.postOffset()) << *MI + << format("CPE address=%#x offset=%+d: ", CPEOffset, + int(CPEOffset-UserOffset)); }); } @@ -1308,7 +1319,7 @@ bool ARMConstantIslands::HandleConstantPoolUser(MachineFunction &MF, } DEBUG(dbgs() << " Moved CPE to #" << ID << " CPI=" << CPI - << '\t' << *UserMI); + << format(" offset=%#x\n", BBInfo[NewIsland->getNumber()].Offset)); return true; } |