From 752ce8e0c86c3117a950788f18bcbd2fa2d843b9 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 2 May 2019 14:08:18 -0700 Subject: [PATCH] Be consistent w.r.t. struct/class in forward declaration This addresses compiler warnings. -- PiperOrigin-RevId: 246386939 --- mlir/include/mlir/Analysis/NestedMatcher.h | 8 ++++---- mlir/include/mlir/Analysis/Utils.h | 2 +- mlir/include/mlir/EDSC/Builders.h | 2 +- mlir/include/mlir/EDSC/Helpers.h | 3 ++- mlir/include/mlir/IR/AffineExpr.h | 10 +++++----- mlir/include/mlir/IR/Location.h | 12 ++++++------ mlir/include/mlir/IR/Operation.h | 2 +- mlir/include/mlir/IR/StandardTypes.h | 2 +- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/mlir/include/mlir/Analysis/NestedMatcher.h b/mlir/include/mlir/Analysis/NestedMatcher.h index c3b470e..eb2bdd4 100644 --- a/mlir/include/mlir/Analysis/NestedMatcher.h +++ b/mlir/include/mlir/Analysis/NestedMatcher.h @@ -63,8 +63,8 @@ struct NestedMatch { ArrayRef getMatchedChildren() { return matchedChildren; } private: - friend class NestedPattern; - friend class NestedPatternContext; + friend struct NestedPattern; + friend struct NestedPatternContext; /// Underlying global bump allocator managed by a NestedPatternContext. static llvm::BumpPtrAllocator *&allocator(); @@ -116,8 +116,8 @@ struct NestedPattern { unsigned getDepth() const; private: - friend class NestedPatternContext; - friend class NestedMatch; + friend struct NestedPatternContext; + friend struct NestedMatch; friend struct State; /// Underlying global bump allocator managed by a NestedPatternContext. diff --git a/mlir/include/mlir/Analysis/Utils.h b/mlir/include/mlir/Analysis/Utils.h index 8ce4de1..99e0724 100644 --- a/mlir/include/mlir/Analysis/Utils.h +++ b/mlir/include/mlir/Analysis/Utils.h @@ -39,7 +39,7 @@ class AffineForOp; class Block; class FlatAffineConstraints; class Location; -class MemRefAccess; +struct MemRefAccess; class Operation; class Value; diff --git a/mlir/include/mlir/EDSC/Builders.h b/mlir/include/mlir/EDSC/Builders.h index a605759..5d23488 100644 --- a/mlir/include/mlir/EDSC/Builders.h +++ b/mlir/include/mlir/EDSC/Builders.h @@ -239,7 +239,7 @@ private: /// Base class for ValueHandle, OperationHandle and BlockHandle. /// Not meant to be used outside of these classes. -struct CapturableHandle { +class CapturableHandle { protected: CapturableHandle() = default; }; diff --git a/mlir/include/mlir/EDSC/Helpers.h b/mlir/include/mlir/EDSC/Helpers.h index 41d8dd8..bb83bf2 100644 --- a/mlir/include/mlir/EDSC/Helpers.h +++ b/mlir/include/mlir/EDSC/Helpers.h @@ -113,7 +113,8 @@ private: /// Assigning to an IndexedValue emits an actual `Store` operation, while /// converting an IndexedValue to a ValueHandle emits an actual `Load` /// operation. -template struct TemplatedIndexedValue { +template class TemplatedIndexedValue { +public: explicit TemplatedIndexedValue(Type t) : base(t) {} explicit TemplatedIndexedValue(Value *v) : TemplatedIndexedValue(ValueHandle(v)) {} diff --git a/mlir/include/mlir/IR/AffineExpr.h b/mlir/include/mlir/IR/AffineExpr.h index c976cbf..e73c617 100644 --- a/mlir/include/mlir/IR/AffineExpr.h +++ b/mlir/include/mlir/IR/AffineExpr.h @@ -36,11 +36,11 @@ class IntegerSet; namespace detail { -class AffineExprStorage; -class AffineBinaryOpExprStorage; -class AffineDimExprStorage; -class AffineSymbolExprStorage; -class AffineConstantExprStorage; +struct AffineExprStorage; +struct AffineBinaryOpExprStorage; +struct AffineDimExprStorage; +struct AffineSymbolExprStorage; +struct AffineConstantExprStorage; } // namespace detail diff --git a/mlir/include/mlir/IR/Location.h b/mlir/include/mlir/IR/Location.h index efcee49..d394052 100644 --- a/mlir/include/mlir/IR/Location.h +++ b/mlir/include/mlir/IR/Location.h @@ -34,12 +34,12 @@ class Identifier; namespace detail { -class LocationStorage; -class UnknownLocationStorage; -class FileLineColLocationStorage; -class NameLocationStorage; -class CallSiteLocationStorage; -class FusedLocationStorage; +struct LocationStorage; +struct UnknownLocationStorage; +struct FileLineColLocationStorage; +struct NameLocationStorage; +struct CallSiteLocationStorage; +struct FusedLocationStorage; } // namespace detail diff --git a/mlir/include/mlir/IR/Operation.h b/mlir/include/mlir/IR/Operation.h index 23f1abd..d9ab876 100644 --- a/mlir/include/mlir/IR/Operation.h +++ b/mlir/include/mlir/IR/Operation.h @@ -34,7 +34,7 @@ class BlockAndValueMapping; class Location; class MLIRContext; class OperandIterator; -class OperationState; +struct OperationState; class ResultIterator; class ResultTypeIterator; diff --git a/mlir/include/mlir/IR/StandardTypes.h b/mlir/include/mlir/IR/StandardTypes.h index 849c6d2..27c4b49 100644 --- a/mlir/include/mlir/IR/StandardTypes.h +++ b/mlir/include/mlir/IR/StandardTypes.h @@ -22,7 +22,7 @@ #include "mlir/Support/LLVM.h" namespace llvm { -class fltSemantics; +struct fltSemantics; } // namespace llvm namespace mlir { -- 2.7.4