X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=utils%2FTableGen%2FAsmWriterEmitter.h;h=302722d6df06fbd0ec763374a16a2b6dcfc6d6b9;hb=b4ced5a3c488d58d98381c8562123640fdb6177a;hp=155dfc83c015e47644d192140855e1a6808cd814;hpb=3da94aec4d429b2ba0f65fa040c33650cade196b;p=oota-llvm.git diff --git a/utils/TableGen/AsmWriterEmitter.h b/utils/TableGen/AsmWriterEmitter.h index 155dfc83c01..302722d6df0 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,35 @@ #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); + +private: + 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