00001 #ifndef _BasicBlockCounter_h_
00002 #define _BasicBlockCounter_h_
00003
00004 #include <CommonMethods.h>
00005
00006 class BasicBlockCounter : public CommonMethods {
00007 protected:
00008 public:
00009 BasicBlockCounter(XCoffFile* xcoff,char* extension,uint32_t phaseNo);
00010 virtual ~BasicBlockCounter() { }
00011
00012 void selectInstrumentationPoints(char* blockFile);
00013
00014 uint32_t maxByteCountPerInst() { return 32 * sizeof(uint32_t); }
00015 uint32_t byteCountForInst(uint32_t instPointIdx,uint64_t instStubAddress,TextSection* textSect);
00016 uint32_t generateCodeForInst(uint32_t instPointIdx,uint64_t instStubAddress,TextSection* textSect,
00017 BaseGen* gen,uint32_t genBufferOffset);
00018 uint32_t bytesPerBufferEntry() { return sizeof(uint64_t); }
00019 uint32_t howManyBufferEntry() { return numberOfInstPoints; }
00020 bool filterBlockForInst(BasicBlock* bb);
00021 char* getSharedLibFuncName(uint32_t i){
00022 ASSERT(i < getNumOfSharedLibFuncs());
00023 return "MetaSim_endFuncCall_Freq";
00024 }
00025 char* getGenClassName() { return "BasicBlockCounter"; }
00026 uint32_t spaceForBlockInfo() { return 0; }
00027 void getSharedLibraryPathAndObj(char** path,char** name,char** obj);
00028 void initializeReservedData(DataSection* dataSect,BaseGen* gen);
00029
00030 };
00031
00032 #endif