diff options
author | Mehdi Amini <joker.eph@gmail.com> | 2021-12-07 18:27:58 +0000 |
---|---|---|
committer | Mehdi Amini <joker.eph@gmail.com> | 2021-12-08 06:05:26 +0000 |
commit | be0a7e9f27083ada6072fcc0711ffa5630daa5ec (patch) | |
tree | e8b711523071e25efe6617b58934c89e468eecd5 /mlir/lib | |
parent | 3bed2a7212ceef611d74c9a2aa679cec31375cee (diff) | |
download | llvm-be0a7e9f27083ada6072fcc0711ffa5630daa5ec.zip llvm-be0a7e9f27083ada6072fcc0711ffa5630daa5ec.tar.gz llvm-be0a7e9f27083ada6072fcc0711ffa5630daa5ec.tar.bz2 |
Adjust "end namespace" comment in MLIR to match new agree'd coding style
See D115115 and this mailing list discussion:
https://lists.llvm.org/pipermail/llvm-dev/2021-December/154199.html
Differential Revision: https://reviews.llvm.org/D115309
Diffstat (limited to 'mlir/lib')
149 files changed, 278 insertions, 278 deletions
diff --git a/mlir/lib/Analysis/AffineStructures.cpp b/mlir/lib/Analysis/AffineStructures.cpp index ea600ee..34bd07e 100644 --- a/mlir/lib/Analysis/AffineStructures.cpp +++ b/mlir/lib/Analysis/AffineStructures.cpp @@ -66,7 +66,7 @@ private: } }; -} // end anonymous namespace +} // namespace // Flattens the expressions in map. Returns failure if 'expr' was unable to be // flattened (i.e., semi-affine expressions not handled yet). diff --git a/mlir/lib/Analysis/DataFlowAnalysis.cpp b/mlir/lib/Analysis/DataFlowAnalysis.cpp index b91d2de..c664211 100644 --- a/mlir/lib/Analysis/DataFlowAnalysis.cpp +++ b/mlir/lib/Analysis/DataFlowAnalysis.cpp @@ -211,7 +211,7 @@ private: /// A symbol table used for O(1) symbol lookups during simplification. SymbolTableCollection symbolTable; }; -} // end anonymous namespace +} // namespace ForwardDataFlowSolver::ForwardDataFlowSolver( ForwardDataFlowAnalysisBase &analysis, Operation *op) diff --git a/mlir/lib/Analysis/NestedMatcher.cpp b/mlir/lib/Analysis/NestedMatcher.cpp index bd5ac0b..a72b3cb 100644 --- a/mlir/lib/Analysis/NestedMatcher.cpp +++ b/mlir/lib/Analysis/NestedMatcher.cpp @@ -171,5 +171,5 @@ bool isLoadOrStore(Operation &op) { return isa<AffineLoadOp, AffineStoreOp>(op); } -} // end namespace matcher -} // end namespace mlir +} // namespace matcher +} // namespace mlir diff --git a/mlir/lib/Analysis/Presburger/Simplex.cpp b/mlir/lib/Analysis/Presburger/Simplex.cpp index dbfc118..0e7ab34 100644 --- a/mlir/lib/Analysis/Presburger/Simplex.cpp +++ b/mlir/lib/Analysis/Presburger/Simplex.cpp @@ -141,7 +141,7 @@ bool signMatchesDirection(int64_t elem, Direction direction) { Direction flippedDirection(Direction direction) { return direction == Direction::Up ? Direction::Down : Simplex::Direction::Up; } -} // anonymous namespace +} // namespace /// Find a pivot to change the sample value of the row in the specified /// direction. The returned pivot row will involve `row` if and only if the diff --git a/mlir/lib/Bindings/Python/ExecutionEngineModule.cpp b/mlir/lib/Bindings/Python/ExecutionEngineModule.cpp index b5a0f84..8142091 100644 --- a/mlir/lib/Bindings/Python/ExecutionEngineModule.cpp +++ b/mlir/lib/Bindings/Python/ExecutionEngineModule.cpp @@ -62,7 +62,7 @@ private: std::vector<py::object> referencedObjects; }; -} // anonymous namespace +} // namespace /// Create the `mlir.execution_engine` module here. PYBIND11_MODULE(_mlirExecutionEngine, m) { diff --git a/mlir/lib/Bindings/Python/IRAffine.cpp b/mlir/lib/Bindings/Python/IRAffine.cpp index 272de0d..faf01e5 100644 --- a/mlir/lib/Bindings/Python/IRAffine.cpp +++ b/mlir/lib/Bindings/Python/IRAffine.cpp @@ -397,7 +397,7 @@ public: private: PyAffineMap affineMap; }; -} // end namespace +} // namespace bool PyAffineMap::operator==(const PyAffineMap &other) { return mlirAffineMapEqual(affineMap, other.affineMap); diff --git a/mlir/lib/Bindings/Python/IRCore.cpp b/mlir/lib/Bindings/Python/IRCore.cpp index 0d34914..cd57552 100644 --- a/mlir/lib/Bindings/Python/IRCore.cpp +++ b/mlir/lib/Bindings/Python/IRCore.cpp @@ -2012,7 +2012,7 @@ private: PyOperationRef operation; }; -} // end namespace +} // namespace //------------------------------------------------------------------------------ // Populates the core exports of the 'ir' submodule. diff --git a/mlir/lib/Bindings/Python/Pass.cpp b/mlir/lib/Bindings/Python/Pass.cpp index 2c38a3a..dba2231 100644 --- a/mlir/lib/Bindings/Python/Pass.cpp +++ b/mlir/lib/Bindings/Python/Pass.cpp @@ -48,7 +48,7 @@ private: MlirPassManager passManager; }; -} // anonymous namespace +} // namespace /// Create the `mlir.passmanager` here. void mlir::python::populatePassManagerSubmodule(py::module &m) { diff --git a/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp b/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp index d5802e2..0467dd9 100644 --- a/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp +++ b/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp @@ -722,7 +722,7 @@ public: } }; -} // end namespace +} // namespace void mlir::populateAffineToStdConversionPatterns(RewritePatternSet &patterns) { // clang-format off diff --git a/mlir/lib/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.cpp b/mlir/lib/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.cpp index 07078c7..f8d59e0 100644 --- a/mlir/lib/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.cpp +++ b/mlir/lib/Conversion/ArithmeticToLLVM/ArithmeticToLLVM.cpp @@ -108,7 +108,7 @@ struct CmpFOpLowering : public ConvertOpToLLVMPattern<arith::CmpFOp> { ConversionPatternRewriter &rewriter) const override; }; -} // end anonymous namespace +} // namespace //===----------------------------------------------------------------------===// // ConstantOpLowering @@ -252,7 +252,7 @@ struct ConvertArithmeticToLLVMPass signalPassFailure(); } }; -} // end anonymous namespace +} // namespace //===----------------------------------------------------------------------===// // Pattern Population diff --git a/mlir/lib/Conversion/ArithmeticToSPIRV/ArithmeticToSPIRV.cpp b/mlir/lib/Conversion/ArithmeticToSPIRV/ArithmeticToSPIRV.cpp index 9f1e0a4..da621685 100644 --- a/mlir/lib/Conversion/ArithmeticToSPIRV/ArithmeticToSPIRV.cpp +++ b/mlir/lib/Conversion/ArithmeticToSPIRV/ArithmeticToSPIRV.cpp @@ -190,7 +190,7 @@ public: ConversionPatternRewriter &rewriter) const override; }; -} // end anonymous namespace +} // namespace //===----------------------------------------------------------------------===// // Conversion Helpers @@ -845,7 +845,7 @@ struct ConvertArithmeticToSPIRVPass signalPassFailure(); } }; -} // end anonymous namespace +} // namespace std::unique_ptr<Pass> mlir::arith::createConvertArithmeticToSPIRVPass() { return std::make_unique<ConvertArithmeticToSPIRVPass>(); diff --git a/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp b/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp index ac43d1a..9768211 100644 --- a/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp +++ b/mlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp @@ -173,7 +173,7 @@ struct LowerGpuOpsToNVVMOpsPass } }; -} // anonymous namespace +} // namespace void mlir::configureGpuToNVVMConversionLegality(ConversionTarget &target) { target.addIllegalOp<FuncOp>(); diff --git a/mlir/lib/Conversion/GPUToNVVM/WmmaOpsToNvvm.cpp b/mlir/lib/Conversion/GPUToNVVM/WmmaOpsToNvvm.cpp index 55935e7..f52e589 100644 --- a/mlir/lib/Conversion/GPUToNVVM/WmmaOpsToNvvm.cpp +++ b/mlir/lib/Conversion/GPUToNVVM/WmmaOpsToNvvm.cpp @@ -356,7 +356,7 @@ struct WmmaElementwiseOpToNVVMLowering } }; -} // anonymous namespace +} // namespace namespace mlir { diff --git a/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp b/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp index b074e41..1a570dc 100644 --- a/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp +++ b/mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp @@ -87,7 +87,7 @@ struct LowerGpuOpsToROCDLOpsPass } }; -} // anonymous namespace +} // namespace void mlir::configureGpuToROCDLConversionLegality(ConversionTarget &target) { target.addIllegalOp<FuncOp>(); diff --git a/mlir/lib/Conversion/GPUToVulkan/ConvertGPULaunchFuncToVulkanLaunchFunc.cpp b/mlir/lib/Conversion/GPUToVulkan/ConvertGPULaunchFuncToVulkanLaunchFunc.cpp index 45222e5..e106ebf 100644 --- a/mlir/lib/Conversion/GPUToVulkan/ConvertGPULaunchFuncToVulkanLaunchFunc.cpp +++ b/mlir/lib/Conversion/GPUToVulkan/ConvertGPULaunchFuncToVulkanLaunchFunc.cpp @@ -74,7 +74,7 @@ private: static constexpr unsigned kVulkanLaunchNumConfigOperands = 3; }; -} // anonymous namespace +} // namespace void ConvertGpuLaunchFuncToVulkanLaunchFunc::runOnOperation() { bool done = false; diff --git a/mlir/lib/Conversion/GPUToVulkan/ConvertLaunchFuncToVulkanCalls.cpp b/mlir/lib/Conversion/GPUToVulkan/ConvertLaunchFuncToVulkanCalls.cpp index 200fc3e..b8d1a85 100644 --- a/mlir/lib/Conversion/GPUToVulkan/ConvertLaunchFuncToVulkanCalls.cpp +++ b/mlir/lib/Conversion/GPUToVulkan/ConvertLaunchFuncToVulkanCalls.cpp @@ -166,7 +166,7 @@ private: static constexpr unsigned kVulkanLaunchNumConfigOperands = 3; }; -} // anonymous namespace +} // namespace void VulkanLaunchFuncToVulkanCallsPass::runOnOperation() { initializeCachedTypes(); diff --git a/mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp b/mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp index d69c24e..87dcd27 100644 --- a/mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp +++ b/mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp @@ -135,7 +135,7 @@ private: /// generated operations. SetVector<Value> locOps; }; -} // end anonymous namespace +} // namespace PatternLowering::PatternLowering(FuncOp matcherFunc, ModuleOp rewriterModule) : builder(matcherFunc.getContext()), matcherFunc(matcherFunc), diff --git a/mlir/lib/Conversion/PDLToPDLInterp/Predicate.h b/mlir/lib/Conversion/PDLToPDLInterp/Predicate.h index 1b7a3bb..4a7dcdc 100644 --- a/mlir/lib/Conversion/PDLToPDLInterp/Predicate.h +++ b/mlir/lib/Conversion/PDLToPDLInterp/Predicate.h @@ -71,7 +71,7 @@ enum Kind : unsigned { TypeAnswer, UnsignedAnswer, }; -} // end namespace Predicates +} // namespace Predicates /// Base class for all predicates, used to allow efficient pointer comparison. template <typename ConcreteT, typename BaseT, typename Key, @@ -639,7 +639,7 @@ private: MLIRContext *ctx; }; -} // end namespace pdl_to_pdl_interp -} // end namespace mlir +} // namespace pdl_to_pdl_interp +} // namespace mlir #endif // MLIR_CONVERSION_PDLTOPDLINTERP_PREDICATE_H_ diff --git a/mlir/lib/Conversion/PDLToPDLInterp/PredicateTree.cpp b/mlir/lib/Conversion/PDLToPDLInterp/PredicateTree.cpp index 2466a80..7e2219c 100644 --- a/mlir/lib/Conversion/PDLToPDLInterp/PredicateTree.cpp +++ b/mlir/lib/Conversion/PDLToPDLInterp/PredicateTree.cpp @@ -690,7 +690,7 @@ struct OrderedPredicateList { Value root; DenseSet<OrderedPredicate *> predicates; }; -} // end anonymous namespace +} // namespace /// Returns true if the given matcher refers to the same predicate as the given /// ordered predicate. This means that the position and questions of the two diff --git a/mlir/lib/Conversion/PDLToPDLInterp/PredicateTree.h b/mlir/lib/Conversion/PDLToPDLInterp/PredicateTree.h index 796eb76..9ce88d4 100644 --- a/mlir/lib/Conversion/PDLToPDLInterp/PredicateTree.h +++ b/mlir/lib/Conversion/PDLToPDLInterp/PredicateTree.h @@ -208,7 +208,7 @@ private: ChildMapT children; }; -} // end namespace pdl_to_pdl_interp -} // end namespace mlir +} // namespace pdl_to_pdl_interp +} // namespace mlir #endif // MLIR_CONVERSION_PDLTOPDLINTERP_PREDICATETREE_H_ diff --git a/mlir/lib/Conversion/PDLToPDLInterp/RootOrdering.h b/mlir/lib/Conversion/PDLToPDLInterp/RootOrdering.h index 8fcd320..642b6a0 100644 --- a/mlir/lib/Conversion/PDLToPDLInterp/RootOrdering.h +++ b/mlir/lib/Conversion/PDLToPDLInterp/RootOrdering.h @@ -131,7 +131,7 @@ private: DenseMap<Value, Value> parents; }; -} // end namespace pdl_to_pdl_interp -} // end namespace mlir +} // namespace pdl_to_pdl_interp +} // namespace mlir #endif // MLIR_CONVERSION_PDLTOPDLINTERP_ROOTORDERING_H_ diff --git a/mlir/lib/Conversion/PassDetail.h b/mlir/lib/Conversion/PassDetail.h index 5b4bc92..d9f4713 100644 --- a/mlir/lib/Conversion/PassDetail.h +++ b/mlir/lib/Conversion/PassDetail.h @@ -21,76 +21,76 @@ void registerDialect(DialectRegistry ®istry); namespace acc { class OpenACCDialect; -} // end namespace acc +} // namespace acc namespace arith { class ArithmeticDialect; -} // end namespace arith +} // namespace arith namespace complex { class ComplexDialect; -} // end namespace complex +} // namespace complex namespace gpu { class GPUDialect; class GPUModuleOp; -} // end namespace gpu +} // namespace gpu namespace LLVM { class LLVMDialect; -} // end namespace LLVM +} // namespace LLVM namespace NVVM { class NVVMDialect; -} // end namespace NVVM +} // namespace NVVM namespace math { class MathDialect; -} // end namespace math +} // namespace math namespace memref { class MemRefDialect; -} // end namespace memref +} // namespace memref namespace omp { class OpenMPDialect; -} // end namespace omp +} // namespace omp namespace pdl_interp { class PDLInterpDialect; -} // end namespace pdl_interp +} // namespace pdl_interp namespace ROCDL { class ROCDLDialect; -} // end namespace ROCDL +} // namespace ROCDL namespace scf { class SCFDialect; -} // end namespace scf +} // namespace scf namespace spirv { class SPIRVDialect; -} // end namespace spirv +} // namespace spirv namespace tensor { class TensorDialect; -} // end namespace tensor +} // namespace tensor namespace tosa { class TosaDialect; -} // end namespace tosa +} // namespace tosa namespace vector { class VectorDialect; -} // end namespace vector +} // namespace vector namespace arm_neon { class ArmNeonDialect; -} // end namespace arm_neon +} // namespace arm_neon #define GEN_PASS_CLASSES #include "mlir/Conversion/Passes.h.inc" -} // end namespace mlir +} // namespace mlir #endif // CONVERSION_PASSDETAIL_H_ diff --git a/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp b/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp index 90d870f..657f041 100644 --- a/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp +++ b/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp @@ -451,7 +451,7 @@ struct SCFToOpenMPPass : public ConvertSCFToOpenMPBase<SCFToOpenMPPass> { } }; -} // end namespace +} // namespace std::unique_ptr<OperationPass<ModuleOp>> mlir::createConvertSCFToOpenMPPass() { return std::make_unique<SCFToOpenMPPass>(); diff --git a/mlir/lib/Conversion/SPIRVCommon/Pattern.h b/mlir/lib/Conversion/SPIRVCommon/Pattern.h index 26ffeec..3933899 100644 --- a/mlir/lib/Conversion/SPIRVCommon/Pattern.h +++ b/mlir/lib/Conversion/SPIRVCommon/Pattern.h @@ -39,7 +39,7 @@ public: } }; -} // end namespace spirv -} // end namespace mlir +} // namespace spirv +} // namespace mlir #endif // MLIR_CONVERSION_SPIRVCOMMON_PATTERN_H diff --git a/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp b/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp index fcaba6e..200834a 100644 --- a/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp +++ b/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp @@ -1052,7 +1052,7 @@ struct LLVMLoweringPass : public ConvertStandardToLLVMBase<LLVMLoweringPass> { StringAttr::get(m.getContext(), this->dataLayout)); } }; -} // end namespace +} // namespace std::unique_ptr<OperationPass<ModuleOp>> mlir::createLowerToLLVMPass() { return std::make_unique<LLVMLoweringPass>(); diff --git a/mlir/lib/Conversion/VectorToROCDL/VectorToROCDL.cpp b/mlir/lib/Conversion/VectorToROCDL/VectorToROCDL.cpp index 50b4c3a..a9a3f53 100644 --- a/mlir/lib/Conversion/VectorToROCDL/VectorToROCDL.cpp +++ b/mlir/lib/Conversion/VectorToROCDL/VectorToROCDL.cpp @@ -145,7 +145,7 @@ public: vecTy, dwordConfig, int32Zero, int32Zero, int1False, int1False); } }; -} // end anonymous namespace +} // namespace void mlir::populateVectorToROCDLConversionPatterns( LLVMTypeConverter &converter, RewritePatternSet &patterns) { diff --git a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp index 48affcd..edbcba7 100644 --- a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp +++ b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp @@ -204,7 +204,7 @@ struct AffineInlinerInterface : public DialectInlinerInterface { /// Affine regions should be analyzed recursively. bool shouldAnalyzeRecursively(Operation *op) const final { return true; } }; -} // end anonymous namespace +} // namespace //===----------------------------------------------------------------------===// // AffineDialect @@ -944,7 +944,7 @@ void SimplifyAffineOp<AffineOpTy>::replaceAffineOp( ArrayRef<Value> mapOperands) const { rewriter.replaceOpWithNewOp<AffineOpTy>(op, map, mapOperands); } -} // end anonymous namespace. +} // namespace void AffineApplyOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { @@ -1651,7 +1651,7 @@ struct AffineForEmptyLoopFolder : public OpRewritePattern<AffineForOp> { return success(); } }; -} // end anonymous namespace +} // namespace void AffineForOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { @@ -2033,7 +2033,7 @@ struct AlwaysTrueOrFalseIf : public OpRewritePattern<AffineIfOp> { return success(); } }; -} // end anonymous namespace. +} // namespace static LogicalResult verify(AffineIfOp op) { // Verify that we have a condition attribute. diff --git a/mlir/lib/Dialect/Affine/Transforms/AffineDataCopyGeneration.cpp b/mlir/lib/Dialect/Affine/Transforms/AffineDataCopyGeneration.cpp index dad2cab..218764d 100644 --- a/mlir/lib/Dialect/Affine/Transforms/AffineDataCopyGeneration.cpp +++ b/mlir/lib/Dialect/Affine/Transforms/AffineDataCopyGeneration.cpp @@ -72,7 +72,7 @@ struct AffineDataCopyGeneration Value zeroIndex = nullptr; }; -} // end anonymous namespace +} // namespace /// Generates copies for memref's living in 'slowMemorySpace' into newly created /// buffers in 'fastMemorySpace', and replaces memory operations to the former diff --git a/mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp b/mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp index a6d5f43..b6f9e4c 100644 --- a/mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp +++ b/mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp @@ -47,7 +47,7 @@ struct LoopInvariantCodeMotion void runOnFunction() override; void runOnAffineForOp(AffineForOp forOp); }; -} // end anonymous namespace +} // namespace static bool checkInvarianceOfNestedIfOps(Operation *op, Value indVar, ValueRange iterArgs, diff --git a/mlir/lib/Dialect/Affine/Transforms/AffineScalarReplacement.cpp b/mlir/lib/Dialect/Affine/Transforms/AffineScalarReplacement.cpp index e1b635a..d3df213 100644 --- a/mlir/lib/Dialect/Affine/Transforms/AffineScalarReplacement.cpp +++ b/mlir/lib/Dialect/Affine/Transforms/AffineScalarReplacement.cpp @@ -75,7 +75,7 @@ struct AffineScalarReplacement PostDominanceInfo &postDominanceInfo); }; -} // end anonymous namespace +} // namespace /// Creates a pass to perform optimizations relying on memref dataflow such as /// store to load forwarding, elimination of dead stores, and dead allocs. diff --git a/mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp b/mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp index 5a42c56..69d21c6 100644 --- a/mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp +++ b/mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp @@ -49,7 +49,7 @@ struct LoopTiling : public AffineLoopTilingBase<LoopTiling> { bool avoidMaxMinBounds = true; }; -} // end anonymous namespace +} // namespace /// Creates a pass to perform loop tiling on all suitable loop nests of a /// Function. diff --git a/mlir/lib/Dialect/Affine/Transforms/LoopUnroll.cpp b/mlir/lib/Dialect/Affine/Transforms/LoopUnroll.cpp index 9682104..f876153 100644 --- a/mlir/lib/Dialect/Affine/Transforms/LoopUnroll.cpp +++ b/mlir/lib/Dialect/Affine/Transforms/LoopUnroll.cpp @@ -59,7 +59,7 @@ struct LoopUnroll : public AffineLoopUnrollBase<LoopUnroll> { /// Unroll this for op. Returns failure if nothing was done. LogicalResult runOnAffineForOp(AffineForOp forOp); }; -} // end anonymous namespace +} // namespace /// Returns true if no other affine.for ops are nested within. static bool isInnermostAffineForOp(AffineForOp forOp) { diff --git a/mlir/lib/Dialect/Affine/Transforms/LoopUnrollAndJam.cpp b/mlir/lib/Dialect/Affine/Transforms/LoopUnrollAndJam.cpp index 76da2b0..cf8e151 100644 --- a/mlir/lib/Dialect/Affine/Transforms/LoopUnrollAndJam.cpp +++ b/mlir/lib/Dialect/Affine/Transforms/LoopUnrollAndJam.cpp @@ -61,7 +61,7 @@ struct LoopUnrollAndJam : public AffineLoopUnrollAndJamBase<LoopUnrollAndJam> { void runOnFunction() override; }; -} // end anonymous namespace +} // namespace std::unique_ptr<OperationPass<FuncOp>> mlir::createLoopUnrollAndJamPass(int unrollJamFactor) { diff --git a/mlir/lib/Dialect/Affine/Transforms/PassDetail.h b/mlir/lib/Dialect/Affine/Transforms/PassDetail.h index 3ba6fa1..c3d55a6 100644 --- a/mlir/lib/Dialect/Affine/Transforms/PassDetail.h +++ b/mlir/lib/Dialect/Affine/Transforms/PassDetail.h @@ -18,19 +18,19 @@ void registerDialect(DialectRegistry ®istry); namespace linalg { class LinalgDialect; -} // end namespace linalg +} // namespace linalg namespace memref { class MemRefDialect; -} // end namespace memref +} // namespace memref namespace vector { class VectorDialect; -} // end namespace vector +} // namespace vector #define GEN_PASS_CLASSES #include "mlir/Dialect/Affine/Passes.h.inc" -} // end namespace mlir +} // namespace mlir #endif // DIALECT_AFFINE_TRANSFORMS_PASSDETAIL_H_ diff --git a/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineStructures.cpp b/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineStructures.cpp index 2753389..04417b9 100644 --- a/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineStructures.cpp +++ b/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineStructures.cpp @@ -69,7 +69,7 @@ struct SimplifyAffineStructures DenseMap<Attribute, Attribute> simplifiedAttributes; }; -} // end anonymous namespace +} // namespace std::unique_ptr<OperationPass<FuncOp>> mlir::createSimplifyAffineStructuresPass() { diff --git a/mlir/lib/Dialect/Affine/Transforms/SuperVectorize.cpp b/mlir/lib/Dialect/Affine/Transforms/SuperVectorize.cpp index 827556d..0e41d02 100644 --- a/mlir/lib/Dialect/Affine/Transforms/SuperVectorize.cpp +++ b/mlir/lib/Dialect/Affine/Transforms/SuperVectorize.cpp @@ -611,7 +611,7 @@ struct Vectorize : public AffineVectorizeBase<Vectorize> { void runOnFunction() override; }; -} // end anonymous namespace +} // namespace Vectorize::Vectorize(ArrayRef<int64_t> virtualVectorSize) { vectorSizes = virtualVectorSize; @@ -764,7 +764,7 @@ private: void registerValueScalarReplacementImpl(Value replaced, Value replacement); }; -} // end namespace +} // namespace /// Registers the vector replacement of a scalar operation and its result /// values. Both operations must have the same number of results. diff --git a/mlir/lib/Dialect/Arithmetic/IR/ArithmeticDialect.cpp b/mlir/lib/Dialect/Arithmetic/IR/ArithmeticDialect.cpp index f65f866..ea4acbc 100644 --- a/mlir/lib/Dialect/Arithmetic/IR/ArithmeticDialect.cpp +++ b/mlir/lib/Dialect/Arithmetic/IR/ArithmeticDialect.cpp @@ -27,7 +27,7 @@ struct ArithmeticInlinerInterface : public DialectInlinerInterface { return true; } }; -} // end anonymous namespace +} // namespace void arith::ArithmeticDialect::initialize() { addOperations< diff --git a/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp b/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp index b65b152..dc4809a 100644 --- a/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp +++ b/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp @@ -73,7 +73,7 @@ static arith::CmpIPredicateAttr invertPredicate(arith::CmpIPredicateAttr pred) { namespace { #include "ArithmeticCanonicalization.inc" -} // end anonymous namespace +} // namespace //===----------------------------------------------------------------------===// // ConstantOp diff --git a/mlir/lib/Dialect/Arithmetic/Transforms/Bufferize.cpp b/mlir/lib/Dialect/Arithmetic/Transforms/Bufferize.cpp index 9a0e8c7..a7691e5 100644 --- a/mlir/lib/Dialect/Arithmetic/Transforms/Bufferize.cpp +++ b/mlir/lib/Dialect/Arithmetic/Transforms/Bufferize.cpp @@ -55,7 +55,7 @@ struct ArithmeticBufferizePass } }; -} // end anonymous namespace +} // namespace void mlir::arith::populateArithmeticBufferizePatterns( bufferization::BufferizeTypeConverter &typeConverter, diff --git a/mlir/lib/Dialect/Arithmetic/Transforms/ExpandOps.cpp b/mlir/lib/Dialect/Arithmetic/Transforms/ExpandOps.cpp index e97afac..d9ab9275 100644 --- a/mlir/lib/Dialect/Arithmetic/Transforms/ExpandOps.cpp +++ b/mlir/lib/Dialect/Arithmetic/Transforms/ExpandOps.cpp @@ -223,7 +223,7 @@ struct ArithmeticExpandOpsPass } }; -} // end anonymous namespace +} // namespace void mlir::arith::populateArithmeticExpandOpsPatterns( RewritePatternSet &patterns) { diff --git a/mlir/lib/Dialect/Arithmetic/Transforms/PassDetail.h b/mlir/lib/Dialect/Arithmetic/Transforms/PassDetail.h index 1f3f274..0947804 100644 --- a/mlir/lib/Dialect/Arithmetic/Transforms/PassDetail.h +++ b/mlir/lib/Dialect/Arithmetic/Transforms/PassDetail.h @@ -17,15 +17,15 @@ class StandardOpsDialect; namespace bufferization { class BufferizationDialect; -} // end namespace bufferization +} // namespace bufferization namespace memref { class MemRefDialect; -} // end namespace memref +} // namespace memref #define GEN_PASS_CLASSES #include "mlir/Dialect/Arithmetic/Transforms/Passes.h.inc" -} // end namespace mlir +} // namespace mlir #endif // DIALECT_ARITHMETIC_TRANSFORMS_PASSDETAIL_H_ diff --git a/mlir/lib/Dialect/Async/Transforms/PassDetail.h b/mlir/lib/Dialect/Async/Transforms/PassDetail.h index 6d23214..9eb93bb 100644 --- a/mlir/lib/Dialect/Async/Transforms/PassDetail.h +++ b/mlir/lib/Dialect/Async/Transforms/PassDetail.h @@ -16,7 +16,7 @@ namespace mlir { namespace arith { class ArithmeticDialect; -} // end namespace arith +} // namespace arith namespace async { class AsyncDialect; diff --git a/mlir/lib/Dialect/Bufferization/IR/BufferizationDialect.cpp b/mlir/lib/Dialect/Bufferization/IR/BufferizationDialect.cpp index 84980bf..601ba95 100644 --- a/mlir/lib/Dialect/Bufferization/IR/BufferizationDialect.cpp +++ b/mlir/lib/Dialect/Bufferization/IR/BufferizationDialect.cpp @@ -28,7 +28,7 @@ struct BufferizationInlinerInterface : public DialectInlinerInterface { return true; } }; -} // end anonymous namespace +} // namespace //===----------------------------------------------------------------------===// // Bufferization Dialect diff --git a/mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp b/mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp index 5f93007..f81d726 100644 --- a/mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp +++ b/mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp @@ -100,7 +100,7 @@ struct SimplifyClones : public OpRewritePattern<CloneOp> { } }; -} // namespace. +} // namespace void CloneOp::getCanonicalizationPatterns(OwningRewritePatternList &results, MLIRContext *context) { diff --git a/mlir/lib/Dialect/Bufferization/Transforms/BufferDeallocation.cpp b/mlir/lib/Dialect/Bufferization/Transforms/BufferDeallocation.cpp index d82170b..49a39b6 100644 --- a/mlir/lib/Dialect/Bufferization/Transforms/BufferDeallocation.cpp +++ b/mlir/lib/Dialect/Bufferization/Transforms/BufferDeallocation.cpp @@ -665,7 +665,7 @@ struct BufferDeallocationPass : BufferDeallocationBase<BufferDeallocationPass> { } }; -} // end anonymous namespace +} // namespace //===----------------------------------------------------------------------===// // BufferDeallocationPass construction diff --git a/mlir/lib/Dialect/Bufferization/Transforms/PassDetail.h b/mlir/lib/Dialect/Bufferization/Transforms/PassDetail.h index 4565707..37f8811 100644 --- a/mlir/lib/Dialect/Bufferization/Transforms/PassDetail.h +++ b/mlir/lib/Dialect/Bufferization/Transforms/PassDetail.h @@ -17,15 +17,15 @@ class StandardOpsDialect; namespace bufferization { class BufferizationDialect; -} // end namespace bufferization +} // namespace bufferization namespace memref { class MemRefDialect; -} // end namespace memref +} // namespace memref #define GEN_PASS_CLASSES #include "mlir/Dialect/Bufferization/Transforms/Passes.h.inc" -} // end namespace mlir +} // namespace mlir #endif // DIALECT_BUFFERIZATION_TRANSFORMS_PASSDETAIL_H_ diff --git a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp index dc1949f..579c385 100644 --- a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp +++ b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp @@ -1177,7 +1177,7 @@ struct SimplifyDimOfAllocOp : public OpRewritePattern<memref::DimOp> { } }; -} // end anonymous namespace. +} // namespace void AllocOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { diff --git a/mlir/lib/Dialect/GPU/Transforms/PassDetail.h b/mlir/lib/Dialect/GPU/Transforms/PassDetail.h index c83ac30..ab352a0 100644 --- a/mlir/lib/Dialect/GPU/Transforms/PassDetail.h +++ b/mlir/lib/Dialect/GPU/Transforms/PassDetail.h @@ -17,6 +17,6 @@ namespace mlir { #define GEN_PASS_CLASSES #include "mlir/Dialect/GPU/Passes.h.inc" -} // end namespace mlir +} // namespace mlir #endif // DIALECT_GPU_TRANSFORMS_PASSDETAIL_H_ diff --git a/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp b/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp index e8ad4ec..6f488b0 100644 --- a/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp +++ b/mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp @@ -104,7 +104,7 @@ private: std::string getRocmPath(); }; -} // end namespace +} // namespace SerializeToHsacoPass::SerializeToHsacoPass(const SerializeToHsacoPass &other) : PassWrapper<SerializeToHsacoPass, gpu::SerializeToBlobPass>(other) {} diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp index 2c320a3..1688fa4 100644 --- a/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp +++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp @@ -1502,7 +1502,7 @@ struct EnumTraits {}; REGISTER_ENUM_TYPE(Linkage); REGISTER_ENUM_TYPE(UnnamedAddr); -} // end namespace +} // namespace /// Parse an enum from the keyword, or default to the provided default value. /// The return type is the enum type by default, unless overriden with the diff --git a/mlir/lib/Dialect/LLVMIR/IR/TypeDetail.h b/mlir/lib/Dialect/LLVMIR/IR/TypeDetail.h index cf8e468..0481d15 100644 --- a/mlir/lib/Dialect/LLVMIR/IR/TypeDetail.h +++ b/mlir/lib/Dialect/LLVMIR/IR/TypeDetail.h @@ -426,8 +426,8 @@ struct LLVMTypeAndSizeStorage : public TypeStorage { unsigned numElements; }; -} // end namespace detail -} // end namespace LLVM -} // end namespace mlir +} // namespace detail +} // namespace LLVM +} // namespace mlir #endif // DIALECT_LLVMIR_IR_TYPEDETAIL_H diff --git a/mlir/lib/Dialect/LLVMIR/Transforms/LegalizeForExport.cpp b/mlir/lib/Dialect/LLVMIR/Transforms/LegalizeForExport.cpp index 93b400f..3bf306d 100644 --- a/mlir/lib/Dialect/LLVMIR/Transforms/LegalizeForExport.cpp +++ b/mlir/lib/Dialect/LLVMIR/Transforms/LegalizeForExport.cpp @@ -63,7 +63,7 @@ struct LegalizeForExportPass LLVM::ensureDistinctSuccessors(getOperation()); } }; -} // end namespace +} // namespace std::unique_ptr<Pass> LLVM::createLegalizeForExportPass() { return std::make_unique<LegalizeForExportPass>(); diff --git a/mlir/lib/Dialect/LLVMIR/Transforms/PassDetail.h b/mlir/lib/Dialect/LLVMIR/Transforms/PassDetail.h index 2a46e12..8449f77 100644 --- a/mlir/lib/Dialect/LLVMIR/Transforms/PassDetail.h +++ b/mlir/lib/Dialect/LLVMIR/Transforms/PassDetail.h @@ -16,6 +16,6 @@ namespace mlir { #define GEN_PASS_CLASSES #include "mlir/Dialect/LLVMIR/Transforms/Passes.h.inc" -} // end namespace mlir +} // namespace mlir #endif // DIALECT_LLVMIR_TRANSFORMS_PASSDETAIL_H_ diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgTypes.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgTypes.cpp index 4ea37ce..4d00435 100644 --- a/mlir/lib/Dialect/Linalg/IR/LinalgTypes.cpp +++ b/mlir/lib/Dialect/Linalg/IR/LinalgTypes.cpp @@ -53,7 +53,7 @@ struct LinalgInlinerInterface : public DialectInlinerInterface { ArrayRef<Value> valuesToRepl) const final {} }; -} // end anonymous namespace +} // namespace //===----------------------------------------------------------------------===// // LinalgDialect diff --git a/mlir/lib/Dialect/Linalg/Transforms/Bufferize.cpp b/mlir/lib/Dialect/Linalg/Transforms/Bufferize.cpp index ede2f96..bd6e8cd 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/Bufferize.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Bufferize.cpp @@ -339,7 +339,7 @@ struct LinalgBufferizePass : public LinalgBufferizeBase<LinalgBufferizePass> { signalPassFailure(); } }; -} // end anonymous namespace +} // namespace std::unique_ptr<OperationPass<FuncOp>> mlir::createLinalgBufferizePass() { return std::make_unique<LinalgBufferizePass>(); diff --git a/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferizePass.cpp b/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferizePass.cpp index f90b5e5..58f5845 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferizePass.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferizePass.cpp @@ -56,7 +56,7 @@ struct LinalgComprehensiveModuleBufferize vector_ext::registerBufferizableOpInterfaceExternalModels(registry); } }; -} // end namespace +} // namespace static void applyEnablingTransformations(ModuleOp moduleOp) { RewritePatternSet patterns(moduleOp.getContext()); diff --git a/mlir/lib/Dialect/Linalg/Transforms/PassDetail.h b/mlir/lib/Dialect/Linalg/Transforms/PassDetail.h index 01a8d14..b499dbb 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/PassDetail.h +++ b/mlir/lib/Dialect/Linalg/Transforms/PassDetail.h @@ -20,31 +20,31 @@ void registerDialect(DialectRegistry ®istry); namespace arith { class ArithmeticDialect; -} // end namespace arith +} // namespace arith namespace bufferization { class BufferizationDialect; -} // end namespace bufferization +} // namespace bufferization namespace linalg { class LinalgDialect; -} // end namespace linalg +} // namespace linalg namespace scf { class SCFDialect; -} // end namespace scf +} // namespace scf namespace memref { class MemRefDialect; -} // end namespace memref +} // namespace memref namespace vector { class VectorDialect; -} // end namespace vector +} // namespace vector #define GEN_PASS_CLASSES #include "mlir/Dialect/Linalg/Passes.h.inc" -} // end namespace mlir +} // namespace mlir #endif // DIALECT_LINALG_TRANSFORMS_PASSDETAIL_H_ diff --git a/mlir/lib/Dialect/Math/IR/MathDialect.cpp b/mlir/lib/Dialect/Math/IR/MathDialect.cpp index eb21400..0f7307c 100644 --- a/mlir/lib/Dialect/Math/IR/MathDialect.cpp +++ b/mlir/lib/Dialect/Math/IR/MathDialect.cpp @@ -26,7 +26,7 @@ struct MathInlinerInterface : public DialectInlinerInterface { return true; } }; -} // end anonymous namespace +} // namespace void mlir::math::MathDialect::initialize() { addOperations< diff --git a/mlir/lib/Dialect/MemRef/IR/MemRefDialect.cpp b/mlir/lib/Dialect/MemRef/IR/MemRefDialect.cpp index 057cb46..f273558 100644 --- a/mlir/lib/Dialect/MemRef/IR/MemRefDialect.cpp +++ b/mlir/lib/Dialect/MemRef/IR/MemRefDialect.cpp @@ -30,7 +30,7 @@ struct MemRefInlinerInterface : public DialectInlinerInterface { return true; } }; -} // end anonymous namespace +} // namespace void mlir::memref::MemRefDialect::initialize() { addOperations< diff --git a/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp b/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp index 938197d..b9a7812 100644 --- a/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp +++ b/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp @@ -191,7 +191,7 @@ struct SimplifyDeadAlloc : public OpRewritePattern<T> { return success(); } }; -} // end anonymous namespace. +} // namespace void AllocOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { @@ -676,7 +676,7 @@ struct DimOfMemRefReshape : public OpRewritePattern<DimOp> { } }; -} // end anonymous namespace. +} // namespace void DimOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { @@ -1473,8 +1473,8 @@ Wrapper operator*(Wrapper a, int64_t b) { return Wrapper(ShapedType::kDynamicStrideOrOffset); return Wrapper(a.v * b); } -} // end namespace saturated_arith -} // end namespace +} // namespace saturated_arith +} // namespace /// A subview result type can be fully inferred from the source type and the /// static representation of offsets, sizes and strides. Special sentinels @@ -2190,7 +2190,7 @@ struct ViewOpMemrefCastFolder : public OpRewritePattern<ViewOp> { } }; -} // end anonymous namespace +} // namespace void ViewOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { diff --git a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp index 31475ec..96f6ea5 100644 --- a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp +++ b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp @@ -40,7 +40,7 @@ struct PointerLikeModel return pointer.cast<T>().getElementType(); } }; -} // end namespace +} // namespace void OpenMPDialect::initialize() { addOperations< diff --git a/mlir/lib/Dialect/Quant/Transforms/ConvertConst.cpp b/mlir/lib/Dialect/Quant/Transforms/ConvertConst.cpp index 2c6299f..64844ef3 100644 --- a/mlir/lib/Dialect/Quant/Transforms/ConvertConst.cpp +++ b/mlir/lib/Dialect/Quant/Transforms/ConvertConst.cpp @@ -32,7 +32,7 @@ struct QuantizedConstRewrite : public OpRewritePattern<QuantizeCastOp> { PatternRewriter &rewriter) const override; }; -} // end anonymous namespace +} // namespace /// Matches a [constant] -> [qbarrier] where the qbarrier results type is /// quantized and the operand type is quantizable. diff --git a/mlir/lib/Dialect/Quant/Transforms/PassDetail.h b/mlir/lib/Dialect/Quant/Transforms/PassDetail.h index 8727bfc..4d6fb3e 100644 --- a/mlir/lib/Dialect/Quant/Transforms/PassDetail.h +++ b/mlir/lib/Dialect/Quant/Transforms/PassDetail.h @@ -16,6 +16,6 @@ namespace mlir { #define GEN_PASS_CLASSES #include "mlir/Dialect/Quant/Passes.h.inc" -} // end namespace mlir +} // namespace mlir #endif // DIALECT_QUANT_TRANSFORMS_PASSDETAIL_H_ diff --git a/mlir/lib/Dialect/SCF/SCF.cpp b/mlir/lib/Dialect/SCF/SCF.cpp index e28accc..c7f1436 100644 --- a/mlir/lib/Dialect/SCF/SCF.cpp +++ b/mlir/lib/Dialect/SCF/SCF.cpp @@ -54,7 +54,7 @@ struct SCFInlinerInterface : public DialectInlinerInterface { } } }; -} // end anonymous namespace +} // namespace //===----------------------------------------------------------------------===// // SCFDialect diff --git a/mlir/lib/Dialect/SCF/Transforms/Bufferize.cpp b/mlir/lib/Dialect/SCF/Transforms/Bufferize.cpp index 399a5b1..a3f9b5b 100644 --- a/mlir/lib/Dialect/SCF/Transforms/Bufferize.cpp +++ b/mlir/lib/Dialect/SCF/Transforms/Bufferize.cpp @@ -36,7 +36,7 @@ struct SCFBufferizePass : public SCFBufferizeBase<SCFBufferizePass> { return signalPassFailure(); }; }; -} // end anonymous namespace +} // namespace std::unique_ptr<Pass> mlir::createSCFBufferizePass() { return std::make_unique<SCFBufferizePass>(); diff --git a/mlir/lib/Dialect/SCF/Transforms/PassDetail.h b/mlir/lib/Dialect/SCF/Transforms/PassDetail.h index 7dfdb20..49f67c2 100644 --- a/mlir/lib/Dialect/SCF/Transforms/PassDetail.h +++ b/mlir/lib/Dialect/SCF/Transforms/PassDetail.h @@ -20,23 +20,23 @@ class AffineDialect; namespace arith { class ArithmeticDialect; -} // end namespace arith +} // namespace arith namespace bufferization { class BufferizationDialect; -} // end namespace bufferization +} // namespace bufferization namespace memref { class MemRefDialect; -} // end namespace memref +} // namespace memref namespace tensor { class TensorDialect; -} // end namespace tensor +} // namespace tensor #define GEN_PASS_CLASSES #include "mlir/Dialect/SCF/Passes.h.inc" -} // end namespace mlir +} // namespace mlir #endif // DIALECT_LOOPOPS_TRANSFORMS_PASSDETAIL_H_ diff --git a/mlir/lib/Dialect/SPIRV/IR/SPIRVCanonicalization.cpp b/mlir/lib/Dialect/SPIRV/IR/SPIRVCanonicalization.cpp index c512586..0588549 100644 --- a/mlir/lib/Dialect/SPIRV/IR/SPIRVCanonicalization.cpp +++ b/mlir/lib/Dialect/SPIRV/IR/SPIRVCanonicalization.cpp @@ -108,7 +108,7 @@ struct CombineChainedAccessChain return success(); } }; -} // end anonymous namespace +} // namespace void spirv::AccessChainOp::getCanonicalizationPatterns( RewritePatternSet &results, MLIRContext *context) { @@ -414,7 +414,7 @@ LogicalResult ConvertSelectionOpToSelect::canCanonicalizeSelection( return success(); } -} // end anonymous namespace +} // namespace void spirv::SelectionOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { diff --git a/mlir/lib/Dialect/SPIRV/IR/SPIRVGLSLCanonicalization.cpp b/mlir/lib/Dialect/SPIRV/IR/SPIRVGLSLCanonicalization.cpp index 9c72dbb..ccd4c1d 100644 --- a/mlir/lib/Dialect/SPIRV/IR/SPIRVGLSLCanonicalization.cpp +++ b/mlir/lib/Dialect/SPIRV/IR/SPIRVGLSLCanonicalization.cpp @@ -18,7 +18,7 @@ using namespace mlir; namespace { #include "SPIRVCanonicalization.inc" -} // end anonymous namespace +} // namespace namespace mlir { namespace spirv { diff --git a/mlir/lib/Dialect/SPIRV/Transforms/PassDetail.h b/mlir/lib/Dialect/SPIRV/Transforms/PassDetail.h index cb4f01f..da4f3c5 100644 --- a/mlir/lib/Dialect/SPIRV/Transforms/PassDetail.h +++ b/mlir/lib/Dialect/SPIRV/Transforms/PassDetail.h @@ -15,11 +15,11 @@ namespace mlir { namespace spirv { class ModuleOp; -} // end namespace spirv +} // namespace spirv #define GEN_PASS_CLASSES #include "mlir/Dialect/SPIRV/Transforms/Passes.h.inc" -} // end namespace mlir +} // namespace mlir #endif // DIALECT_SPIRV_TRANSFORMS_PASSDETAIL_H_ diff --git a/mlir/lib/Dialect/SPIRV/Transforms/RewriteInsertsPass.cpp b/mlir/lib/Dialect/SPIRV/Transforms/RewriteInsertsPass.cpp index b89312f..c381ee5 100644 --- a/mlir/lib/Dialect/SPIRV/Transforms/RewriteInsertsPass.cpp +++ b/mlir/lib/Dialect/SPIRV/Transforms/RewriteInsertsPass.cpp @@ -38,7 +38,7 @@ private: SmallVectorImpl<spirv::CompositeInsertOp> &insertions); }; -} // anonymous namespace +} // namespace void RewriteInsertsPass::runOnOperation() { SmallVector<SmallVector<spirv::CompositeInsertOp, 4>, 4> workList; diff --git a/mlir/lib/Dialect/Shape/Transforms/PassDetail.h b/mlir/lib/Dialect/Shape/Transforms/PassDetail.h index 6f130c8..d1d54b9 100644 --- a/mlir/lib/Dialect/Shape/Transforms/PassDetail.h +++ b/mlir/lib/Dialect/Shape/Transforms/PassDetail.h @@ -15,15 +15,15 @@ namespace mlir { namespace bufferization { class BufferizationDialect; -} // end namespace bufferization +} // namespace bufferization namespace memref { class MemRefDialect; -} // end namespace memref +} // namespace memref #define GEN_PASS_CLASSES #include "mlir/Dialect/Shape/Transforms/Passes.h.inc" -} // end namespace mlir +} // namespace mlir #endif // DIALECT_SHAPE_TRANSFORMS_PASSDETAIL_H_ diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp index 5e5d056..8404aa6 100644 --- a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp +++ b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp @@ -134,7 +134,7 @@ struct SparseTensorConversionPass } }; -} // end anonymous namespace +} // namespace std::unique_ptr<Pass> mlir::createSparsificationPass() { return std::make_unique<SparsificationPass>(); diff --git a/mlir/lib/Dialect/StandardOps/IR/Ops.cpp b/mlir/lib/Dialect/StandardOps/IR/Ops.cpp index a974a4f..1a43c09 100644 --- a/mlir/lib/Dialect/StandardOps/IR/Ops.cpp +++ b/mlir/lib/Dialect/StandardOps/IR/Ops.cpp @@ -94,7 +94,7 @@ struct StdInlinerInterface : public DialectInlinerInterface { valuesToRepl[it.index()].replaceAllUsesWith(it.value()); } }; -} // end anonymous namespace +} // namespace //===----------------------------------------------------------------------===// // StandardOpsDialect @@ -749,7 +749,7 @@ struct CondBranchTruthPropagation : public OpRewritePattern<CondBranchOp> { return success(replaced); } }; -} // end anonymous namespace +} // namespace void CondBranchOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { diff --git a/mlir/lib/Dialect/StandardOps/Transforms/FuncConversions.cpp b/mlir/lib/Dialect/StandardOps/Transforms/FuncConversions.cpp index 58dda48..2cd22ef 100644 --- a/mlir/lib/Dialect/StandardOps/Transforms/FuncConversions.cpp +++ b/mlir/lib/Dialect/StandardOps/Transforms/FuncConversions.cpp @@ -35,7 +35,7 @@ struct CallOpSignatureConversion : public OpConversionPattern<CallOp> { return success(); } }; -} // end anonymous namespace +} // namespace void mlir::populateCallOpTypeConversionPattern(RewritePatternSet &patterns, TypeConverter &converter) { @@ -85,7 +85,7 @@ public: private: function_ref<bool(BranchOpInterface, int)> shouldConvertBranchOperand; }; -} // end anonymous namespace +} // namespace namespace { /// Only needed to support partial conversion of functions where this pattern @@ -105,7 +105,7 @@ public: return success(); } }; -} // end anonymous namespace +} // namespace void mlir::populateBranchOpInterfaceTypeConversionPattern( RewritePatternSet &patterns, TypeConverter &typeConverter, diff --git a/mlir/lib/Dialect/StandardOps/Transforms/PassDetail.h b/mlir/lib/Dialect/StandardOps/Transforms/PassDetail.h index 38bf42c..eadd026 100644 --- a/mlir/lib/Dialect/StandardOps/Transforms/PassDetail.h +++ b/mlir/lib/Dialect/StandardOps/Transforms/PassDetail.h @@ -18,15 +18,15 @@ class AtomicRMWOp; namespace bufferization { class BufferizationDialect; -} // end namespace bufferization +} // namespace bufferization namespace memref { class MemRefDialect; -} // end namespace memref +} // namespace memref #define GEN_PASS_CLASSES #include "mlir/Dialect/StandardOps/Transforms/Passes.h.inc" -} // end namespace mlir +} // namespace mlir #endif // DIALECT_STANDARD_TRANSFORMS_PASSDETAIL_H_ diff --git a/mlir/lib/Dialect/Tensor/IR/TensorDialect.cpp b/mlir/lib/Dialect/Tensor/IR/TensorDialect.cpp index 860e0b8..0c18089 100644 --- a/mlir/lib/Dialect/Tensor/IR/TensorDialect.cpp +++ b/mlir/lib/Dialect/Tensor/IR/TensorDialect.cpp @@ -30,7 +30,7 @@ struct TensorInlinerInterface : public DialectInlinerInterface { return true; } }; -} // end anonymous namespace +} // namespace //===----------------------------------------------------------------------===// // TensorDialect Methods diff --git a/mlir/lib/Dialect/Tensor/IR/TensorOps.cpp b/mlir/lib/Dialect/Tensor/IR/TensorOps.cpp index 7f1bd74..6edfe47 100644 --- a/mlir/lib/Dialect/Tensor/IR/TensorOps.cpp +++ b/mlir/lib/Dialect/Tensor/IR/TensorOps.cpp @@ -313,7 +313,7 @@ struct DimOfCastOp : public OpRewritePattern<DimOp> { return success(); } }; -} // end anonymous namespace. +} // namespace void DimOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { diff --git a/mlir/lib/Dialect/Tensor/Transforms/PassDetail.h b/mlir/lib/Dialect/Tensor/Transforms/PassDetail.h index 5c95f24..858a0eb 100644 --- a/mlir/lib/Dialect/Tensor/Transforms/PassDetail.h +++ b/mlir/lib/Dialect/Tensor/Transforms/PassDetail.h @@ -15,19 +15,19 @@ namespace mlir { namespace bufferization { class BufferizationDialect; -} // end namespace bufferization +} // namespace bufferization namespace memref { class MemRefDialect; -} // end namespace memref +} // namespace memref namespace scf { class SCFDialect; -} // end namespace scf +} // namespace scf #define GEN_PASS_CLASSES #include "mlir/Dialect/Tensor/Transforms/Passes.h.inc" -} // end namespace mlir +} // namespace mlir #endif // DIALECT_TENSOR_TRANSFORMS_PASSDETAIL_H_ diff --git a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp index 601e660..898bc25 100644 --- a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp +++ b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp @@ -60,7 +60,7 @@ struct TosaInlinerInterface : public DialectInlinerInterface { isa<tosa::WhileOp>(dest->getParentOp())); } }; -} // end anonymous namespace +} // namespace //===----------------------------------------------------------------------===// // TOSA control flow support. diff --git a/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeTransposeConv.cpp b/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeTransposeConv.cpp index c1fcca2..e623089 100644 --- a/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeTransposeConv.cpp +++ b/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeTransposeConv.cpp @@ -383,7 +383,7 @@ public: (void)applyPatternsAndFoldGreedily(func, std::move(patterns)); } }; -} // end anonymous namespace +} // namespace std::unique_ptr<Pass> mlir::tosa::createTosaDecomposeTransposeConvPass() { return std::make_unique<TosaDecomposeTransposeConv>(); diff --git a/mlir/lib/Dialect/Tosa/Transforms/TosaInferShapes.cpp b/mlir/lib/Dialect/Tosa/Transforms/TosaInferShapes.cpp index cd94be1..33a1e34 100644 --- a/mlir/lib/Dialect/Tosa/Transforms/TosaInferShapes.cpp +++ b/mlir/lib/Dialect/Tosa/Transforms/TosaInferShapes.cpp @@ -320,7 +320,7 @@ public: }); } }; -} // end anonymous namespace +} // namespace std::unique_ptr<Pass> mlir::tosa::createTosaInferShapesPass() { return std::make_unique<TosaInferShapes>(); diff --git a/mlir/lib/Dialect/Tosa/Transforms/TosaMakeBroadcastable.cpp b/mlir/lib/Dialect/Tosa/Transforms/TosaMakeBroadcastable.cpp index 36b2287..d3b2297 100644 --- a/mlir/lib/Dialect/Tosa/Transforms/TosaMakeBroadcastable.cpp +++ b/mlir/lib/Dialect/Tosa/Transforms/TosaMakeBroadcastable.cpp @@ -227,7 +227,7 @@ struct ConvertTosaOp<tosa::ArithmeticRightShiftOp> return success(); } }; -} // end anonymous namespace +} // namespace namespace { /// Pass that enables broadcast by making all input arrays have the same @@ -262,7 +262,7 @@ public: (void)applyPatternsAndFoldGreedily(func, std::move(patterns)); } }; -} // end anonymous namespace +} // namespace std::unique_ptr<Pass> mlir::tosa::createTosaMakeBroadcastablePass() { return std::make_unique<TosaMakeBroadcastable>(); diff --git a/mlir/lib/Dialect/Vector/VectorOps.cpp b/mlir/lib/Dialect/Vector/VectorOps.cpp index bbe7b74..9768483 100644 --- a/mlir/lib/Dialect/Vector/VectorOps.cpp +++ b/mlir/lib/Dialect/Vector/VectorOps.cpp @@ -2302,7 +2302,7 @@ public: } }; -} // end anonymous namespace +} // namespace void ExtractStridedSliceOp::getCanonicalizationPatterns( RewritePatternSet &results, MLIRContext *context) { @@ -3910,7 +3910,7 @@ public: } }; -} // end anonymous namespace +} // namespace void vector::TransposeOp::getCanonicalizationPatterns( RewritePatternSet &results, MLIRContext *context) { @@ -4005,7 +4005,7 @@ public: } }; -} // end anonymous namespace +} // namespace void CreateMaskOp::getCanonicalizationPatterns(RewritePatternSet &results, MLIRContext *context) { diff --git a/mlir/lib/ExecutionEngine/JitRunner.cpp b/mlir/lib/ExecutionEngine/JitRunner.cpp index 5ecce56..e45e5c9 100644 --- a/mlir/lib/ExecutionEngine/JitRunner.cpp +++ b/mlir/lib/ExecutionEngine/JitRunner.cpp @@ -108,7 +108,7 @@ struct CompileAndExecuteConfig { runtimeSymbolMap; }; -} // end anonymous namespace +} // namespace static OwningModuleRef parseMLIRInput(StringRef inputFilename, MLIRContext *context) { diff --git a/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp b/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp index 193e305..9a5c8e4 100644 --- a/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp +++ b/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp @@ -681,7 +681,7 @@ static SparseTensorCOO<V> *openSparseTensorCOO(char *filename, uint64_t rank, return tensor; } -} // anonymous namespace +} // namespace extern "C" { diff --git a/mlir/lib/IR/AffineExprDetail.h b/mlir/lib/IR/AffineExprDetail.h index 1c38e54..dfc1054 100644 --- a/mlir/lib/IR/AffineExprDetail.h +++ b/mlir/lib/IR/AffineExprDetail.h @@ -92,6 +92,6 @@ struct AffineConstantExprStorage : public AffineExprStorage { int64_t constant; }; -} // end namespace detail -} // end namespace mlir +} // namespace detail +} // namespace mlir #endif // MLIR_IR_AFFINEEXPRDETAIL_H_ diff --git a/mlir/lib/IR/AffineMap.cpp b/mlir/lib/IR/AffineMap.cpp index 153742f..686dbe8 100644 --- a/mlir/lib/IR/AffineMap.cpp +++ b/mlir/lib/IR/AffineMap.cpp @@ -89,7 +89,7 @@ private: ArrayRef<Attribute> operandConsts; }; -} // end anonymous namespace +} // namespace /// Returns a single constant result affine map. AffineMap AffineMap::getConstantMap(int64_t val, MLIRContext *context) { diff --git a/mlir/lib/IR/AffineMapDetail.h b/mlir/lib/IR/AffineMapDetail.h index d3090e3..c0a906b 100644 --- a/mlir/lib/IR/AffineMapDetail.h +++ b/mlir/lib/IR/AffineMapDetail.h @@ -51,7 +51,7 @@ struct AffineMapStorage : public StorageUniquer::BaseStorage { } }; -} // end namespace detail -} // end namespace mlir +} // namespace detail +} // namespace mlir #endif // AFFINEMAPDETAIL_H_ diff --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp index d3c239d..5d5f896 100644 --- a/mlir/lib/IR/AsmPrinter.cpp +++ b/mlir/lib/IR/AsmPrinter.cpp @@ -146,7 +146,7 @@ struct AsmPrinterOptions { llvm::cl::desc("Print assuming in local scope by default"), llvm::cl::Hidden}; }; -} // end anonymous namespace +} // namespace static llvm::ManagedStatic<AsmPrinterOptions> clOptions; @@ -267,7 +267,7 @@ static raw_ostream &operator<<(raw_ostream &os, NewLineCounter &newLine) { ++newLine.curLine; return os << '\n'; } -} // end anonymous namespace +} // namespace //===----------------------------------------------------------------------===// // AliasInitializer @@ -538,7 +538,7 @@ private: /// A dummy output stream. mutable llvm::raw_null_ostream os; }; -} // end anonymous namespace +} // namespace /// Sanitize the given name such that it can be used as a valid identifier. If /// the string needs to be modified in any way, the provided buffer is used to @@ -745,7 +745,7 @@ private: /// An allocator used for alias names. llvm::BumpPtrAllocator aliasAllocator; }; -} // end anonymous namespace +} // namespace void AliasState::initialize( Operation *op, const OpPrintingFlags &printerFlags, @@ -869,7 +869,7 @@ private: DialectInterfaceCollection<OpAsmDialectInterface> &interfaces; }; -} // end anonymous namespace +} // namespace SSANameState::SSANameState( Operation *op, const OpPrintingFlags &printerFlags, @@ -1215,8 +1215,8 @@ private: /// An optional location map to be populated. AsmState::LocationMap *locationMap; }; -} // end namespace detail -} // end namespace mlir +} // namespace detail +} // namespace mlir AsmState::AsmState(Operation *op, const OpPrintingFlags &printerFlags, LocationMap *locationMap) @@ -2479,7 +2479,7 @@ private: // This is the current indentation level for nested structures. unsigned currentIndent = 0; }; -} // end anonymous namespace +} // namespace void OperationPrinter::printTopLevelOperation(Operation *op) { // Output the aliases at the top level that can't be deferred. diff --git a/mlir/lib/IR/BuiltinDialect.cpp b/mlir/lib/IR/BuiltinDialect.cpp index 53d5608..2fa4baa 100644 --- a/mlir/lib/IR/BuiltinDialect.cpp +++ b/mlir/lib/IR/BuiltinDialect.cpp @@ -59,7 +59,7 @@ struct BuiltinOpAsmDialectInterface : public OpAsmDialectInterface { return AliasResult::NoAlias; } }; -} // end anonymous namespace. +} // namespace void BuiltinDialect::initialize() { registerTypes(); diff --git a/mlir/lib/IR/Diagnostics.cpp b/mlir/lib/IR/Diagnostics.cpp index 8400870..fc25258 100644 --- a/mlir/lib/IR/Diagnostics.cpp +++ b/mlir/lib/IR/Diagnostics.cpp @@ -372,8 +372,8 @@ struct SourceMgrDiagnosticHandlerImpl { /// Mapping between file name and buffer ID's. llvm::StringMap<unsigned> filenameToBufId; }; -} // end namespace detail -} // end namespace mlir +} // namespace detail +} // namespace mlir /// Return a processable FileLineColLoc from the given location. static Optional<FileLineColLoc> getFileLineColLoc(Location loc) { @@ -610,8 +610,8 @@ struct SourceMgrDiagnosticVerifierHandlerImpl { llvm::Regex expected = llvm::Regex("expected-(error|note|remark|warning) " "*(@([+-][0-9]+|above|below))? *{{(.*)}}"); }; -} // end namespace detail -} // end namespace mlir +} // namespace detail +} // namespace mlir /// Given a diagnostic kind, return a human readable string for it. static StringRef getDiagKindStr(DiagnosticSeverity kind) { @@ -947,8 +947,8 @@ struct ParallelDiagnosticHandlerImpl : public llvm::PrettyStackTraceEntry { /// The context to emit the diagnostics to. MLIRContext *context; }; -} // end namespace detail -} // end namespace mlir +} // namespace detail +} // namespace mlir ParallelDiagnosticHandler::ParallelDiagnosticHandler(MLIRContext *ctx) : impl(new ParallelDiagnosticHandlerImpl(ctx)) {} diff --git a/mlir/lib/IR/Dialect.cpp b/mlir/lib/IR/Dialect.cpp index 56bd669..631dc41 100644 --- a/mlir/lib/IR/Dialect.cpp +++ b/mlir/lib/IR/Dialect.cpp @@ -178,7 +178,7 @@ Dialect::getOperationPrinter(Operation *op) const { } /// Utility function that returns if the given string is a valid dialect -/// namespace. +/// namespace bool Dialect::isValidNamespace(StringRef str) { llvm::Regex dialectNameRegex("^[a-zA-Z_][a-zA-Z_0-9\\$]*$"); return dialectNameRegex.match(str); diff --git a/mlir/lib/IR/IntegerSetDetail.h b/mlir/lib/IR/IntegerSetDetail.h index 451c159..262617d 100644 --- a/mlir/lib/IR/IntegerSetDetail.h +++ b/mlir/lib/IR/IntegerSetDetail.h @@ -52,6 +52,6 @@ struct IntegerSetStorage : public StorageUniquer::BaseStorage { } }; -} // end namespace detail -} // end namespace mlir +} // namespace detail +} // namespace mlir #endif // INTEGERSETDETAIL_H_ diff --git a/mlir/lib/IR/MLIRContext.cpp b/mlir/lib/IR/MLIRContext.cpp index 670faf1..1e10d60 100644 --- a/mlir/lib/IR/MLIRContext.cpp +++ b/mlir/lib/IR/MLIRContext.cpp @@ -71,7 +71,7 @@ struct MLIRContextOptions { llvm::cl::desc("When a diagnostic is emitted, also print the stack trace " "as an attached note")}; }; -} // end anonymous namespace +} // namespace static llvm::ManagedStatic<MLIRContextOptions> clOptions; @@ -110,7 +110,7 @@ struct ScopedWriterLock { } llvm::sys::SmartRWMutex<true> *mutex; }; -} // end anonymous namespace. +} // namespace //===----------------------------------------------------------------------===// // MLIRContextImpl @@ -250,7 +250,7 @@ public: attrMapping.second->~AbstractAttribute(); } }; -} // end namespace mlir +} // namespace mlir MLIRContext::MLIRContext(Threading setting) : MLIRContext(DialectRegistry(), setting) {} diff --git a/mlir/lib/IR/SymbolTable.cpp b/mlir/lib/IR/SymbolTable.cpp index 1dbb116..961f6c1 100644 --- a/mlir/lib/IR/SymbolTable.cpp +++ b/mlir/lib/IR/SymbolTable.cpp @@ -619,7 +619,7 @@ struct SymbolScope { /// The IR unit representing this scope. llvm::PointerUnion<Operation *, Region *> limit; }; -} // end anonymous namespace +} // namespace /// Collect all of the symbol scopes from 'symbol' to (inclusive) 'limit'. static SmallVector<SymbolScope, 2> collectSymbolScopes(Operation *symbol, diff --git a/mlir/lib/IR/Verifier.cpp b/mlir/lib/IR/Verifier.cpp index f041f9e..840a315 100644 --- a/mlir/lib/IR/Verifier.cpp +++ b/mlir/lib/IR/Verifier.cpp @@ -62,7 +62,7 @@ private: LogicalResult verifyDominanceOfContainedRegions(Operation &op, DominanceInfo &domInfo); }; -} // end anonymous namespace +} // namespace LogicalResult OperationVerifier::verifyOpAndDominance(Operation &op) { SmallVector<Operation *> opsWithIsolatedRegions; diff --git a/mlir/lib/Parser/AffineParser.cpp b/mlir/lib/Parser/AffineParser.cpp index 80cf470..e8c4a02 100644 --- a/mlir/lib/Parser/AffineParser.cpp +++ b/mlir/lib/Parser/AffineParser.cpp @@ -99,7 +99,7 @@ private: unsigned numSymbolOperands; SmallVector<std::pair<StringRef, AffineExpr>, 4> dimsAndSymbols; }; -} // end anonymous namespace +} // namespace /// Create an affine binary high precedence op expression (mul's, div's, mod). /// opLoc is the location of the op token to be used to report errors diff --git a/mlir/lib/Parser/AsmParserImpl.h b/mlir/lib/Parser/AsmParserImpl.h index e8c70b7..7bbbbc7 100644 --- a/mlir/lib/Parser/AsmParserImpl.h +++ b/mlir/lib/Parser/AsmParserImpl.h @@ -516,6 +516,6 @@ protected: bool emittedError = false; }; } // namespace detail -} // end namespace mlir +} // namespace mlir #endif // MLIR_LIB_PARSER_ASMPARSERIMPL_H diff --git a/mlir/lib/Parser/AttributeParser.cpp b/mlir/lib/Parser/AttributeParser.cpp index 63b8542..13da92c 100644 --- a/mlir/lib/Parser/AttributeParser.cpp +++ b/mlir/lib/Parser/AttributeParser.cpp @@ -485,7 +485,7 @@ private: /// Storage used when parsing elements that were stored as hex values. Optional<Token> hexStorage; }; -} // end anonymous namespace +} // namespace /// Parse the elements of a tensor literal. If 'allowHex' is true, the parser /// may also parse a tensor literal that is store as a hex string. diff --git a/mlir/lib/Parser/Lexer.h b/mlir/lib/Parser/Lexer.h index 8ba8133..8f24d08 100644 --- a/mlir/lib/Parser/Lexer.h +++ b/mlir/lib/Parser/Lexer.h @@ -68,6 +68,6 @@ private: void operator=(const Lexer &) = delete; }; -} // end namespace mlir +} // namespace mlir #endif // MLIR_LIB_PARSER_LEXER_H diff --git a/mlir/lib/Parser/Parser.cpp b/mlir/lib/Parser/Parser.cpp index 1818e42..87d8f4b 100644 --- a/mlir/lib/Parser/Parser.cpp +++ b/mlir/lib/Parser/Parser.cpp @@ -487,7 +487,7 @@ private: /// The top level operation that holds all of the parsed operations. Operation *topLevelOp; }; -} // end anonymous namespace +} // namespace OperationParser::OperationParser(ParserState &state, ModuleOp topLevelOp) : Parser(state), opBuilder(topLevelOp.getRegion()), topLevelOp(topLevelOp) { @@ -1588,7 +1588,7 @@ private: /// The backing operation parser. OperationParser &parser; }; -} // end anonymous namespace. +} // namespace FailureOr<OperationName> OperationParser::parseCustomOperationName() { std::string opName = getTokenSpelling().str(); @@ -2025,7 +2025,7 @@ private: /// Parse an attribute alias declaration. ParseResult parseTypeAliasDef(); }; -} // end anonymous namespace +} // namespace /// Parses an attribute alias declaration. /// diff --git a/mlir/lib/Parser/Parser.h b/mlir/lib/Parser/Parser.h index 9a1894d..da0c81c 100644 --- a/mlir/lib/Parser/Parser.h +++ b/mlir/lib/Parser/Parser.h @@ -301,7 +301,7 @@ protected: /// non-trivial state here, add it to the ParserState class. ParserState &state; }; -} // end namespace detail -} // end namespace mlir +} // namespace detail +} // namespace mlir #endif // MLIR_LIB_PARSER_PARSER_H diff --git a/mlir/lib/Parser/ParserState.h b/mlir/lib/Parser/ParserState.h index f5fafff..5ab6754 100644 --- a/mlir/lib/Parser/ParserState.h +++ b/mlir/lib/Parser/ParserState.h @@ -91,7 +91,7 @@ struct ParserState { SmallVector<StringRef> defaultDialectStack{"builtin"}; }; -} // end namespace detail -} // end namespace mlir +} // namespace detail +} // namespace mlir #endif // MLIR_LIB_PARSER_PARSERSTATE_H diff --git a/mlir/lib/Parser/Token.h b/mlir/lib/Parser/Token.h index d4d09f96..4f5e948 100644 --- a/mlir/lib/Parser/Token.h +++ b/mlir/lib/Parser/Token.h @@ -119,6 +119,6 @@ private: StringRef spelling; }; -} // end namespace mlir +} // namespace mlir #endif // MLIR_LIB_PARSER_TOKEN_H diff --git a/mlir/lib/Pass/IRPrinting.cpp b/mlir/lib/Pass/IRPrinting.cpp index 2094770b..403d88d 100644 --- a/mlir/lib/Pass/IRPrinting.cpp +++ b/mlir/lib/Pass/IRPrinting.cpp @@ -92,7 +92,7 @@ private: /// configuration asked for change detection. DenseMap<Pass *, OperationFingerPrint> beforePassFingerPrints; }; -} // end anonymous namespace +} // namespace static void printIR(Operation *op, bool printModuleScope, raw_ostream &out, OpPrintingFlags flags) { @@ -248,7 +248,7 @@ struct BasicIRPrinterConfig : public PassManager::IRPrinterConfig { /// The stream to output to. raw_ostream &out; }; -} // end anonymous namespace +} // namespace /// Add an instrumentation to print the IR before and after pass execution, /// using the provided configuration. diff --git a/mlir/lib/Pass/Pass.cpp b/mlir/lib/Pass/Pass.cpp index 57ede84..c7bbf4a 100644 --- a/mlir/lib/Pass/Pass.cpp +++ b/mlir/lib/Pass/Pass.cpp @@ -131,8 +131,8 @@ struct OpPassManagerImpl { /// OpPassManager. OpPassManager::Nesting nesting; }; -} // end namespace detail -} // end namespace mlir +} // namespace detail +} // namespace mlir void OpPassManagerImpl::mergeInto(OpPassManagerImpl &rhs) { assert(name == rhs.name && "merging unrelated pass managers"); @@ -786,8 +786,8 @@ struct PassInstrumentorImpl { /// Set of registered instrumentations. std::vector<std::unique_ptr<PassInstrumentation>> instrumentations; }; -} // end namespace detail -} // end namespace mlir +} // namespace detail +} // namespace mlir PassInstrumentor::PassInstrumentor() : impl(new PassInstrumentorImpl()) {} PassInstrumentor::~PassInstrumentor() {} diff --git a/mlir/lib/Pass/PassCrashRecovery.cpp b/mlir/lib/Pass/PassCrashRecovery.cpp index fdc995c..46fec82 100644 --- a/mlir/lib/Pass/PassCrashRecovery.cpp +++ b/mlir/lib/Pass/PassCrashRecovery.cpp @@ -362,7 +362,7 @@ private: /// The generator used to create crash reproducers. PassCrashReproducerGenerator &generator; }; -} // end anonymous namespace +} // namespace //===----------------------------------------------------------------------===// // FileReproducerStream @@ -386,7 +386,7 @@ private: /// ToolOutputFile corresponding to opened `filename`. std::unique_ptr<llvm::ToolOutputFile> outputFile = nullptr; }; -} // end anonymous namespace +} // namespace //===----------------------------------------------------------------------===// // PassManager diff --git a/mlir/lib/Pass/PassDetail.h b/mlir/lib/Pass/PassDetail.h index 24782fc..230551c 100644 --- a/mlir/lib/Pass/PassDetail.h +++ b/mlir/lib/Pass/PassDetail.h @@ -119,6 +119,6 @@ private: std::unique_ptr<Impl> impl; }; -} // end namespace detail -} // end namespace mlir +} // namespace detail +} // namespace mlir #endif // MLIR_PASS_PASSDETAIL_H_ diff --git a/mlir/lib/Pass/PassManagerOptions.cpp b/mlir/lib/Pass/PassManagerOptions.cpp index f5780ab..c9ba4e4 100644 --- a/mlir/lib/Pass/PassManagerOptions.cpp +++ b/mlir/lib/Pass/PassManagerOptions.cpp @@ -78,7 +78,7 @@ struct PassManagerOptions { clEnumValN(PassDisplayMode::Pipeline, "pipeline", "display the results with a nested pipeline view"))}; }; -} // end anonymous namespace +} // namespace static llvm::ManagedStatic<PassManagerOptions> options; diff --git a/mlir/lib/Pass/PassRegistry.cpp b/mlir/lib/Pass/PassRegistry.cpp index a7fb9ec..eae5091 100644 --- a/mlir/lib/Pass/PassRegistry.cpp +++ b/mlir/lib/Pass/PassRegistry.cpp @@ -302,7 +302,7 @@ private: std::vector<PipelineElement> pipeline; }; -} // end anonymous namespace +} // namespace /// Try to initialize this pipeline with the given pipeline text. An option is /// given to enable accurate error reporting. @@ -521,7 +521,7 @@ struct PassArgData { /// pipeline. TextualPipeline pipeline; }; -} // end anonymous namespace +} // namespace namespace llvm { namespace cl { @@ -539,8 +539,8 @@ struct OptionValue<PassArgData> final PassArgData value; }; -} // end namespace cl -} // end namespace llvm +} // namespace cl +} // namespace llvm namespace { @@ -687,8 +687,8 @@ struct PassPipelineCLParserImpl { /// The set of passes and pass pipelines to run. llvm::cl::list<PassArgData, bool, PassNameParser> passList; }; -} // end namespace detail -} // end namespace mlir +} // namespace detail +} // namespace mlir /// Construct a pass pipeline parser with the given command line description. PassPipelineCLParser::PassPipelineCLParser(StringRef arg, StringRef description) diff --git a/mlir/lib/Pass/PassStatistics.cpp b/mlir/lib/Pass/PassStatistics.cpp index 425aeae3..8b1b020 100644 --- a/mlir/lib/Pass/PassStatistics.cpp +++ b/mlir/lib/Pass/PassStatistics.cpp @@ -23,7 +23,7 @@ struct Statistic { const char *name, *desc; unsigned value; }; -} // end anonymous namespace +} // namespace /// Utility to print a pass entry in the statistics output. static void printPassEntry(raw_ostream &os, unsigned indent, StringRef pass, diff --git a/mlir/lib/Reducer/OptReductionPass.cpp b/mlir/lib/Reducer/OptReductionPass.cpp index e0c2944..806ce67 100644 --- a/mlir/lib/Reducer/OptReductionPass.cpp +++ b/mlir/lib/Reducer/OptReductionPass.cpp @@ -31,7 +31,7 @@ public: void runOnOperation() override; }; -} // end anonymous namespace +} // namespace /// Runs the pass instance in the pass pipeline. void OptReductionPass::runOnOperation() { diff --git a/mlir/lib/Reducer/ReductionTreePass.cpp b/mlir/lib/Reducer/ReductionTreePass.cpp index 4ff31b4..859f64a 100644 --- a/mlir/lib/Reducer/ReductionTreePass.cpp +++ b/mlir/lib/Reducer/ReductionTreePass.cpp @@ -199,7 +199,7 @@ private: FrozenRewritePatternSet reducerPatterns; }; -} // end anonymous namespace +} // namespace LogicalResult ReductionTreePass::initialize(MLIRContext *context) { RewritePatternSet patterns(context); diff --git a/mlir/lib/Rewrite/ByteCode.cpp b/mlir/lib/Rewrite/ByteCode.cpp index bd1cd7b..bd98ce0 100644 --- a/mlir/lib/Rewrite/ByteCode.cpp +++ b/mlir/lib/Rewrite/ByteCode.cpp @@ -160,7 +160,7 @@ enum OpCode : ByteCodeField { /// Compare a range of types with a set of constants. SwitchTypes, }; -} // end anonymous namespace +} // namespace //===----------------------------------------------------------------------===// // ByteCode Generation @@ -479,7 +479,7 @@ struct ByteCodeLiveRange { /// The value range storage index for this range. Optional<unsigned> valueRangeIndex; }; -} // end anonymous namespace +} // namespace void Generator::generate(ModuleOp module) { FuncOp matcherFunc = module.lookupSymbol<FuncOp>( @@ -1313,7 +1313,7 @@ public: return allocatedValueRanges; } }; -} // end anonymous namespace +} // namespace void ByteCodeExecutor::executeApplyConstraint(PatternRewriter &rewriter) { LLVM_DEBUG(llvm::dbgs() << "Executing ApplyConstraint:\n"); diff --git a/mlir/lib/Rewrite/ByteCode.h b/mlir/lib/Rewrite/ByteCode.h index a26c3b2..e423ff2 100644 --- a/mlir/lib/Rewrite/ByteCode.h +++ b/mlir/lib/Rewrite/ByteCode.h @@ -19,7 +19,7 @@ namespace mlir { namespace pdl_interp { class RecordMatchOp; -} // end namespace pdl_interp +} // namespace pdl_interp namespace detail { class PDLByteCode; @@ -208,7 +208,7 @@ private: ByteCodeField maxLoopLevel = 0; }; -} // end namespace detail -} // end namespace mlir +} // namespace detail +} // namespace mlir #endif // MLIR_REWRITE_BYTECODE_H_ diff --git a/mlir/lib/Support/DebugCounter.cpp b/mlir/lib/Support/DebugCounter.cpp index 30864b2..930d5d3 100644 --- a/mlir/lib/Support/DebugCounter.cpp +++ b/mlir/lib/Support/DebugCounter.cpp @@ -34,7 +34,7 @@ struct DebugCounterOptions { llvm::cl::desc("Print out debug counter information after all counters " "have been accumulated")}; }; -} // end anonymous namespace +} // namespace static llvm::ManagedStatic<DebugCounterOptions> clOptions; diff --git a/mlir/lib/Support/StorageUniquer.cpp b/mlir/lib/Support/StorageUniquer.cpp index 06978ce..9291199 100644 --- a/mlir/lib/Support/StorageUniquer.cpp +++ b/mlir/lib/Support/StorageUniquer.cpp @@ -257,7 +257,7 @@ private: function_ref<void(BaseStorage *)> destructorFn; #endif }; -} // end anonymous namespace +} // namespace namespace mlir { namespace detail { @@ -328,7 +328,7 @@ struct StorageUniquerImpl { /// Flag specifying if multi-threading is enabled within the uniquer. bool threadingIsEnabled = true; }; -} // end namespace detail +} // namespace detail } // namespace mlir StorageUniquer::StorageUniquer() : impl(new StorageUniquerImpl()) {} diff --git a/mlir/lib/Support/Timing.cpp b/mlir/lib/Support/Timing.cpp index 11afe1e..63e0732 100644 --- a/mlir/lib/Support/Timing.cpp +++ b/mlir/lib/Support/Timing.cpp @@ -549,7 +549,7 @@ struct DefaultTimingManagerOptions { clEnumValN(DisplayMode::Tree, "tree", "display the results ina with a nested tree view"))}; }; -} // end anonymous namespace +} // namespace static llvm::ManagedStatic<DefaultTimingManagerOptions> options; diff --git a/mlir/lib/TableGen/Class.cpp b/mlir/lib/TableGen/Class.cpp index 0c38fa5..9b7124e 100644 --- a/mlir/lib/TableGen/Class.cpp +++ b/mlir/lib/TableGen/Class.cpp @@ -207,8 +207,8 @@ raw_ostream &operator<<(raw_ostream &os, Visibility visibility) { } return os; } -} // end namespace tblgen -} // end namespace mlir +} // namespace tblgen +} // namespace mlir //===----------------------------------------------------------------------===// // ParentClass definitions diff --git a/mlir/lib/TableGen/Predicate.cpp b/mlir/lib/TableGen/Predicate.cpp index dd71540..554b662 100644 --- a/mlir/lib/TableGen/Predicate.cpp +++ b/mlir/lib/TableGen/Predicate.cpp @@ -110,7 +110,7 @@ struct PredNode { std::string prefix; std::string suffix; }; -} // end anonymous namespace +} // namespace // Get a predicate tree node kind based on the kind used in the predicate // TableGen record. @@ -131,7 +131,7 @@ static PredCombinerKind getPredCombinerKind(const Pred &pred) { namespace { // Substitution<pattern, replacement>. using Subst = std::pair<StringRef, StringRef>; -} // end anonymous namespace +} // namespace /// Perform the given substitutions on 'str' in-place. static void performSubstitutions(std::string &str, diff --git a/mlir/lib/Target/LLVMIR/DebugTranslation.h b/mlir/lib/Target/LLVMIR/DebugTranslation.h index 062b882..3706d06 100644 --- a/mlir/lib/Target/LLVMIR/DebugTranslation.h +++ b/mlir/lib/Target/LLVMIR/DebugTranslation.h @@ -67,8 +67,8 @@ private: llvm::DICompileUnit *compileUnit; }; -} // end namespace detail -} // end namespace LLVM -} // end namespace mlir +} // namespace detail +} // namespace LLVM +} // namespace mlir #endif // MLIR_LIB_TARGET_LLVMIR_DEBUGTRANSLATION_H_ diff --git a/mlir/lib/Target/LLVMIR/Dialect/AMX/AMXToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/AMX/AMXToLLVMIRTranslation.cpp index f923367..776559c 100644 --- a/mlir/lib/Target/LLVMIR/Dialect/AMX/AMXToLLVMIRTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/Dialect/AMX/AMXToLLVMIRTranslation.cpp @@ -40,7 +40,7 @@ public: return failure(); } }; -} // end namespace +} // namespace void mlir::registerAMXDialectTranslation(DialectRegistry ®istry) { registry.insert<amx::AMXDialect>(); diff --git a/mlir/lib/Target/LLVMIR/Dialect/ArmNeon/ArmNeonToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/ArmNeon/ArmNeonToLLVMIRTranslation.cpp index eb49a53..22ea731 100644 --- a/mlir/lib/Target/LLVMIR/Dialect/ArmNeon/ArmNeonToLLVMIRTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/Dialect/ArmNeon/ArmNeonToLLVMIRTranslation.cpp @@ -41,7 +41,7 @@ public: return failure(); } }; -} // end namespace +} // namespace void mlir::registerArmNeonDialectTranslation(DialectRegistry ®istry) { registry.insert<arm_neon::ArmNeonDialect>(); diff --git a/mlir/lib/Target/LLVMIR/Dialect/ArmSVE/ArmSVEToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/ArmSVE/ArmSVEToLLVMIRTranslation.cpp index 27ce8a8..364e63d 100644 --- a/mlir/lib/Target/LLVMIR/Dialect/ArmSVE/ArmSVEToLLVMIRTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/Dialect/ArmSVE/ArmSVEToLLVMIRTranslation.cpp @@ -40,7 +40,7 @@ public: return failure(); } }; -} // end namespace +} // namespace void mlir::registerArmSVEDialectTranslation(DialectRegistry ®istry) { registry.insert<arm_sve::ArmSVEDialect>(); diff --git a/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp index cc8800d..8d19f46 100644 --- a/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp @@ -471,7 +471,7 @@ public: return convertOperationImpl(*op, builder, moduleTranslation); } }; -} // end namespace +} // namespace void mlir::registerLLVMDialectTranslation(DialectRegistry ®istry) { registry.insert<LLVM::LLVMDialect>(); diff --git a/mlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp index a45cd7a..4b5ca8f 100644 --- a/mlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp @@ -108,7 +108,7 @@ public: return success(); } }; -} // end namespace +} // namespace void mlir::registerNVVMDialectTranslation(DialectRegistry ®istry) { registry.insert<NVVM::NVVMDialect>(); diff --git a/mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp index f6f7be13..c8dd7fe 100644 --- a/mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp @@ -492,7 +492,7 @@ public: LLVM::ModuleTranslation &moduleTranslation) const final; }; -} // end namespace +} // namespace /// Given an OpenACC MLIR operation, create the corresponding LLVM IR /// (including OpenACC runtime calls). diff --git a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp index d623dbb..96b7644 100644 --- a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp @@ -900,7 +900,7 @@ public: LLVM::ModuleTranslation &moduleTranslation) const final; }; -} // end namespace +} // namespace /// Given an OpenMP MLIR operation, create the corresponding LLVM IR /// (including OpenMP runtime calls). diff --git a/mlir/lib/Target/LLVMIR/Dialect/ROCDL/ROCDLToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/ROCDL/ROCDLToLLVMIRTranslation.cpp index 348424a..a0c61b8 100644 --- a/mlir/lib/Target/LLVMIR/Dialect/ROCDL/ROCDLToLLVMIRTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/Dialect/ROCDL/ROCDLToLLVMIRTranslation.cpp @@ -80,7 +80,7 @@ public: return success(); } }; -} // end namespace +} // namespace void mlir::registerROCDLDialectTranslation(DialectRegistry ®istry) { registry.insert<ROCDL::ROCDLDialect>(); diff --git a/mlir/lib/Target/LLVMIR/Dialect/X86Vector/X86VectorToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/X86Vector/X86VectorToLLVMIRTranslation.cpp index ec8b5c1..f2ddc2a 100644 --- a/mlir/lib/Target/LLVMIR/Dialect/X86Vector/X86VectorToLLVMIRTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/Dialect/X86Vector/X86VectorToLLVMIRTranslation.cpp @@ -41,7 +41,7 @@ public: return failure(); } }; -} // end namespace +} // namespace void mlir::registerX86VectorDialectTranslation(DialectRegistry ®istry) { registry.insert<x86vector::X86VectorDialect>(); diff --git a/mlir/lib/Target/LLVMIR/TypeFromLLVM.cpp b/mlir/lib/Target/LLVMIR/TypeFromLLVM.cpp index 681e244..c987198 100644 --- a/mlir/lib/Target/LLVMIR/TypeFromLLVM.cpp +++ b/mlir/lib/Target/LLVMIR/TypeFromLLVM.cpp @@ -150,9 +150,9 @@ private: MLIRContext &context; }; -} // end namespace detail -} // end namespace LLVM -} // end namespace mlir +} // namespace detail +} // namespace LLVM +} // namespace mlir LLVM::TypeFromLLVMIRTranslator::TypeFromLLVMIRTranslator(MLIRContext &context) : impl(new detail::TypeFromLLVMIRTranslatorImpl(context)) {} diff --git a/mlir/lib/Target/LLVMIR/TypeToLLVM.cpp b/mlir/lib/Target/LLVMIR/TypeToLLVM.cpp index cb62956..aadd72a 100644 --- a/mlir/lib/Target/LLVMIR/TypeToLLVM.cpp +++ b/mlir/lib/Target/LLVMIR/TypeToLLVM.cpp @@ -170,9 +170,9 @@ private: /// type instead of creating a new type. llvm::DenseMap<Type, llvm::Type *> knownTranslations; }; -} // end namespace detail -} // end namespace LLVM -} // end namespace mlir +} // namespace detail +} // namespace LLVM +} // namespace mlir LLVM::TypeToLLVMIRTranslator::TypeToLLVMIRTranslator(llvm::LLVMContext &context) : impl(new detail::TypeToLLVMIRTranslatorImpl(context)) {} diff --git a/mlir/lib/Transforms/BufferOptimizations.cpp b/mlir/lib/Transforms/BufferOptimizations.cpp index ee4f5d5..64a005d 100644 --- a/mlir/lib/Transforms/BufferOptimizations.cpp +++ b/mlir/lib/Transforms/BufferOptimizations.cpp @@ -418,7 +418,7 @@ private: std::function<bool(Value)> isSmallAlloc; }; -} // end anonymous namespace +} // namespace std::unique_ptr<Pass> mlir::createBufferHoistingPass() { return std::make_unique<BufferHoistingPass>(); diff --git a/mlir/lib/Transforms/BufferResultsToOutParams.cpp b/mlir/lib/Transforms/BufferResultsToOutParams.cpp index 8ae4436..2abdccc 100644 --- a/mlir/lib/Transforms/BufferResultsToOutParams.cpp +++ b/mlir/lib/Transforms/BufferResultsToOutParams.cpp @@ -136,7 +136,7 @@ struct BufferResultsToOutParamsPass return signalPassFailure(); } }; -} // end anonymous namespace +} // namespace std::unique_ptr<Pass> mlir::createBufferResultsToOutParamsPass() { return std::make_unique<BufferResultsToOutParamsPass>(); diff --git a/mlir/lib/Transforms/CSE.cpp b/mlir/lib/Transforms/CSE.cpp index c7b09b5..bc265a4 100644 --- a/mlir/lib/Transforms/CSE.cpp +++ b/mlir/lib/Transforms/CSE.cpp @@ -49,7 +49,7 @@ struct SimpleOperationInfo : public llvm::DenseMapInfo<Operation *> { OperationEquivalence::IgnoreLocations); } }; -} // end anonymous namespace +} // namespace namespace { /// Simple common sub-expression elimination. @@ -91,7 +91,7 @@ private: std::vector<Operation *> opsToErase; DominanceInfo *domInfo = nullptr; }; -} // end anonymous namespace +} // namespace /// Attempt to eliminate a redundant operation. LogicalResult CSE::simplifyOperation(ScopedMapTy &knownValues, Operation *op, diff --git a/mlir/lib/Transforms/Canonicalizer.cpp b/mlir/lib/Transforms/Canonicalizer.cpp index 22cc32f..745477d 100644 --- a/mlir/lib/Transforms/Canonicalizer.cpp +++ b/mlir/lib/Transforms/Canonicalizer.cpp @@ -52,7 +52,7 @@ struct Canonicalizer : public CanonicalizerBase<Canonicalizer> { GreedyRewriteConfig config; FrozenRewritePatternSet patterns; }; -} // end anonymous namespace +} // namespace /// Create a Canonicalizer pass. std::unique_ptr<Pass> mlir::createCanonicalizerPass() { diff --git a/mlir/lib/Transforms/Inliner.cpp b/mlir/lib/Transforms/Inliner.cpp index 03219c4..32b12e7 100644 --- a/mlir/lib/Transforms/Inliner.cpp +++ b/mlir/lib/Transforms/Inliner.cpp @@ -123,7 +123,7 @@ private: /// A symbol table to use when resolving call lookups. SymbolTableCollection &symbolTable; }; -} // end anonymous namespace +} // namespace CGUseList::CGUseList(Operation *op, CallGraph &cg, SymbolTableCollection &symbolTable) @@ -279,7 +279,7 @@ private: std::vector<CallGraphNode *> nodes; llvm::scc_iterator<const CallGraph *> &parentIterator; }; -} // end anonymous namespace +} // namespace /// Run a given transformation over the SCCs of the callgraph in a bottom up /// traversal. @@ -311,7 +311,7 @@ struct ResolvedCall { CallOpInterface call; CallGraphNode *sourceNode, *targetNode; }; -} // end anonymous namespace +} // namespace /// Collect all of the callable operations within the given range of blocks. If /// `traverseNestedCGNodes` is true, this will also collect call operations @@ -559,7 +559,7 @@ private: /// during optimization. SmallVector<llvm::StringMap<OpPassManager>, 8> opPipelines; }; -} // end anonymous namespace +} // namespace InlinerPass::InlinerPass() : InlinerPass(defaultInlinerOptPipeline) {} InlinerPass::InlinerPass(std::function<void(OpPassManager &)> defaultPipeline) diff --git a/mlir/lib/Transforms/LocationSnapshot.cpp b/mlir/lib/Transforms/LocationSnapshot.cpp index 4e77b1d..f23a3ee 100644 --- a/mlir/lib/Transforms/LocationSnapshot.cpp +++ b/mlir/lib/Transforms/LocationSnapshot.cpp @@ -140,7 +140,7 @@ struct LocationSnapshotPass /// The printing flags to use when creating the snapshot. OpPrintingFlags flags; }; -} // end anonymous namespace +} // namespace std::unique_ptr<Pass> mlir::createLocationSnapshotPass(OpPrintingFlags flags, StringRef fileName, diff --git a/mlir/lib/Transforms/LoopFusion.cpp b/mlir/lib/Transforms/LoopFusion.cpp index 24ef03ba..1a3de13 100644 --- a/mlir/lib/Transforms/LoopFusion.cpp +++ b/mlir/lib/Transforms/LoopFusion.cpp @@ -59,7 +59,7 @@ struct LoopFusion : public AffineLoopFusionBase<LoopFusion> { void runOnFunction() override; }; -} // end anonymous namespace +} // namespace std::unique_ptr<OperationPass<FuncOp>> mlir::createLoopFusionPass(unsigned fastMemorySpace, @@ -726,7 +726,7 @@ void gatherEscapingMemrefs(unsigned id, MemRefDependenceGraph *mdg, } } -} // end anonymous namespace +} // namespace // Initializes the data dependence graph by walking operations in 'f'. // Assigns each node in the graph a node id based on program order in 'f'. @@ -1972,7 +1972,7 @@ public: } }; -} // end anonymous namespace +} // namespace void LoopFusion::runOnFunction() { MemRefDependenceGraph g; diff --git a/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp b/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp index 2bef6c5..71a2410 100644 --- a/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp +++ b/mlir/lib/Transforms/LoopInvariantCodeMotion.cpp @@ -32,7 +32,7 @@ struct LoopInvariantCodeMotion : public LoopInvariantCodeMotionBase<LoopInvariantCodeMotion> { void runOnOperation() override; }; -} // end anonymous namespace +} // namespace // Checks whether the given op can be hoisted by checking that // - the op and any of its contained operations do not depend on SSA values diff --git a/mlir/lib/Transforms/NormalizeMemRefs.cpp b/mlir/lib/Transforms/NormalizeMemRefs.cpp index c3fa7fe4..b890bc7 100644 --- a/mlir/lib/Transforms/NormalizeMemRefs.cpp +++ b/mlir/lib/Transforms/NormalizeMemRefs.cpp @@ -41,7 +41,7 @@ struct NormalizeMemRefs : public NormalizeMemRefsBase<NormalizeMemRefs> { Operation *createOpResultsNormalized(FuncOp funcOp, Operation *oldOp); }; -} // end anonymous namespace +} // namespace std::unique_ptr<OperationPass<ModuleOp>> mlir::createNormalizeMemRefsPass() { return std::make_unique<NormalizeMemRefs>(); diff --git a/mlir/lib/Transforms/PassDetail.h b/mlir/lib/Transforms/PassDetail.h index 06ec234..9b84619 100644 --- a/mlir/lib/Transforms/PassDetail.h +++ b/mlir/lib/Transforms/PassDetail.h @@ -21,11 +21,11 @@ void registerDialect(DialectRegistry ®istry); namespace arith { class ArithmeticDialect; -} // end namespace arith +} // namespace arith namespace memref { class MemRefDialect; -} // end namespace memref +} // namespace memref namespace bufferization { class BufferizationDialect; @@ -34,6 +34,6 @@ class BufferizationDialect; #define GEN_PASS_CLASSES #include "mlir/Transforms/Passes.h.inc" -} // end namespace mlir +} // namespace mlir #endif // TRANSFORMS_PASSDETAIL_H_ diff --git a/mlir/lib/Transforms/PipelineDataTransfer.cpp b/mlir/lib/Transforms/PipelineDataTransfer.cpp index 500203b1..1613ecc 100644 --- a/mlir/lib/Transforms/PipelineDataTransfer.cpp +++ b/mlir/lib/Transforms/PipelineDataTransfer.cpp @@ -38,7 +38,7 @@ struct PipelineDataTransfer std::vector<AffineForOp> forOps; }; -} // end anonymous namespace +} // namespace /// Creates a pass to pipeline explicit movement of data across levels of the /// memory hierarchy. diff --git a/mlir/lib/Transforms/SCCP.cpp b/mlir/lib/Transforms/SCCP.cpp index 3d725d7..7a2f994 100644 --- a/mlir/lib/Transforms/SCCP.cpp +++ b/mlir/lib/Transforms/SCCP.cpp @@ -239,7 +239,7 @@ namespace { struct SCCP : public SCCPBase<SCCP> { void runOnOperation() override; }; -} // end anonymous namespace +} // namespace void SCCP::runOnOperation() { Operation *op = getOperation(); diff --git a/mlir/lib/Transforms/StripDebugInfo.cpp b/mlir/lib/Transforms/StripDebugInfo.cpp index 39db964..99e1151 100644 --- a/mlir/lib/Transforms/StripDebugInfo.cpp +++ b/mlir/lib/Transforms/StripDebugInfo.cpp @@ -18,7 +18,7 @@ namespace { struct StripDebugInfo : public StripDebugInfoBase<StripDebugInfo> { void runOnOperation() override; }; -} // end anonymous namespace +} // namespace void StripDebugInfo::runOnOperation() { auto unknownLoc = UnknownLoc::get(&getContext()); diff --git a/mlir/lib/Transforms/SymbolDCE.cpp b/mlir/lib/Transforms/SymbolDCE.cpp index 2c65d63..0319cb9 100644 --- a/mlir/lib/Transforms/SymbolDCE.cpp +++ b/mlir/lib/Transforms/SymbolDCE.cpp @@ -28,7 +28,7 @@ struct SymbolDCE : public SymbolDCEBase<SymbolDCE> { bool symbolTableIsHidden, DenseSet<Operation *> &liveSymbols); }; -} // end anonymous namespace +} // namespace void SymbolDCE::runOnOperation() { Operation *symbolTableOp = getOperation(); diff --git a/mlir/lib/Transforms/Utils/DialectConversion.cpp b/mlir/lib/Transforms/Utils/DialectConversion.cpp index ad34eeb..97c6a4d 100644 --- a/mlir/lib/Transforms/Utils/DialectConversion.cpp +++ b/mlir/lib/Transforms/Utils/DialectConversion.cpp @@ -147,7 +147,7 @@ private: /// Current value mappings. BlockAndValueMapping mapping; }; -} // end anonymous namespace +} // namespace Value ConversionValueMapping::lookupOrDefault(Value from, Type desiredType) const { @@ -408,7 +408,7 @@ private: /// The original output type. This is only used for argument conversions. Type origOutputType; }; -} // end anonymous namespace +} // namespace /// Build an unresolved materialization operation given an output type and set /// of input operands. @@ -593,7 +593,7 @@ struct ArgConverter { /// An ordered set of unresolved materializations during conversion. SmallVectorImpl<UnresolvedMaterialization> &unresolvedMaterializations; }; -} // end anonymous namespace +} // namespace //===----------------------------------------------------------------------===// // Rewrite Application @@ -1018,8 +1018,8 @@ struct ConversionPatternRewriterImpl { llvm::ScopedPrinter logger{llvm::dbgs()}; #endif }; -} // end namespace detail -} // end namespace mlir +} // namespace detail +} // namespace mlir /// Detach any operations nested in the given operation from their parent /// blocks, and erase the given operation. This can be used when the nested @@ -2396,7 +2396,7 @@ private: /// *not* to be legalizable to the target. DenseSet<Operation *> *trackedOps; }; -} // end anonymous namespace +} // namespace LogicalResult OperationConverter::convert(ConversionPatternRewriter &rewriter, Operation *op) { @@ -3086,7 +3086,7 @@ struct FunctionLikeSignatureConversion : public ConversionPattern { return success(); } }; -} // end anonymous namespace +} // namespace void mlir::populateFunctionLikeTypeConversionPattern( StringRef functionLikeOpName, RewritePatternSet &patterns, diff --git a/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp b/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp index 5e9f6dd..e9ea661 100644 --- a/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp +++ b/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp @@ -101,7 +101,7 @@ private: llvm::ScopedPrinter logger{llvm::dbgs()}; #endif }; -} // end anonymous namespace +} // namespace GreedyPatternRewriteDriver::GreedyPatternRewriteDriver( MLIRContext *ctx, const FrozenRewritePatternSet &patterns, @@ -436,7 +436,7 @@ private: bool opErasedViaPatternRewrites = false; }; -} // anonymous namespace +} // namespace /// Performs the rewrites and folding only on `op`. The simplification /// converges if the op is erased as a result of being folded, replaced, or @@ -543,7 +543,7 @@ private: llvm::SmallDenseSet<Operation *, 4> strictModeFilteredOps; }; -} // end anonymous namespace +} // namespace /// Performs the specified rewrites on `ops` while also trying to fold these ops /// as well as any other ops that were in turn created due to these rewrite diff --git a/mlir/lib/Transforms/Utils/RegionUtils.cpp b/mlir/lib/Transforms/Utils/RegionUtils.cpp index d7d8661..023b1d6 100644 --- a/mlir/lib/Transforms/Utils/RegionUtils.cpp +++ b/mlir/lib/Transforms/Utils/RegionUtils.cpp @@ -417,7 +417,7 @@ struct BlockEquivalenceData { /// produced within the block before this operation. DenseMap<Operation *, unsigned> opOrderIndex; }; -} // end anonymous namespace +} // namespace BlockEquivalenceData::BlockEquivalenceData(Block *block) : block(block), hash(0) { @@ -477,7 +477,7 @@ private: /// replaced by arguments when the cluster gets merged. std::set<std::pair<int, int>> operandsToMerge; }; -} // end anonymous namespace +} // namespace LogicalResult BlockMergeCluster::addToCluster(BlockEquivalenceData &blockData) { if (leaderData.hash != blockData.hash) |