summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Reader/Analyzer.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-07-05 00:57:50 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-07-05 00:57:50 +0000
commit02b6708e014e8d9f5b703df1a22d05843e8b1c1a (patch)
tree3af8d0112e06b104b35eae6ec7c6a01106b43088 /llvm/lib/Bytecode/Reader/Analyzer.cpp
parent21b3a5b0de49bf9fdb8c3e8a74c21b59db875ee4 (diff)
downloadbcm5719-llvm-02b6708e014e8d9f5b703df1a22d05843e8b1c1a.tar.gz
bcm5719-llvm-02b6708e014e8d9f5b703df1a22d05843e8b1c1a.zip
Finalize bytecode dumping. The "handleFinish" method was getting called
too soon so the function data was not getting dumped (it was generated after the call handleFinish). Also cleaned up the output format for proper indentation. llvm-svn: 14627
Diffstat (limited to 'llvm/lib/Bytecode/Reader/Analyzer.cpp')
-rw-r--r--llvm/lib/Bytecode/Reader/Analyzer.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/llvm/lib/Bytecode/Reader/Analyzer.cpp b/llvm/lib/Bytecode/Reader/Analyzer.cpp
index 1f29b2242da..6defe27b010 100644
--- a/llvm/lib/Bytecode/Reader/Analyzer.cpp
+++ b/llvm/lib/Bytecode/Reader/Analyzer.cpp
@@ -185,9 +185,9 @@ public:
}
virtual void handleGlobalInitializer(GlobalVariable* GV, Constant* CV) {
- dump << " Initializer: GV=";
+ dump << " Initializer: GV=";
GV->print(dump);
- dump << " CV=";
+ dump << " CV=";
CV->print(dump);
dump << "\n";
}
@@ -204,17 +204,17 @@ public:
}
virtual void handleCompactionTableBegin() {
- dump << " BLOCK: CompactionTable {\n";
+ dump << " BLOCK: CompactionTable {\n";
}
virtual void handleCompactionTablePlane( unsigned Ty, unsigned NumEntries) {
bca.numCmpctnTables++;
- dump << " Plane: Ty=" << Ty << " Size=" << NumEntries << "\n";
+ dump << " Plane: Ty=" << Ty << " Size=" << NumEntries << "\n";
}
virtual void handleCompactionTableType( unsigned i, unsigned TypSlot,
const Type* Ty ) {
- dump << " Type: " << i << " Slot:" << TypSlot
+ dump << " Type: " << i << " Slot:" << TypSlot
<< " is " << Ty->getDescription() << "\n";
}
@@ -223,13 +223,13 @@ public:
unsigned TypSlot,
unsigned ValSlot,
const Type* Ty ) {
- dump << " Value: " << i << " TypSlot: " << TypSlot
+ dump << " Value: " << i << " TypSlot: " << TypSlot
<< " ValSlot:" << ValSlot << " is " << Ty->getDescription()
<< "\n";
}
virtual void handleCompactionTableEnd() {
- dump << " } END BLOCK: CompactionTable\n";
+ dump << " } END BLOCK: CompactionTable\n";
}
virtual void handleSymbolTableBegin(Function* CF, SymbolTable* ST) {
@@ -260,9 +260,9 @@ public:
}
virtual void handleFunctionBegin(Function* Func, unsigned Size) {
- dump << "BLOCK: Function {\n";
- dump << " Linkage: " << Func->getLinkage() << "\n";
- dump << " Type: " << Func->getType()->getDescription() << "\n";
+ dump << " BLOCK: Function {\n";
+ dump << " Linkage: " << Func->getLinkage() << "\n";
+ dump << " Type: " << Func->getType()->getDescription() << "\n";
const FunctionType* FType =
cast<FunctionType>(Func->getType()->getElementType());
currFunc = &bca.FunctionInfo[Func];
@@ -284,7 +284,7 @@ public:
}
virtual void handleFunctionEnd( Function* Func) {
- dump << "} END BLOCK: Function\n";
+ dump << " } END BLOCK: Function\n";
currFunc->density = double(currFunc->byteSize) /
double(currFunc->numInstructions+currFunc->numBasicBlocks);
@@ -298,7 +298,7 @@ public:
}
virtual void handleBasicBlockBegin( unsigned blocknum) {
- dump << " BLOCK: BasicBlock #" << blocknum << "{\n";
+ dump << " BLOCK: BasicBlock #" << blocknum << "{\n";
bca.numBasicBlocks++;
bca.numValues++;
if ( currFunc ) currFunc->numBasicBlocks++;
@@ -306,11 +306,12 @@ public:
virtual bool handleInstruction( unsigned Opcode, const Type* iType,
std::vector<unsigned>& Operands, unsigned Size){
- dump << " INST: OpCode="
- << Instruction::getOpcodeName(Opcode) << " Type="
- << iType->getDescription() << "\n";
+ dump << " INST: OpCode="
+ << Instruction::getOpcodeName(Opcode) << " Type=\""
+ << iType->getDescription() << "\"";
for ( unsigned i = 0; i < Operands.size(); ++i )
- dump << " Op#" << i << " Slot=" << Operands[i] << "\n";
+ dump << " Op(" << i << ")=Slot(" << Operands[i] << ")";
+ dump << "\n";
bca.numInstructions++;
bca.numValues++;
@@ -327,7 +328,7 @@ public:
}
virtual void handleBasicBlockEnd(unsigned blocknum) {
- dump << " } END BLOCK: BasicBlock #" << blocknum << "{\n";
+ dump << " } END BLOCK: BasicBlock #" << blocknum << "{\n";
}
virtual void handleGlobalConstantsBegin() {
OpenPOWER on IntegriCloud