diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-15 05:19:05 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-15 05:19:05 +0000 |
commit | 2ac190238e88b21e716e2853900b5076c9013410 (patch) | |
tree | 96d31431369e0b53130604939ace6898f13b505d /utils | |
parent | 513dbf1af06d0bc530dd6f17da320d2fb40b3a28 (diff) |
add fields to the .td files unconditionally, simplifying tblgen a bit.
Switch the ARM backend to use 'let' instead of 'set' with this change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119120 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/CodeEmitterGen.cpp | 6 | ||||
-rw-r--r-- | utils/TableGen/CodeGenInstruction.cpp | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/utils/TableGen/CodeEmitterGen.cpp b/utils/TableGen/CodeEmitterGen.cpp index e7b022af15..debc877613 100644 --- a/utils/TableGen/CodeEmitterGen.cpp +++ b/utils/TableGen/CodeEmitterGen.cpp @@ -230,9 +230,9 @@ void CodeEmitterGen::run(raw_ostream &o) { } } - if (R->getValue("PostEncoderMethod")) - Case += " Value = " + - R->getValueAsString("PostEncoderMethod") + "(MI, Value);\n"; + std::string PostEmitter = R->getValueAsString("PostEncoderMethod"); + if (!PostEmitter.empty()) + Case += " Value = " + PostEmitter + "(MI, Value);\n"; std::vector<std::string> &InstList = CaseMap[Case]; InstList.push_back(InstName); diff --git a/utils/TableGen/CodeGenInstruction.cpp b/utils/TableGen/CodeGenInstruction.cpp index 84a8b9137e..575852b1ad 100644 --- a/utils/TableGen/CodeGenInstruction.cpp +++ b/utils/TableGen/CodeGenInstruction.cpp @@ -71,8 +71,7 @@ CGIOperandList::CGIOperandList(Record *R) : TheDef(R) { if (Rec->isSubClassOf("Operand")) { PrintMethod = Rec->getValueAsString("PrintMethod"); // If there is an explicit encoder method, use it. - if (Rec->getValue("EncoderMethod")) - EncoderMethod = Rec->getValueAsString("EncoderMethod"); + EncoderMethod = Rec->getValueAsString("EncoderMethod"); MIOpInfo = Rec->getValueAsDag("MIOperandInfo"); // Verify that MIOpInfo has an 'ops' root value. |