forked from OSchip/llvm-project
Apply clang-tidy fixes for performance-move-const-arg to MLIR (NFC)
This commit is contained in:
parent
a68c8d3009
commit
8e5f112c05
|
@ -253,11 +253,11 @@ private:
|
|||
if (args.size() != 1)
|
||||
return parseError<ExprAST>("<single arg>", "as argument to print()");
|
||||
|
||||
return std::make_unique<PrintExprAST>(std::move(loc), std::move(args[0]));
|
||||
return std::make_unique<PrintExprAST>(loc, std::move(args[0]));
|
||||
}
|
||||
|
||||
// Call to a user-defined function
|
||||
return std::make_unique<CallExprAST>(std::move(loc), std::string(name),
|
||||
return std::make_unique<CallExprAST>(loc, std::string(name),
|
||||
std::move(args));
|
||||
}
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ public:
|
|||
DescriptorType &operator*() { return descriptor; }
|
||||
DescriptorType *operator->() { return &descriptor; }
|
||||
T &operator[](std::initializer_list<int64_t> indices) {
|
||||
return descriptor[std::move(indices)];
|
||||
return descriptor[indices];
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
ElementsAttrIndexer(ElementsAttrIndexer &&rhs)
|
||||
: isContiguous(rhs.isContiguous), isSplat(rhs.isSplat) {
|
||||
if (isContiguous)
|
||||
conState = std::move(rhs.conState);
|
||||
conState = rhs.conState;
|
||||
else
|
||||
new (&nonConState) NonContiguousState(std::move(rhs.nonConState));
|
||||
}
|
||||
|
|
|
@ -900,8 +900,7 @@ auto SparseElementsAttr::value_begin() const -> iterator<T> {
|
|||
auto valueIt = getValues().value_begin<T>();
|
||||
const std::vector<ptrdiff_t> flatSparseIndices(getFlattenedSparseIndices());
|
||||
std::function<T(ptrdiff_t)> mapFn =
|
||||
[flatSparseIndices{std::move(flatSparseIndices)},
|
||||
valueIt{std::move(valueIt)},
|
||||
[flatSparseIndices{flatSparseIndices}, valueIt{std::move(valueIt)},
|
||||
zeroValue{std::move(zeroValue)}](ptrdiff_t index) {
|
||||
// Try to map the current index to one of the sparse indices.
|
||||
for (unsigned i = 0, e = flatSparseIndices.size(); i != e; ++i)
|
||||
|
|
|
@ -228,8 +228,7 @@ public:
|
|||
///
|
||||
/// The `nameBuilder` function is not guaranteed to be called.
|
||||
Timer nest(const void *id, function_ref<std::string()> nameBuilder) {
|
||||
return tm ? Timer(*tm, tm->nestTimer(handle, id, std::move(nameBuilder)))
|
||||
: Timer();
|
||||
return tm ? Timer(*tm, tm->nestTimer(handle, id, nameBuilder)) : Timer();
|
||||
}
|
||||
|
||||
/// See above.
|
||||
|
|
|
@ -152,7 +152,7 @@ public:
|
|||
FmtObjectBase(const FmtObjectBase &that) = delete;
|
||||
|
||||
FmtObjectBase(FmtObjectBase &&that)
|
||||
: fmt(std::move(that.fmt)), context(that.context),
|
||||
: fmt(that.fmt), context(that.context),
|
||||
adapters(), // adapters are initialized by FmtObject
|
||||
replacements(std::move(that.replacements)) {}
|
||||
|
||||
|
|
|
@ -778,7 +778,7 @@ public:
|
|||
StringRef name, Names... names) {
|
||||
SmallVector<StringRef, 2> dialectNames({name, names...});
|
||||
setDialectAction(dialectNames, LegalizationAction::Dynamic);
|
||||
setLegalityCallback(dialectNames, std::move(callback));
|
||||
setLegalityCallback(dialectNames, callback);
|
||||
}
|
||||
template <typename... Args>
|
||||
void addDynamicallyLegalDialect(DynamicLegalityCallbackFn callback) {
|
||||
|
|
Loading…
Reference in New Issue