Author: lattner Date: Sun Jan 6 22:57:31 2008 New Revision: 45684 URL: http://llvm.org/viewvc/llvm-project?rev=45684&view=rev Log: the name field of instructions is never set to a non-empty string, just unconditionally use the def name of the instruction.
Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.cpp llvm/trunk/utils/TableGen/CodeGenInstruction.h llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenInstruction.cpp?rev=45684&r1=45683&r2=45684&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenInstruction.cpp (original) +++ llvm/trunk/utils/TableGen/CodeGenInstruction.cpp Sun Jan 6 22:57:31 2008 @@ -76,7 +76,6 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr) : TheDef(R), AsmString(AsmStr) { - Name = R->getValueAsString("Name"); Namespace = R->getValueAsString("Namespace"); isReturn = R->getValueAsBit("isReturn"); @@ -214,14 +213,6 @@ } } -/// getName - Return the contents of the instruction Name field if set, -/// otherwise return the name of the def. -std::string CodeGenInstruction::getName() const { - if (!Name.empty()) return Name; - return TheDef->getName(); -} - - /// getOperandNamed - Return the index of the operand with the specified /// non-empty name. If the instruction does not have an operand with the /// specified name, throw an exception. Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenInstruction.h?rev=45684&r1=45683&r2=45684&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenInstruction.h (original) +++ llvm/trunk/utils/TableGen/CodeGenInstruction.h Sun Jan 6 22:57:31 2008 @@ -26,17 +26,12 @@ class CodeGenInstruction { public: Record *TheDef; // The actual record defining this instruction. - std::string Name; // Contents of the 'Name' field. std::string Namespace; // The namespace the instruction is in. /// AsmString - The format string used to emit a .s file for the /// instruction. std::string AsmString; - /// getName - Return the contents of the instruction Name field if set, - /// otherwise return the name of the def. - std::string getName() const; - /// OperandInfo - The information we keep track of for each operand in the /// operand list for a tablegen instruction. struct OperandInfo { Modified: llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp?rev=45684&r1=45683&r2=45684&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp Sun Jan 6 22:57:31 2008 @@ -205,7 +205,7 @@ fprintf(stderr, "Warning: mayStore flag explicitly set on instruction '%s'" " but flag already inferred from pattern.\n", - Inst.getName().c_str()); + Inst.TheDef->getName().c_str()); mayStore = true; } @@ -285,7 +285,7 @@ InferFromPattern(Inst, mayStore, isLoad, NeverHasSideEffects); if (NeverHasSideEffects && Inst.mayHaveSideEffects) { - std::cerr << "error: Instruction '" << Inst.getName() + std::cerr << "error: Instruction '" << Inst.TheDef->getName() << "' is marked with 'mayHaveSideEffects', but it can never have them!\n"; exit(1); } @@ -298,7 +298,7 @@ OS << " { "; OS << Num << ",\t" << MinOperands << ",\t" - << Inst.NumDefs << ",\t\"" << Inst.getName(); + << Inst.NumDefs << ",\t\"" << Inst.TheDef->getName(); OS << "\",\t" << getItinClassNumber(Inst.TheDef) << ", 0"; // Emit all of the target indepedent flags... _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits