summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-11-18 08:30:07 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-11-18 08:30:07 +0000
commitf79d3449c5c4a455eb67cdc2f170f82c6e3a527f (patch)
tree581abd59bb423c04bc4e51ca8161ccf73b2eb26e /llvm/lib
parent64dab75c418ddde2ac7a36e9355c2ef425dc86b3 (diff)
downloadbcm5719-llvm-f79d3449c5c4a455eb67cdc2f170f82c6e3a527f.tar.gz
bcm5719-llvm-f79d3449c5c4a455eb67cdc2f170f82c6e3a527f.zip
[OperandBundles] Tighten OperandBundleDef's interface; NFC
llvm-svn: 253446
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp12
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp6
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp2
3 files changed, 8 insertions, 12 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index 2c6e8081c13..2d09b18a901 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -1972,17 +1972,13 @@ bool LLParser::ParseOptionalOperandBundles(
if (ParseStringConstant(Tag))
return true;
- BundleList.emplace_back();
- auto &OBI = BundleList.back();
-
- OBI.Tag = std::move(Tag);
-
if (ParseToken(lltok::lparen, "expected '(' in operand bundle"))
return true;
+ std::vector<Value *> Inputs;
while (Lex.getKind() != lltok::rparen) {
// If this isn't the first input, we need a comma.
- if (!OBI.Inputs.empty() &&
+ if (!Inputs.empty() &&
ParseToken(lltok::comma, "expected ',' in input list"))
return true;
@@ -1990,9 +1986,11 @@ bool LLParser::ParseOptionalOperandBundles(
Value *Input = nullptr;
if (ParseType(Ty) || ParseValue(Ty, Input, PFS))
return true;
- OBI.Inputs.push_back(Input);
+ Inputs.push_back(Input);
}
+ BundleList.emplace_back(std::move(Tag), std::move(Inputs));
+
Lex.Lex(); // Lex the ')'.
}
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 3a2d5be21db..9210042e6ed 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -5120,10 +5120,7 @@ std::error_code BitcodeReader::parseFunctionBody(Function *F) {
if (Record.size() < 1 || Record[0] >= BundleTags.size())
return error("Invalid record");
- OperandBundles.emplace_back();
- OperandBundles.back().Tag = BundleTags[Record[0]];
-
- std::vector<Value *> &Inputs = OperandBundles.back().Inputs;
+ std::vector<Value *> Inputs;
unsigned OpNum = 1;
while (OpNum != Record.size()) {
@@ -5133,6 +5130,7 @@ std::error_code BitcodeReader::parseFunctionBody(Function *F) {
Inputs.push_back(Op);
}
+ OperandBundles.emplace_back(BundleTags[Record[0]], std::move(Inputs));
continue;
}
}
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index dfb028111e9..a31131bd4ac 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -1195,7 +1195,7 @@ bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI,
MergedDeoptArgs.insert(MergedDeoptArgs.end(), ChildOB.Inputs.begin(),
ChildOB.Inputs.end());
- OpDefs.emplace_back("deopt", std::move(MergedDeoptArgs));
+ OpDefs.emplace_back(StringRef("deopt"), std::move(MergedDeoptArgs));
}
Instruction *NewI = nullptr;
OpenPOWER on IntegriCloud