Replace a usage of std::vector with SmallVector to allow constructing with non-constant iterators on MSVC.

--

PiperOrigin-RevId: 250769027
This commit is contained in:
River Riddle 2019-05-30 14:58:28 -07:00 committed by Mehdi Amini
parent 97505013c6
commit 4fd012cda2
2 changed files with 6 additions and 10 deletions

View File

@ -115,7 +115,7 @@ public:
struct FunctionToSpecialize {
mlir::Function *function;
std::string mangledName;
std::vector<mlir::Type> argumentsType;
SmallVector<mlir::Type, 4> argumentsType;
};
void runOnModule() override {
@ -308,10 +308,8 @@ public:
if (!mangledCallee) {
// Can't find the target, this is where we queue the request for the
// callee and stop the inference for the current function now.
std::vector<mlir::Type> funcArgs(op->operand_type_begin(),
op->operand_type_end());
funcWorklist.push_back(
{callee, std::move(mangledName), std::move(funcArgs)});
funcWorklist.push_back({callee, std::move(mangledName),
llvm::to_vector<4>(op->getOperandTypes())});
return mlir::success();
}
// Found a specialized callee! Let's turn this into a normal call

View File

@ -115,7 +115,7 @@ public:
struct FunctionToSpecialize {
mlir::Function *function;
std::string mangledName;
std::vector<mlir::Type> argumentsType;
SmallVector<mlir::Type, 4> argumentsType;
};
void runOnModule() override {
@ -312,10 +312,8 @@ public:
if (!mangledCallee) {
// Can't find the target, this is where we queue the request for the
// callee and stop the inference for the current function now.
std::vector<mlir::Type> funcArgs(op->operand_type_begin(),
op->operand_type_end());
funcWorklist.push_back(
{callee, std::move(mangledName), std::move(funcArgs)});
funcWorklist.push_back({callee, std::move(mangledName),
llvm::to_vector<4>(op->getOperandTypes())});
return mlir::success();
}
// Found a specialized callee! Let's turn this into a normal call