diff options
| author | Owen Anderson <resistor@mac.com> | 2011-08-17 17:44:15 +0000 |
|---|---|---|
| committer | Owen Anderson <resistor@mac.com> | 2011-08-17 17:44:15 +0000 |
| commit | a4043c4b3237c4c37b3a1aba838e6255be4fb742 (patch) | |
| tree | 400786eb5474d9a5da56ae61b08bd1d80f5af242 /llvm/utils/TableGen/FixedLenDecoderEmitter.h | |
| parent | 3fce368d879815920f384ffb44177e447ef411c6 (diff) | |
| download | bcm5719-llvm-a4043c4b3237c4c37b3a1aba838e6255be4fb742.tar.gz bcm5719-llvm-a4043c4b3237c4c37b3a1aba838e6255be4fb742.zip | |
Allow the MCDisassembler to return a "soft fail" status code, indicating an instruction that is disassemblable, but invalid. Only used for ARM UNPREDICTABLE instructions at the moment.
Patch by James Molloy.
llvm-svn: 137830
Diffstat (limited to 'llvm/utils/TableGen/FixedLenDecoderEmitter.h')
| -rw-r--r-- | llvm/utils/TableGen/FixedLenDecoderEmitter.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/FixedLenDecoderEmitter.h b/llvm/utils/TableGen/FixedLenDecoderEmitter.h index 300a2f49f80..535299c32de 100644 --- a/llvm/utils/TableGen/FixedLenDecoderEmitter.h +++ b/llvm/utils/TableGen/FixedLenDecoderEmitter.h @@ -49,9 +49,16 @@ struct OperandInfo { class FixedLenDecoderEmitter : public TableGenBackend { public: - FixedLenDecoderEmitter(RecordKeeper &R) : + FixedLenDecoderEmitter(RecordKeeper &R, + std::string GPrefix = "if (", + std::string GPostfix = " == MCDisassembler::Fail) return MCDisassembler::Fail;", + std::string ROK = "MCDisassembler::Success", + std::string RFail = "MCDisassembler::Fail", + std::string L = "") : Records(R), Target(R), - NumberedInstructions(Target.getInstructionsByEnumValue()) {} + NumberedInstructions(Target.getInstructionsByEnumValue()), + GuardPrefix(GPrefix), GuardPostfix(GPostfix), + ReturnOK(ROK), ReturnFail(RFail), Locals(L) {} // run - Output the code emitter void run(raw_ostream &o); @@ -62,7 +69,10 @@ private: std::vector<const CodeGenInstruction*> NumberedInstructions; std::vector<unsigned> Opcodes; std::map<unsigned, std::vector<OperandInfo> > Operands; - +public: + std::string GuardPrefix, GuardPostfix; + std::string ReturnOK, ReturnFail; + std::string Locals; }; } // end llvm namespace |

