[flang-commits] [flang] [flang][NFC] Refactor to remove .inc file containing shared code (PR #109874)

via flang-commits flang-commits at lists.llvm.org
Wed Sep 25 08:31:41 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff e58427828939eadf7e169a0e5476919a5746a82e 2b6ee2140e2d325d294a843531fe447c14571bea --extensions cpp,h -- flang/include/flang/Optimizer/Passes/CommandLineOpts.h flang/include/flang/Optimizer/Passes/Pipelines.h flang/lib/Optimizer/Passes/CommandLineOpts.cpp flang/lib/Optimizer/Passes/Pipelines.cpp flang/lib/Frontend/FrontendActions.cpp flang/tools/bbc/bbc.cpp flang/tools/tco/tco.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/flang/lib/Optimizer/Passes/CommandLineOpts.cpp b/flang/lib/Optimizer/Passes/CommandLineOpts.cpp
index a01b039c27..f95a280883 100644
--- a/flang/lib/Optimizer/Passes/CommandLineOpts.cpp
+++ b/flang/lib/Optimizer/Passes/CommandLineOpts.cpp
@@ -13,23 +13,28 @@
 
 using namespace llvm;
 
-#define DisableOption(DOName, DOOption, DODescription) \
-  cl::opt<bool> disable##DOName("disable-" DOOption, \
-      cl::desc("disable " DODescription " pass"), cl::init(false), cl::Hidden)
-#define EnableOption(EOName, EOOption, EODescription) \
-  cl::opt<bool> enable##EOName("enable-" EOOption, \
-      cl::desc("enable " EODescription " pass"), cl::init(false), cl::Hidden)
+#define DisableOption(DOName, DOOption, DODescription)                         \
+  cl::opt<bool> disable##DOName("disable-" DOOption,                           \
+                                cl::desc("disable " DODescription " pass"),    \
+                                cl::init(false), cl::Hidden)
+#define EnableOption(EOName, EOOption, EODescription)                          \
+  cl::opt<bool> enable##EOName("enable-" EOOption,                             \
+                               cl::desc("enable " EODescription " pass"),      \
+                               cl::init(false), cl::Hidden)
 
-cl::opt<bool> dynamicArrayStackToHeapAllocation("fdynamic-heap-array",
+cl::opt<bool> dynamicArrayStackToHeapAllocation(
+    "fdynamic-heap-array",
     cl::desc("place all array allocations of dynamic size on the heap"),
     cl::init(false), cl::Hidden);
 
-cl::opt<std::size_t> arrayStackAllocationThreshold("fstack-array-size",
+cl::opt<std::size_t> arrayStackAllocationThreshold(
+    "fstack-array-size",
     cl::desc(
         "place all array allocations more than <size> elements on the heap"),
     cl::init(~static_cast<std::size_t>(0)), cl::Hidden);
 
-cl::opt<bool> ignoreMissingTypeDescriptors("ignore-missing-type-desc",
+cl::opt<bool> ignoreMissingTypeDescriptors(
+    "ignore-missing-type-desc",
     cl::desc("ignore failures to find derived type descriptors when "
              "translating FIR to LLVM"),
     cl::init(false), cl::Hidden);
@@ -41,11 +46,12 @@ codegenoptions::DebugInfoKind noDebugInfo{codegenoptions::NoDebugInfo};
 /// Optimizer Passes
 DisableOption(CfgConversion, "cfg-conversion", "disable FIR to CFG pass");
 DisableOption(FirAvc, "avc", "array value copy analysis and transformation");
-DisableOption(
-    FirMao, "memory-allocation-opt", "memory allocation optimization");
+DisableOption(FirMao, "memory-allocation-opt",
+              "memory allocation optimization");
 
 DisableOption(FirAliasTags, "fir-alias-tags", "fir alias analysis");
-cl::opt<bool> useOldAliasTags("use-old-alias-tags",
+cl::opt<bool> useOldAliasTags(
+    "use-old-alias-tags",
     cl::desc("Use a single TBAA tree for all functions and do not use "
              "the FIR alias tags pass"),
     cl::init(false), cl::Hidden);
@@ -57,11 +63,11 @@ DisableOption(DebugInfo, "debug-info", "Add debug info");
 DisableOption(FirToLlvmIr, "fir-to-llvmir", "FIR to LLVM-IR dialect");
 DisableOption(LlvmIrToLlvm, "llvm", "conversion to LLVM");
 DisableOption(BoxedProcedureRewrite, "boxed-procedure-rewrite",
-    "rewrite boxed procedures");
+              "rewrite boxed procedures");
 
 DisableOption(ExternalNameConversion, "external-name-interop",
-    "convert names with external convention");
+              "convert names with external convention");
 EnableOption(ConstantArgumentGlobalisation, "constant-argument-globalisation",
-    "the local constant argument to global constant conversion");
+             "the local constant argument to global constant conversion");
 DisableOption(CompilerGeneratedNamesConversion, "compiler-generated-names",
-    "replace special symbols in compiler generated names");
+              "replace special symbols in compiler generated names");
diff --git a/flang/lib/Optimizer/Passes/Pipelines.cpp b/flang/lib/Optimizer/Passes/Pipelines.cpp
index 21c2f4874e..c82bfbc528 100644
--- a/flang/lib/Optimizer/Passes/Pipelines.cpp
+++ b/flang/lib/Optimizer/Passes/Pipelines.cpp
@@ -127,7 +127,7 @@ void addBoxedProcedurePass(mlir::PassManager &pm) {
 }
 
 void addExternalNameConversionPass(mlir::PassManager &pm,
-                                          bool appendUnderscore) {
+                                   bool appendUnderscore) {
   addPassConditionally(pm, disableExternalNameConversion, [&]() {
     return fir::createExternalNameConversion({appendUnderscore});
   });

``````````

</details>


https://github.com/llvm/llvm-project/pull/109874


More information about the flang-commits mailing list