fix another fixme, replacing a string with a semantic pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118325 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-11-06 06:43:11 +00:00
parent 225549f775
commit 5abd1ebcb3

View File

@ -306,8 +306,8 @@ struct MatchableInfo {
} }
}; };
/// InstrName - The target name for this instruction. /// ResultInst - The result instruction generated.
std::string InstrName; const CodeGenInstruction *ResultInst;
/// TheDef - This is the definition of the instruction or InstAlias that this /// TheDef - This is the definition of the instruction or InstAlias that this
/// matchable came from. /// matchable came from.
@ -349,14 +349,13 @@ struct MatchableInfo {
MatchableInfo(const CodeGenInstruction &CGI) MatchableInfo(const CodeGenInstruction &CGI)
: TheDef(CGI.TheDef), DefRec(&CGI), : TheDef(CGI.TheDef), DefRec(&CGI),
TheOperandList(CGI.Operands), AsmString(CGI.AsmString) { TheOperandList(CGI.Operands), AsmString(CGI.AsmString) {
InstrName = TheDef->getName(); ResultInst = &CGI;
} }
MatchableInfo(const CodeGenInstAlias *Alias) MatchableInfo(const CodeGenInstAlias *Alias)
: TheDef(Alias->TheDef), DefRec(Alias), TheOperandList(Alias->Operands), : TheDef(Alias->TheDef), DefRec(Alias), TheOperandList(Alias->Operands),
AsmString(Alias->AsmString) { AsmString(Alias->AsmString) {
// FIXME: InstrName should be a CGI. ResultInst = Alias->ResultInst;
InstrName = Alias->ResultInst->TheDef->getName();
} }
void Initialize(const AsmMatcherInfo &Info, void Initialize(const AsmMatcherInfo &Info,
@ -537,7 +536,7 @@ public:
} }
void MatchableInfo::dump() { void MatchableInfo::dump() {
errs() << InstrName << " -- " << "flattened:\"" << AsmString << "\"\n"; errs() << TheDef->getName() << " -- " << "flattened:\"" << AsmString <<"\"\n";
for (unsigned i = 0, e = AsmOperands.size(); i != e; ++i) { for (unsigned i = 0, e = AsmOperands.size(); i != e; ++i) {
AsmOperand &Op = AsmOperands[i]; AsmOperand &Op = AsmOperands[i];
@ -708,7 +707,7 @@ bool MatchableInfo::Validate(StringRef CommentDelimiter, bool Hack) const {
// FIXME: Should reject these. The ARM backend hits this with $lane in a // FIXME: Should reject these. The ARM backend hits this with $lane in a
// bunch of instructions. It is unclear what the right answer is. // bunch of instructions. It is unclear what the right answer is.
DEBUG({ DEBUG({
errs() << "warning: '" << InstrName << "': " errs() << "warning: '" << TheDef->getName() << "': "
<< "ignoring instruction with tied operand '" << "ignoring instruction with tied operand '"
<< Tok.str() << "'\n"; << Tok.str() << "'\n";
}); });
@ -1050,8 +1049,8 @@ void AsmMatcherInfo::BuildInfo() {
// Ignore "Int_*" and "*_Int" instructions, which are internal aliases. // Ignore "Int_*" and "*_Int" instructions, which are internal aliases.
// //
// FIXME: This is a total hack. // FIXME: This is a total hack.
if (StringRef(II->InstrName).startswith("Int_") || if (StringRef(II->TheDef->getName()).startswith("Int_") ||
StringRef(II->InstrName).endswith("_Int")) StringRef(II->TheDef->getName()).endswith("_Int"))
continue; continue;
Matchables.push_back(II.take()); Matchables.push_back(II.take());
@ -1822,7 +1821,7 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
it != ie; ++it) { it != ie; ++it) {
MatchableInfo &II = **it; MatchableInfo &II = **it;
OS << " { " << Target.getName() << "::" << II.InstrName OS << " { " << Target.getName() << "::" << II.ResultInst->TheDef->getName()
<< ", \"" << II.Mnemonic << "\"" << ", \"" << II.Mnemonic << "\""
<< ", " << II.ConversionFnKind << ", { "; << ", " << II.ConversionFnKind << ", { ";
for (unsigned i = 0, e = II.AsmOperands.size(); i != e; ++i) { for (unsigned i = 0, e = II.AsmOperands.size(); i != e; ++i) {