[Mlir-commits] [mlir] ad5d7ac - Apply clang-tidy fixes for readability-const-return-type to MLIR (NFC)

Mehdi Amini llvmlistbot at llvm.org
Sat Jan 1 17:54:28 PST 2022


Author: Mehdi Amini
Date: 2022-01-02T01:51:39Z
New Revision: ad5d7ace34e8b1c4bfdeb855b92b860b95127c7b

URL: https://github.com/llvm/llvm-project/commit/ad5d7ace34e8b1c4bfdeb855b92b860b95127c7b
DIFF: https://github.com/llvm/llvm-project/commit/ad5d7ace34e8b1c4bfdeb855b92b860b95127c7b.diff

LOG: Apply clang-tidy fixes for readability-const-return-type to MLIR (NFC)

Reviewed By: rriddle, Mogball

Differential Revision: https://reviews.llvm.org/D116251

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Quant/UniformSupport.h
    mlir/include/mlir/TableGen/Predicate.h
    mlir/lib/Dialect/Quant/Utils/UniformSupport.cpp
    mlir/lib/TableGen/Predicate.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Quant/UniformSupport.h b/mlir/include/mlir/Dialect/Quant/UniformSupport.h
index 91f2a798430c4..5bcf4d5921a5f 100644
--- a/mlir/include/mlir/Dialect/Quant/UniformSupport.h
+++ b/mlir/include/mlir/Dialect/Quant/UniformSupport.h
@@ -31,7 +31,7 @@ namespace quant {
 /// process.
 struct ExpressedToQuantizedConverter {
   /// Creates a converter for the given input type.
-  static const ExpressedToQuantizedConverter forInputType(Type inputType);
+  static ExpressedToQuantizedConverter forInputType(Type inputType);
 
   /// Converts the inputType to be based on the given elemental type,
   /// returning the new type (or nullptr and emit an error on failure).

diff  --git a/mlir/include/mlir/TableGen/Predicate.h b/mlir/include/mlir/TableGen/Predicate.h
index 6c1b762025a0d..2c91588a542f8 100644
--- a/mlir/include/mlir/TableGen/Predicate.h
+++ b/mlir/include/mlir/TableGen/Predicate.h
@@ -101,7 +101,7 @@ class CombinedPred : public Pred {
   const llvm::Record *getCombinerDef() const;
 
   // Get the predicates that are combined by this predicate.
-  const std::vector<llvm::Record *> getChildren() const;
+  std::vector<llvm::Record *> getChildren() const;
 };
 
 // A combined predicate that requires all child predicates of 'CPred' type to

diff  --git a/mlir/lib/Dialect/Quant/Utils/UniformSupport.cpp b/mlir/lib/Dialect/Quant/Utils/UniformSupport.cpp
index 6d11bc05c9418..ddd8ae0c0fd35 100644
--- a/mlir/lib/Dialect/Quant/Utils/UniformSupport.cpp
+++ b/mlir/lib/Dialect/Quant/Utils/UniformSupport.cpp
@@ -17,7 +17,7 @@ static bool isQuantizablePrimitiveType(Type inputType) {
   return inputType.isa<FloatType>();
 }
 
-const ExpressedToQuantizedConverter
+ExpressedToQuantizedConverter
 ExpressedToQuantizedConverter::forInputType(Type inputType) {
   if (inputType.isa<TensorType, VectorType>()) {
     Type elementType = inputType.cast<ShapedType>().getElementType();

diff  --git a/mlir/lib/TableGen/Predicate.cpp b/mlir/lib/TableGen/Predicate.cpp
index 46de820799896..e034e7084b8cc 100644
--- a/mlir/lib/TableGen/Predicate.cpp
+++ b/mlir/lib/TableGen/Predicate.cpp
@@ -79,7 +79,7 @@ const llvm::Record *CombinedPred::getCombinerDef() const {
   return def->getValueAsDef("kind");
 }
 
-const std::vector<llvm::Record *> CombinedPred::getChildren() const {
+std::vector<llvm::Record *> CombinedPred::getChildren() const {
   assert(def->getValue("children") &&
          "CombinedPred must have a value 'children'");
   return def->getValueAsListOfDefs("children");


        


More information about the Mlir-commits mailing list