[PATCH] D114630: [fir] Get rid of the global option in FIRBuilder

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 26 04:17:01 PST 2021


clementval created this revision.
clementval added a reviewer: mehdi_amini.
Herald added a project: Flang.
clementval requested review of this revision.
Herald added subscribers: llvm-commits, jdoerfert.
Herald added a project: LLVM.

Replace the global option `nameLengthHashSize` with a constexpr
with the same name. The option was not used in fir-dev so switching
to a constexpr is fine.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114630

Files:
  flang/lib/Optimizer/Builder/FIRBuilder.cpp


Index: flang/lib/Optimizer/Builder/FIRBuilder.cpp
===================================================================
--- flang/lib/Optimizer/Builder/FIRBuilder.cpp
+++ flang/lib/Optimizer/Builder/FIRBuilder.cpp
@@ -19,12 +19,7 @@
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/MD5.h"
 
-static llvm::cl::opt<std::size_t>
-    nameLengthHashSize("length-to-hash-string-literal",
-                       llvm::cl::desc("string literals that exceed this length"
-                                      " will use a hash value as their symbol "
-                                      "name"),
-                       llvm::cl::init(32));
+static constexpr std::size_t nameLengthHashSize = 32;
 
 mlir::FuncOp fir::FirOpBuilder::createFunction(mlir::Location loc,
                                                mlir::ModuleOp module,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114630.389999.patch
Type: text/x-patch
Size: 846 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211126/acf58762/attachment.bin>


More information about the llvm-commits mailing list