From ad5d7ace34e8b1c4bfdeb855b92b860b95127c7b Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Sun, 2 Jan 2022 01:50:43 +0000 Subject: [PATCH] Apply clang-tidy fixes for readability-const-return-type to MLIR (NFC) Reviewed By: rriddle, Mogball Differential Revision: https://reviews.llvm.org/D116251 --- mlir/include/mlir/Dialect/Quant/UniformSupport.h | 2 +- mlir/include/mlir/TableGen/Predicate.h | 2 +- mlir/lib/Dialect/Quant/Utils/UniformSupport.cpp | 2 +- mlir/lib/TableGen/Predicate.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mlir/include/mlir/Dialect/Quant/UniformSupport.h b/mlir/include/mlir/Dialect/Quant/UniformSupport.h index 91f2a79..5bcf4d5 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 6c1b762..2c91588 100644 --- a/mlir/include/mlir/TableGen/Predicate.h +++ b/mlir/include/mlir/TableGen/Predicate.h @@ -101,7 +101,7 @@ public: const llvm::Record *getCombinerDef() const; // Get the predicates that are combined by this predicate. - const std::vector getChildren() const; + std::vector 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 6d11bc0..ddd8ae0 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(); } -const ExpressedToQuantizedConverter +ExpressedToQuantizedConverter ExpressedToQuantizedConverter::forInputType(Type inputType) { if (inputType.isa()) { Type elementType = inputType.cast().getElementType(); diff --git a/mlir/lib/TableGen/Predicate.cpp b/mlir/lib/TableGen/Predicate.cpp index 46de820..e034e70 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 CombinedPred::getChildren() const { +std::vector CombinedPred::getChildren() const { assert(def->getValue("children") && "CombinedPred must have a value 'children'"); return def->getValueAsListOfDefs("children"); -- 2.7.4