[PATCH] D68294: Expose ProvidePositionalOption for use in mlir.

Parker Schuh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 1 13:41:32 PDT 2019


pschuh created this revision.
pschuh added a reviewer: mehdi_amini.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
pschuh updated this revision to Diff 222693.
Herald added a subscriber: kristina.

The motivation is to reuse the key value parsing logic here to parse instance specific pass options within the context of MLIR. The primary functionality exposed is the "," splitting for arrays and the logic for properly handling duplicate definitions of a single flag. See:  https://groups.google.com/a/tensorflow.org/forum/#!topic/mlir/uROv8TX52Ts for more context.


Repository:
  rL LLVM

https://reviews.llvm.org/D68294

Files:
  include/llvm/Support/CommandLine.h
  lib/Support/CommandLine.cpp


Index: lib/Support/CommandLine.cpp
===================================================================
--- lib/Support/CommandLine.cpp
+++ lib/Support/CommandLine.cpp
@@ -692,7 +692,7 @@
   return false;
 }
 
-static bool ProvidePositionalOption(Option *Handler, StringRef Arg, int i) {
+bool llvm::cl::ProvidePositionalOption(Option *Handler, StringRef Arg, int i) {
   int Dummy = i;
   return ProvideOption(Handler, Handler->ArgStr, Arg, 0, nullptr, Dummy);
 }
Index: include/llvm/Support/CommandLine.h
===================================================================
--- include/llvm/Support/CommandLine.h
+++ include/llvm/Support/CommandLine.h
@@ -2000,6 +2000,9 @@
 /// where no options are supported.
 void ResetCommandLineParser();
 
+/// Parses `Arg` into the option handler `Handler`.
+bool ProvidePositionalOption(Option *Handler, StringRef Arg, int i);
+
 } // end namespace cl
 
 } // end namespace llvm


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68294.222693.patch
Type: text/x-patch
Size: 920 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191001/cb43b8b9/attachment.bin>


More information about the llvm-commits mailing list