summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-08-31 00:03:31 +0000
committerChad Rosier <mcrosier@apple.com>2012-08-31 00:03:31 +0000
commit98cfa1044fdcaaa53625c16bb9a246e0b15f7653 (patch)
treec1ec0776b3f93e925347baea16f8b5ee912dc6ee /llvm/utils
parente969340fea89f582949b63741c0f67204c0029ac (diff)
downloadbcm5719-llvm-98cfa1044fdcaaa53625c16bb9a246e0b15f7653.tar.gz
bcm5719-llvm-98cfa1044fdcaaa53625c16bb9a246e0b15f7653.zip
With the fix in r162954/162955 every cvt function returns true. Thus, have
the ConvertToMCInst() return void, rather then a bool. Update all the cvt functions as well. llvm-svn: 162961
Diffstat (limited to 'llvm/utils')
-rw-r--r--llvm/utils/TableGen/AsmMatcherEmitter.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
index 861169e9797..8debc8e32ab 100644
--- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
@@ -1678,12 +1678,12 @@ static void emitConvertToMCInst(CodeGenTarget &Target, StringRef ClassName,
std::string ConvertFnBody;
raw_string_ostream CvtOS(ConvertFnBody);
// Start the unified conversion function.
- CvtOS << "bool " << Target.getName() << ClassName << "::\n"
+ CvtOS << "void " << Target.getName() << ClassName << "::\n"
<< "ConvertToMCInst(unsigned Kind, MCInst &Inst, "
<< "unsigned Opcode,\n"
<< " const SmallVectorImpl<MCParsedAsmOperand*"
<< "> &Operands) {\n"
- << " if (Kind >= CVT_NUM_SIGNATURES) return false;\n"
+ << " assert(Kind < CVT_NUM_SIGNATURES && \"Invalid signature!\");\n"
<< " uint8_t *Converter = ConversionTable[Kind];\n"
<< " Inst.setOpcode(Opcode);\n"
<< " for (uint8_t *p = Converter; *p; p+= 2) {\n"
@@ -1700,11 +1700,11 @@ static void emitConvertToMCInst(CodeGenTarget &Target, StringRef ClassName,
std::string OperandFnBody;
raw_string_ostream OpOS(OperandFnBody);
// Start the operand number lookup function.
- OpOS << "bool " << Target.getName() << ClassName << "::\n"
+ OpOS << "void " << Target.getName() << ClassName << "::\n"
<< "GetMCInstOperandNum(unsigned Kind, MCInst &Inst,\n"
<< " const SmallVectorImpl<MCParsedAsmOperand*> &Operands,"
<< "\n unsigned OperandNum, unsigned &MCOperandNum) {\n"
- << " if (Kind >= CVT_NUM_SIGNATURES) return false;\n"
+ << " assert(Kind < CVT_NUM_SIGNATURES && \"Invalid signature!\");\n"
<< " MCOperandNum = 0;\n"
<< " uint8_t *Converter = ConversionTable[Kind];\n"
<< " for (uint8_t *p = Converter; *p; p+= 2) {\n"
@@ -1751,8 +1751,8 @@ static void emitConvertToMCInst(CodeGenTarget &Target, StringRef ClassName,
// Add the handler to the conversion driver function.
CvtOS << " case CVT_" << AsmMatchConverter << ":\n"
- << " return " << AsmMatchConverter
- << "(Inst, Opcode, Operands);\n";
+ << " " << AsmMatchConverter << "(Inst, Opcode, Operands);\n"
+ << " break;\n";
// FIXME: Handle the operand number lookup for custom match functions.
continue;
@@ -1899,10 +1899,10 @@ static void emitConvertToMCInst(CodeGenTarget &Target, StringRef ClassName,
}
// Finish up the converter driver function.
- CvtOS << " }\n }\n return true;\n}\n\n";
+ CvtOS << " }\n }\n return;\n}\n\n";
// Finish up the operand number lookup function.
- OpOS << " }\n }\n return true;\n}\n\n";
+ OpOS << " }\n }\n return;\n}\n\n";
OS << "namespace {\n";
@@ -2576,11 +2576,11 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
OS << " // This should be included into the middle of the declaration of\n";
OS << " // your subclasses implementation of MCTargetAsmParser.\n";
OS << " unsigned ComputeAvailableFeatures(uint64_t FeatureBits) const;\n";
- OS << " bool ConvertToMCInst(unsigned Kind, MCInst &Inst, "
+ OS << " void ConvertToMCInst(unsigned Kind, MCInst &Inst, "
<< "unsigned Opcode,\n"
<< " const SmallVectorImpl<MCParsedAsmOperand*> "
<< "&Operands);\n";
- OS << " bool GetMCInstOperandNum(unsigned Kind, MCInst &Inst,\n"
+ OS << " void GetMCInstOperandNum(unsigned Kind, MCInst &Inst,\n"
<< " const SmallVectorImpl<MCParsedAsmOperand*> "
<< "&Operands,\n unsigned OperandNum, unsigned "
<< "&MCOperandNum);\n";
@@ -2864,9 +2864,7 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
OS << "\n";
OS << " // We have selected a definite instruction, convert the parsed\n"
<< " // operands into the appropriate MCInst.\n";
- OS << " if (!ConvertToMCInst(it->ConvertFn, Inst,\n"
- << " it->Opcode, Operands))\n";
- OS << " return Match_ConversionFail;\n";
+ OS << " ConvertToMCInst(it->ConvertFn, Inst, it->Opcode, Operands);\n";
OS << "\n";
// Verify the instruction with the target-specific match predicate function.
OpenPOWER on IntegriCloud