Skip to content

Commit 482f4d9

Browse files
committedOct 5, 2019
Expose ProvidePositionalOption as a public API
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. Patch by: Parker Schuh <parkers@google.com> Differential Revision: https://reviews.llvm.org/D68294 llvm-svn: 373815
1 parent d5a4dad commit 482f4d9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
 

‎llvm/include/llvm/Support/CommandLine.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,6 +2000,9 @@ void ResetAllOptionOccurrences();
20002000
/// where no options are supported.
20012001
void ResetCommandLineParser();
20022002

2003+
/// Parses `Arg` into the option handler `Handler`.
2004+
bool ProvidePositionalOption(Option *Handler, StringRef Arg, int i);
2005+
20032006
} // end namespace cl
20042007

20052008
} // end namespace llvm

‎llvm/lib/Support/CommandLine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ static inline bool ProvideOption(Option *Handler, StringRef ArgName,
692692
return false;
693693
}
694694

695-
static bool ProvidePositionalOption(Option *Handler, StringRef Arg, int i) {
695+
bool llvm::cl::ProvidePositionalOption(Option *Handler, StringRef Arg, int i) {
696696
int Dummy = i;
697697
return ProvideOption(Handler, Handler->ArgStr, Arg, 0, nullptr, Dummy);
698698
}

0 commit comments

Comments
 (0)
Please sign in to comment.