X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=utils%2FTableGen%2FAsmWriterEmitter.h;h=5e8d6f5b7fe7529cd90b1b6a176d56becc6bef54;hb=2d76c84514216f51526f2be123315f585995d860;hp=155dfc83c015e47644d192140855e1a6808cd814;hpb=3da94aec4d429b2ba0f65fa040c33650cade196b;p=oota-llvm.git diff --git a/utils/TableGen/AsmWriterEmitter.h b/utils/TableGen/AsmWriterEmitter.h index 155dfc83c01..5e8d6f5b7fe 100644 --- a/utils/TableGen/AsmWriterEmitter.h +++ b/utils/TableGen/AsmWriterEmitter.h @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by the LLVM research group and is distributed under -// the University of Illinois Open Source License. See LICENSE.TXT for details. +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -16,16 +16,40 @@ #define ASMWRITER_EMITTER_H #include "TableGenBackend.h" +#include +#include +#include namespace llvm { - + class AsmWriterInst; + class CodeGenInstruction; + class AsmWriterEmitter : public TableGenBackend { RecordKeeper &Records; + std::map CGIAWIMap; + std::vector NumberedInstructions; public: AsmWriterEmitter(RecordKeeper &R) : Records(R) {} // run - Output the asmwriter, returning true on failure. - void run(std::ostream &o); + void run(raw_ostream &o); + +private: + void EmitPrintInstruction(raw_ostream &o); + void EmitGetRegisterName(raw_ostream &o); + void EmitGetInstructionName(raw_ostream &o); + void EmitPrintAliasInstruction(raw_ostream &O); + + AsmWriterInst *getAsmWriterInstByID(unsigned ID) const { + assert(ID < NumberedInstructions.size()); + std::map::const_iterator I = + CGIAWIMap.find(NumberedInstructions[ID]); + assert(I != CGIAWIMap.end() && "Didn't find inst!"); + return I->second; + } + void FindUniqueOperandCommands(std::vector &UOC, + std::vector &InstIdxs, + std::vector &InstOpsUsed) const; }; } #endif