[llvm] 8b3ed1f - Remove redundant return statements (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 17 15:38:10 PDT 2022


Author: Kazu Hirata
Date: 2022-07-17T15:37:46-07:00
New Revision: 8b3ed1fa984b07c88f218d0ddc6b3e2c0629a9fa

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

LOG: Remove redundant return statements (NFC)

Identified with readability-redundant-control-flow.

Added: 
    

Modified: 
    clang/lib/Sema/SemaExpr.cpp
    flang/lib/Frontend/TextDiagnosticPrinter.cpp
    flang/lib/Lower/Allocatable.cpp
    flang/lib/Lower/ConvertType.cpp
    flang/lib/Optimizer/Transforms/AffinePromotion.cpp
    flang/lib/Semantics/check-directive-structure.h
    lldb/include/lldb/Symbol/SymbolFile.h
    llvm/lib/Transforms/Scalar/LoopInterchange.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index c04186dea43eb..0b4c450f76e0d 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -19721,7 +19721,6 @@ class EvaluatedExprMarker : public UsedDeclVisitor<EvaluatedExprMarker> {
   void VisitConstantExpr(ConstantExpr *E) {
     // Don't mark declarations within a ConstantExpression, as this expression
     // will be evaluated and folded to a value.
-    return;
   }
 
   void VisitDeclRefExpr(DeclRefExpr *E) {

diff  --git a/flang/lib/Frontend/TextDiagnosticPrinter.cpp b/flang/lib/Frontend/TextDiagnosticPrinter.cpp
index 5ee4122af1053..12c41d77ba467 100644
--- a/flang/lib/Frontend/TextDiagnosticPrinter.cpp
+++ b/flang/lib/Frontend/TextDiagnosticPrinter.cpp
@@ -56,5 +56,4 @@ void TextDiagnosticPrinter::HandleDiagnostic(
       diagMessageStream.str(), diagOpts->ShowColors);
 
   os.flush();
-  return;
 }

diff  --git a/flang/lib/Lower/Allocatable.cpp b/flang/lib/Lower/Allocatable.cpp
index 01a13b8555fa8..08a944440f168 100644
--- a/flang/lib/Lower/Allocatable.cpp
+++ b/flang/lib/Lower/Allocatable.cpp
@@ -500,7 +500,6 @@ void Fortran::lower::genAllocateStmt(
     Fortran::lower::AbstractConverter &converter,
     const Fortran::parser::AllocateStmt &stmt, mlir::Location loc) {
   AllocateStmtHelper{converter, stmt, loc}.lower();
-  return;
 }
 
 //===----------------------------------------------------------------------===//

diff  --git a/flang/lib/Lower/ConvertType.cpp b/flang/lib/Lower/ConvertType.cpp
index 0ab9d2d1b48e0..772c8508b7c05 100644
--- a/flang/lib/Lower/ConvertType.cpp
+++ b/flang/lib/Lower/ConvertType.cpp
@@ -368,7 +368,6 @@ struct TypeBuilder {
       params.push_back(getCharacterLength(exprOrSym));
     else if (category == Fortran::common::TypeCategory::Derived)
       TODO(converter.getCurrentLocation(), "derived type length parameters");
-    return;
   }
   Fortran::lower::LenParameterTy
   getCharacterLength(const Fortran::semantics::Symbol &symbol) {

diff  --git a/flang/lib/Optimizer/Transforms/AffinePromotion.cpp b/flang/lib/Optimizer/Transforms/AffinePromotion.cpp
index c6df98769a64b..90b4364866c96 100644
--- a/flang/lib/Optimizer/Transforms/AffinePromotion.cpp
+++ b/flang/lib/Optimizer/Transforms/AffinePromotion.cpp
@@ -242,7 +242,6 @@ struct AffineIfCondition {
     integerSet = mlir::IntegerSet::get(dimCount, symCount,
                                        {constraintPair.getValue().first},
                                        {constraintPair.getValue().second});
-    return;
   }
 
   llvm::Optional<std::pair<AffineExpr, bool>>
@@ -392,7 +391,6 @@ static void populateIndexArgs(fir::ArrayCoorOp acoOp,
     return populateIndexArgs(acoOp, shapeShift, indexArgs, rewriter);
   if (auto slice = acoOp.getShape().getDefiningOp<SliceOp>())
     return populateIndexArgs(acoOp, slice, indexArgs, rewriter);
-  return;
 }
 
 /// Returns affine.apply and fir.convert from array_coor and gendims

diff  --git a/flang/lib/Semantics/check-directive-structure.h b/flang/lib/Semantics/check-directive-structure.h
index 6444e839967df..3fdcbf2b88ec4 100644
--- a/flang/lib/Semantics/check-directive-structure.h
+++ b/flang/lib/Semantics/check-directive-structure.h
@@ -142,7 +142,6 @@ template <typename D> class NoBranchingEnforce {
     // did not found an enclosing looping construct within the OpenMP/OpenACC
     // directive
     EmitUnlabelledBranchOutError(stmt);
-    return;
   }
 
   SemanticsContext &context_;

diff  --git a/lldb/include/lldb/Symbol/SymbolFile.h b/lldb/include/lldb/Symbol/SymbolFile.h
index 1470b96f24917..ed0de1b5bce6b 100644
--- a/lldb/include/lldb/Symbol/SymbolFile.h
+++ b/lldb/include/lldb/Symbol/SymbolFile.h
@@ -132,7 +132,7 @@ class SymbolFile : public PluginInterface {
   /// Specify debug info should be loaded.
   ///
   /// It will be no-op for most implementations except SymbolFileOnDemand.
-  virtual void SetLoadDebugInfoEnabled() { return; }
+  virtual void SetLoadDebugInfoEnabled() {}
 
   // Compile Unit function calls
   // Approach 1 - iterator

diff  --git a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
index 1d3023d04463f..18daa42952242 100644
--- a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
@@ -288,7 +288,6 @@ static void populateWorklist(Loop &L, LoopVector &LoopList) {
     Vec = &CurrentLoop->getSubLoops();
   }
   LoopList.push_back(CurrentLoop);
-  return;
 }
 
 namespace {


        


More information about the llvm-commits mailing list