[Mlir-commits] [mlir] ffc3a0d - [mlir:toy][NFC] Remove unnecessary trailing return type
Jakub Kuderski
llvmlistbot at llvm.org
Mon May 16 10:47:50 PDT 2022
Author: Jakub Kuderski
Date: 2022-05-16T13:46:00-04:00
New Revision: ffc3a0db003fa9e26b25e55011d83e3fbb5a7ac2
URL: https://github.com/llvm/llvm-project/commit/ffc3a0db003fa9e26b25e55011d83e3fbb5a7ac2
DIFF: https://github.com/llvm/llvm-project/commit/ffc3a0db003fa9e26b25e55011d83e3fbb5a7ac2.diff
LOG: [mlir:toy][NFC] Remove unnecessary trailing return type
In this instance, the trailing return type does not improve readability
as it repeats what is returned in the same line.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D125697
Added:
Modified:
mlir/examples/toy/Ch1/include/toy/AST.h
mlir/examples/toy/Ch2/include/toy/AST.h
mlir/examples/toy/Ch3/include/toy/AST.h
mlir/examples/toy/Ch4/include/toy/AST.h
mlir/examples/toy/Ch5/include/toy/AST.h
mlir/examples/toy/Ch6/include/toy/AST.h
mlir/examples/toy/Ch7/include/toy/AST.h
Removed:
################################################################################
diff --git a/mlir/examples/toy/Ch1/include/toy/AST.h b/mlir/examples/toy/Ch1/include/toy/AST.h
index 7f45530a45e4..95bcd67c42ab 100644
--- a/mlir/examples/toy/Ch1/include/toy/AST.h
+++ b/mlir/examples/toy/Ch1/include/toy/AST.h
@@ -234,8 +234,8 @@ class ModuleAST {
ModuleAST(std::vector<FunctionAST> functions)
: functions(std::move(functions)) {}
- auto begin() -> decltype(functions.begin()) { return functions.begin(); }
- auto end() -> decltype(functions.end()) { return functions.end(); }
+ auto begin() { return functions.begin(); }
+ auto end() { return functions.end(); }
};
void dump(ModuleAST &);
diff --git a/mlir/examples/toy/Ch2/include/toy/AST.h b/mlir/examples/toy/Ch2/include/toy/AST.h
index 7f45530a45e4..95bcd67c42ab 100644
--- a/mlir/examples/toy/Ch2/include/toy/AST.h
+++ b/mlir/examples/toy/Ch2/include/toy/AST.h
@@ -234,8 +234,8 @@ class ModuleAST {
ModuleAST(std::vector<FunctionAST> functions)
: functions(std::move(functions)) {}
- auto begin() -> decltype(functions.begin()) { return functions.begin(); }
- auto end() -> decltype(functions.end()) { return functions.end(); }
+ auto begin() { return functions.begin(); }
+ auto end() { return functions.end(); }
};
void dump(ModuleAST &);
diff --git a/mlir/examples/toy/Ch3/include/toy/AST.h b/mlir/examples/toy/Ch3/include/toy/AST.h
index 7f45530a45e4..95bcd67c42ab 100644
--- a/mlir/examples/toy/Ch3/include/toy/AST.h
+++ b/mlir/examples/toy/Ch3/include/toy/AST.h
@@ -234,8 +234,8 @@ class ModuleAST {
ModuleAST(std::vector<FunctionAST> functions)
: functions(std::move(functions)) {}
- auto begin() -> decltype(functions.begin()) { return functions.begin(); }
- auto end() -> decltype(functions.end()) { return functions.end(); }
+ auto begin() { return functions.begin(); }
+ auto end() { return functions.end(); }
};
void dump(ModuleAST &);
diff --git a/mlir/examples/toy/Ch4/include/toy/AST.h b/mlir/examples/toy/Ch4/include/toy/AST.h
index 7f45530a45e4..95bcd67c42ab 100644
--- a/mlir/examples/toy/Ch4/include/toy/AST.h
+++ b/mlir/examples/toy/Ch4/include/toy/AST.h
@@ -234,8 +234,8 @@ class ModuleAST {
ModuleAST(std::vector<FunctionAST> functions)
: functions(std::move(functions)) {}
- auto begin() -> decltype(functions.begin()) { return functions.begin(); }
- auto end() -> decltype(functions.end()) { return functions.end(); }
+ auto begin() { return functions.begin(); }
+ auto end() { return functions.end(); }
};
void dump(ModuleAST &);
diff --git a/mlir/examples/toy/Ch5/include/toy/AST.h b/mlir/examples/toy/Ch5/include/toy/AST.h
index 7f45530a45e4..95bcd67c42ab 100644
--- a/mlir/examples/toy/Ch5/include/toy/AST.h
+++ b/mlir/examples/toy/Ch5/include/toy/AST.h
@@ -234,8 +234,8 @@ class ModuleAST {
ModuleAST(std::vector<FunctionAST> functions)
: functions(std::move(functions)) {}
- auto begin() -> decltype(functions.begin()) { return functions.begin(); }
- auto end() -> decltype(functions.end()) { return functions.end(); }
+ auto begin() { return functions.begin(); }
+ auto end() { return functions.end(); }
};
void dump(ModuleAST &);
diff --git a/mlir/examples/toy/Ch6/include/toy/AST.h b/mlir/examples/toy/Ch6/include/toy/AST.h
index 7f45530a45e4..95bcd67c42ab 100644
--- a/mlir/examples/toy/Ch6/include/toy/AST.h
+++ b/mlir/examples/toy/Ch6/include/toy/AST.h
@@ -234,8 +234,8 @@ class ModuleAST {
ModuleAST(std::vector<FunctionAST> functions)
: functions(std::move(functions)) {}
- auto begin() -> decltype(functions.begin()) { return functions.begin(); }
- auto end() -> decltype(functions.end()) { return functions.end(); }
+ auto begin() { return functions.begin(); }
+ auto end() { return functions.end(); }
};
void dump(ModuleAST &);
diff --git a/mlir/examples/toy/Ch7/include/toy/AST.h b/mlir/examples/toy/Ch7/include/toy/AST.h
index f0f369a3fa01..10f82566d500 100644
--- a/mlir/examples/toy/Ch7/include/toy/AST.h
+++ b/mlir/examples/toy/Ch7/include/toy/AST.h
@@ -301,8 +301,8 @@ class ModuleAST {
ModuleAST(std::vector<std::unique_ptr<RecordAST>> records)
: records(std::move(records)) {}
- auto begin() -> decltype(records.begin()) { return records.begin(); }
- auto end() -> decltype(records.end()) { return records.end(); }
+ auto begin() { return records.begin(); }
+ auto end() { return records.end(); }
};
void dump(ModuleAST &);
More information about the Mlir-commits
mailing list