aboutsummaryrefslogtreecommitdiff
path: root/utils/TableGen/FixedLenDecoderEmitter.h
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2011-08-17 17:44:15 +0000
committerOwen Anderson <resistor@mac.com>2011-08-17 17:44:15 +0000
commit83e3f67fb68d497b600da83a62f000fcce7868a9 (patch)
tree304ea462b8e700eb92526a43c9c2749341fb9e83 /utils/TableGen/FixedLenDecoderEmitter.h
parent0e6d230abdbf6ba67a2676c118431a4df8fb15dd (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137830 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/FixedLenDecoderEmitter.h')
-rw-r--r--utils/TableGen/FixedLenDecoderEmitter.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/utils/TableGen/FixedLenDecoderEmitter.h b/utils/TableGen/FixedLenDecoderEmitter.h
index 300a2f49f8..535299c32d 100644
--- a/utils/TableGen/FixedLenDecoderEmitter.h
+++ b/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