[llvm-commits] [llvm] r118325 - /llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
Chris Lattner
sabre at nondot.org
Fri Nov 5 23:43:11 PDT 2010
Author: lattner
Date: Sat Nov 6 01:43:11 2010
New Revision: 118325
URL: http://llvm.org/viewvc/llvm-project?rev=118325&view=rev
Log:
fix another fixme, replacing a string with a semantic pointer.
Modified:
llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=118325&r1=118324&r2=118325&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Sat Nov 6 01:43:11 2010
@@ -306,8 +306,8 @@
}
};
- /// InstrName - The target name for this instruction.
- std::string InstrName;
+ /// ResultInst - The result instruction generated.
+ const CodeGenInstruction *ResultInst;
/// TheDef - This is the definition of the instruction or InstAlias that this
/// matchable came from.
@@ -349,14 +349,13 @@
MatchableInfo(const CodeGenInstruction &CGI)
: TheDef(CGI.TheDef), DefRec(&CGI),
TheOperandList(CGI.Operands), AsmString(CGI.AsmString) {
- InstrName = TheDef->getName();
+ ResultInst = &CGI;
}
MatchableInfo(const CodeGenInstAlias *Alias)
: TheDef(Alias->TheDef), DefRec(Alias), TheOperandList(Alias->Operands),
AsmString(Alias->AsmString) {
- // FIXME: InstrName should be a CGI.
- InstrName = Alias->ResultInst->TheDef->getName();
+ ResultInst = Alias->ResultInst;
}
void Initialize(const AsmMatcherInfo &Info,
@@ -537,7 +536,7 @@
}
void MatchableInfo::dump() {
- errs() << InstrName << " -- " << "flattened:\"" << AsmString << "\"\n";
+ errs() << TheDef->getName() << " -- " << "flattened:\"" << AsmString <<"\"\n";
for (unsigned i = 0, e = AsmOperands.size(); i != e; ++i) {
AsmOperand &Op = AsmOperands[i];
@@ -708,7 +707,7 @@
// FIXME: Should reject these. The ARM backend hits this with $lane in a
// bunch of instructions. It is unclear what the right answer is.
DEBUG({
- errs() << "warning: '" << InstrName << "': "
+ errs() << "warning: '" << TheDef->getName() << "': "
<< "ignoring instruction with tied operand '"
<< Tok.str() << "'\n";
});
@@ -1050,8 +1049,8 @@
// Ignore "Int_*" and "*_Int" instructions, which are internal aliases.
//
// FIXME: This is a total hack.
- if (StringRef(II->InstrName).startswith("Int_") ||
- StringRef(II->InstrName).endswith("_Int"))
+ if (StringRef(II->TheDef->getName()).startswith("Int_") ||
+ StringRef(II->TheDef->getName()).endswith("_Int"))
continue;
Matchables.push_back(II.take());
@@ -1822,7 +1821,7 @@
it != ie; ++it) {
MatchableInfo &II = **it;
- OS << " { " << Target.getName() << "::" << II.InstrName
+ OS << " { " << Target.getName() << "::" << II.ResultInst->TheDef->getName()
<< ", \"" << II.Mnemonic << "\""
<< ", " << II.ConversionFnKind << ", { ";
for (unsigned i = 0, e = II.AsmOperands.size(); i != e; ++i) {
More information about the llvm-commits
mailing list