summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-07-15 06:52:48 +0000
committerCraig Topper <craig.topper@intel.com>2018-07-15 06:52:48 +0000
commit765b9201989e4c4277eef7f309367555b3395035 (patch)
treeb1b4c305a413bd6f5e09b8d1330e6867c005802c /llvm/utils/TableGen/CodeGenDAGPatterns.cpp
parent60ce856134e1f667744ced33d2c61a58b6be285b (diff)
downloadbcm5719-llvm-765b9201989e4c4277eef7f309367555b3395035.tar.gz
bcm5719-llvm-765b9201989e4c4277eef7f309367555b3395035.zip
[TableGen] Remove what seems to be an unnecessary std::map copy.
The comment says the copy was made so it could be destroyed in the following loop, but the original map wasn't used after the loop. llvm-svn: 337120
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r--llvm/utils/TableGen/CodeGenDAGPatterns.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
index c0ddfeb4f43..19c96fa789b 100644
--- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -3561,10 +3561,7 @@ void CodeGenDAGPatterns::parseInstructionPattern(
InstResults.erase(OpName);
}
- // Loop over the inputs next. Make a copy of InstInputs so we can destroy
- // the copy while we're checking the inputs.
- std::map<std::string, TreePatternNodePtr> InstInputsCheck(InstInputs);
-
+ // Loop over the inputs next.
std::vector<TreePatternNodePtr> ResultNodeOperands;
std::vector<Record*> Operands;
for (unsigned i = NumResults, e = CGI.Operands.size(); i != e; ++i) {
@@ -3573,7 +3570,7 @@ void CodeGenDAGPatterns::parseInstructionPattern(
if (OpName.empty())
I.error("Operand #" + Twine(i) + " in operands list has no name!");
- if (!InstInputsCheck.count(OpName)) {
+ if (!InstInputs.count(OpName)) {
// If this is an operand with a DefaultOps set filled in, we can ignore
// this. When we codegen it, we will do so as always executed.
if (Op.Rec->isSubClassOf("OperandWithDefaultOps")) {
@@ -3585,8 +3582,8 @@ void CodeGenDAGPatterns::parseInstructionPattern(
I.error("Operand $" + OpName +
" does not appear in the instruction pattern");
}
- TreePatternNodePtr InVal = InstInputsCheck[OpName];
- InstInputsCheck.erase(OpName); // It occurred, remove from map.
+ TreePatternNodePtr InVal = InstInputs[OpName];
+ InstInputs.erase(OpName); // It occurred, remove from map.
if (InVal->isLeaf() && isa<DefInit>(InVal->getLeafValue())) {
Record *InRec = static_cast<DefInit*>(InVal->getLeafValue())->getDef();
@@ -3614,8 +3611,8 @@ void CodeGenDAGPatterns::parseInstructionPattern(
ResultNodeOperands.push_back(std::move(OpNode));
}
- if (!InstInputsCheck.empty())
- I.error("Input operand $" + InstInputsCheck.begin()->first +
+ if (!InstInputs.empty())
+ I.error("Input operand $" + InstInputs.begin()->first +
" occurs in pattern but not in operands list!");
TreePatternNodePtr ResultPattern = std::make_shared<TreePatternNode>(
OpenPOWER on IntegriCloud