[Mlir-commits] [mlir] 9940dcf - Apply clang-tidy fixes for modernize-use-equals-default to MLIR (NFC)
Mehdi Amini
llvmlistbot at llvm.org
Thu Jan 13 18:27:57 PST 2022
Author: Mehdi Amini
Date: 2022-01-14T02:26:27Z
New Revision: 9940dcfa4ac5db646a5ec3632df94e12fd1b0e8a
URL: https://github.com/llvm/llvm-project/commit/9940dcfa4ac5db646a5ec3632df94e12fd1b0e8a
DIFF: https://github.com/llvm/llvm-project/commit/9940dcfa4ac5db646a5ec3632df94e12fd1b0e8a.diff
LOG: Apply clang-tidy fixes for modernize-use-equals-default to MLIR (NFC)
Added:
Modified:
mlir/include/mlir/Analysis/AliasAnalysis.h
mlir/include/mlir/Dialect/Affine/IR/AffineValueMap.h
mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.h
mlir/include/mlir/Dialect/Quant/UniformSupport.h
mlir/include/mlir/IR/AffineMap.h
mlir/include/mlir/IR/Block.h
mlir/include/mlir/IR/BuiltinAttributeInterfaces.h
mlir/include/mlir/IR/PatternMatch.h
mlir/include/mlir/Interfaces/SideEffectInterfaces.h
mlir/include/mlir/Support/DebugAction.h
mlir/include/mlir/Support/Timing.h
mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
mlir/lib/Bindings/Python/IRModule.h
mlir/lib/Parser/AsmParserImpl.h
Removed:
################################################################################
diff --git a/mlir/include/mlir/Analysis/AliasAnalysis.h b/mlir/include/mlir/Analysis/AliasAnalysis.h
index 3ff9e8e45cc38..cbc6e49b41a38 100644
--- a/mlir/include/mlir/Analysis/AliasAnalysis.h
+++ b/mlir/include/mlir/Analysis/AliasAnalysis.h
@@ -180,7 +180,7 @@ struct AliasAnalysisTraits {
/// querying into derived analysis implementations.
class Concept {
public:
- virtual ~Concept() {}
+ virtual ~Concept() = default;
/// Given two values, return their aliasing behavior.
virtual AliasResult alias(Value lhs, Value rhs) = 0;
diff --git a/mlir/include/mlir/Dialect/Affine/IR/AffineValueMap.h b/mlir/include/mlir/Dialect/Affine/IR/AffineValueMap.h
index 7c6f29b95cd0b..05c810ec674a1 100644
--- a/mlir/include/mlir/Dialect/Affine/IR/AffineValueMap.h
+++ b/mlir/include/mlir/Dialect/Affine/IR/AffineValueMap.h
@@ -35,7 +35,7 @@ class AffineValueMap {
public:
// Creates an empty AffineValueMap (users should call 'reset' to reset map
// and operands).
- AffineValueMap() {}
+ AffineValueMap() = default;
AffineValueMap(AffineMap map, ValueRange operands, ValueRange results = {});
~AffineValueMap();
diff --git a/mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.h b/mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.h
index 0bbe3fcb6e6b0..3c84ef8cbae46 100644
--- a/mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.h
+++ b/mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.h
@@ -67,7 +67,7 @@ std::unique_ptr<AllocationCallbacks> defaultAllocationCallbacks();
/// executed after the analysis, but before bufferization. They can be used to
/// implement custom dialect-specific optimizations.
struct PostAnalysisStep {
- virtual ~PostAnalysisStep() {}
+ virtual ~PostAnalysisStep() = default;
/// Run the post analysis step. This function may modify the IR, but must keep
/// `aliasInfo` consistent. Newly created operations and operations that
diff --git a/mlir/include/mlir/Dialect/Quant/UniformSupport.h b/mlir/include/mlir/Dialect/Quant/UniformSupport.h
index 5bcf4d5921a5f..202dcce2c792c 100644
--- a/mlir/include/mlir/Dialect/Quant/UniformSupport.h
+++ b/mlir/include/mlir/Dialect/Quant/UniformSupport.h
@@ -120,7 +120,7 @@ class UniformQuantizedValueConverter {
return isSigned ? qValue.getSExtValue() : qValue.getZExtValue();
}
- virtual ~UniformQuantizedValueConverter() {}
+ virtual ~UniformQuantizedValueConverter() = default;
private:
// An optimized implementation to quantize f32 to i8/u8 with C++ native
diff --git a/mlir/include/mlir/IR/AffineMap.h b/mlir/include/mlir/IR/AffineMap.h
index 9322db10c1ce4..cd6fce22b6142 100644
--- a/mlir/include/mlir/IR/AffineMap.h
+++ b/mlir/include/mlir/IR/AffineMap.h
@@ -39,7 +39,7 @@ class AffineMap {
public:
using ImplType = detail::AffineMapStorage;
- constexpr AffineMap() {}
+ constexpr AffineMap() = default;
explicit AffineMap(ImplType *map) : map(map) {}
/// Returns a zero result affine map with no dimensions or symbols: () -> ().
@@ -323,7 +323,7 @@ inline ::llvm::hash_code hash_value(AffineMap arg) {
/// A mutable affine map. Its affine expressions are however unique.
struct MutableAffineMap {
public:
- MutableAffineMap() {}
+ MutableAffineMap() = default;
MutableAffineMap(AffineMap map);
ArrayRef<AffineExpr> getResults() const { return results; }
diff --git a/mlir/include/mlir/IR/Block.h b/mlir/include/mlir/IR/Block.h
index b270f2aa5634c..623020764fc3b 100644
--- a/mlir/include/mlir/IR/Block.h
+++ b/mlir/include/mlir/IR/Block.h
@@ -29,7 +29,7 @@ class ValueTypeRange;
class Block : public IRObjectWithUseList<BlockOperand>,
public llvm::ilist_node_with_parent<Block, Region> {
public:
- explicit Block() {}
+ explicit Block() = default;
~Block();
void clear() {
diff --git a/mlir/include/mlir/IR/BuiltinAttributeInterfaces.h b/mlir/include/mlir/IR/BuiltinAttributeInterfaces.h
index 834a70e54cba0..37635687c4d46 100644
--- a/mlir/include/mlir/IR/BuiltinAttributeInterfaces.h
+++ b/mlir/include/mlir/IR/BuiltinAttributeInterfaces.h
@@ -109,7 +109,7 @@ struct ElementsAttrIndexer {
/// This allows for all iterator and element types to be completely
/// type-erased.
struct OpaqueIteratorBase {
- virtual ~OpaqueIteratorBase() {}
+ virtual ~OpaqueIteratorBase() = default;
virtual std::unique_ptr<OpaqueIteratorBase> clone() const = 0;
};
/// This class is used to represent the abstract base of an opaque iterator
diff --git a/mlir/include/mlir/IR/PatternMatch.h b/mlir/include/mlir/IR/PatternMatch.h
index aacc411c7ca76..a53c1f3c69c52 100644
--- a/mlir/include/mlir/IR/PatternMatch.h
+++ b/mlir/include/mlir/IR/PatternMatch.h
@@ -33,7 +33,7 @@ class PatternBenefit {
enum { ImpossibleToMatchSentinel = 65535 };
public:
- PatternBenefit() {}
+ PatternBenefit() = default;
PatternBenefit(unsigned benefit);
PatternBenefit(const PatternBenefit &) = default;
PatternBenefit &operator=(const PatternBenefit &) = default;
@@ -243,7 +243,7 @@ class Pattern {
///
class RewritePattern : public Pattern {
public:
- virtual ~RewritePattern() {}
+ virtual ~RewritePattern() = default;
/// Rewrite the IR rooted at the specified operation with the result of
/// this pattern, generating any new operations with the specified
diff --git a/mlir/include/mlir/Interfaces/SideEffectInterfaces.h b/mlir/include/mlir/Interfaces/SideEffectInterfaces.h
index 57366db149797..596492495b778 100644
--- a/mlir/include/mlir/Interfaces/SideEffectInterfaces.h
+++ b/mlir/include/mlir/Interfaces/SideEffectInterfaces.h
@@ -77,7 +77,7 @@ class Effect {
/// class represents an abstract interface for a given resource.
class Resource {
public:
- virtual ~Resource() {}
+ virtual ~Resource() = default;
/// This base class is used for derived effects that are non-parametric.
template <typename DerivedResource, typename BaseResource = Resource>
diff --git a/mlir/include/mlir/Support/DebugAction.h b/mlir/include/mlir/Support/DebugAction.h
index 4dc04476b583e..aa7a820873b3f 100644
--- a/mlir/include/mlir/Support/DebugAction.h
+++ b/mlir/include/mlir/Support/DebugAction.h
@@ -48,7 +48,7 @@ class DebugActionManager {
/// This class represents the base class of a debug action handler.
class HandlerBase {
public:
- virtual ~HandlerBase() {}
+ virtual ~HandlerBase() = default;
/// Return the unique handler id of this handler, use for casting
/// functionality.
diff --git a/mlir/include/mlir/Support/Timing.h b/mlir/include/mlir/Support/Timing.h
index 89f3e01632ab8..0528499196c1f 100644
--- a/mlir/include/mlir/Support/Timing.h
+++ b/mlir/include/mlir/Support/Timing.h
@@ -184,8 +184,8 @@ class TimingManager {
/// manager implementations.
class Timer {
public:
- Timer() {}
- Timer(const Timer &other) : tm(other.tm), handle(other.handle) {}
+ Timer() = default;
+ Timer(const Timer &other) = default;
Timer(Timer &&other) : Timer(other) {
other.tm = nullptr;
other.handle = nullptr;
diff --git a/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h b/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
index 983a5fd23d094..1750c0c9a3cfd 100644
--- a/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
+++ b/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
@@ -191,7 +191,7 @@ class ModuleTranslation {
/// Common CRTP base class for ModuleTranslation stack frames.
class StackFrame {
public:
- virtual ~StackFrame() {}
+ virtual ~StackFrame() = default;
TypeID getTypeID() const { return typeID; }
protected:
diff --git a/mlir/lib/Bindings/Python/IRModule.h b/mlir/lib/Bindings/Python/IRModule.h
index 2f354d6d12620..698fc6dc70ff1 100644
--- a/mlir/lib/Bindings/Python/IRModule.h
+++ b/mlir/lib/Bindings/Python/IRModule.h
@@ -56,7 +56,7 @@ class PyObjectRef {
}
PyObjectRef(const PyObjectRef &other)
: referrent(other.referrent), object(other.object /* copies */) {}
- ~PyObjectRef() {}
+ ~PyObjectRef() = default;
int getRefCount() {
if (!object)
diff --git a/mlir/lib/Parser/AsmParserImpl.h b/mlir/lib/Parser/AsmParserImpl.h
index 7bbbbc7a5832c..7e1095aae4b15 100644
--- a/mlir/lib/Parser/AsmParserImpl.h
+++ b/mlir/lib/Parser/AsmParserImpl.h
@@ -27,7 +27,7 @@ class AsmParserImpl : public BaseT {
public:
AsmParserImpl(llvm::SMLoc nameLoc, Parser &parser)
: nameLoc(nameLoc), parser(parser) {}
- ~AsmParserImpl() override {}
+ ~AsmParserImpl() override = default;
/// Return the location of the original name token.
llvm::SMLoc getNameLoc() const override { return nameLoc; }
More information about the Mlir-commits
mailing list