[PATCH] D96325: [clang][cli] NFC: Remove ArgList infrastructure for recording queries
Jan Svoboda via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 25 04:53:37 PST 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG43cac1d27d7d: [clang][cli] NFC: Remove ArgList infrastructure for recording queries (authored by jansvoboda11).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96325/new/
https://reviews.llvm.org/D96325
Files:
llvm/include/llvm/Option/ArgList.h
llvm/lib/Option/ArgList.cpp
Index: llvm/lib/Option/ArgList.cpp
===================================================================
--- llvm/lib/Option/ArgList.cpp
+++ llvm/lib/Option/ArgList.cpp
@@ -90,22 +90,11 @@
}
std::vector<std::string> ArgList::getAllArgValues(OptSpecifier Id) const {
- recordQueriedOpts(Id);
SmallVector<const char *, 16> Values;
AddAllArgValues(Values, Id);
return std::vector<std::string>(Values.begin(), Values.end());
}
-void ArgList::AddAllArgsExcept(ArgStringList &Output,
- const DenseSet<unsigned> &ExcludeIds) const {
- for (const Arg *Arg : *this) {
- if (!ExcludeIds.contains(Arg->getOption().getID())) {
- Arg->claim();
- Arg->render(*this, Output);
- }
- }
-}
-
void ArgList::AddAllArgsExcept(ArgStringList &Output,
ArrayRef<OptSpecifier> Ids,
ArrayRef<OptSpecifier> ExcludeIds) const {
Index: llvm/include/llvm/Option/ArgList.h
===================================================================
--- llvm/include/llvm/Option/ArgList.h
+++ llvm/include/llvm/Option/ArgList.h
@@ -137,16 +137,6 @@
/// The first and last index of each different OptSpecifier ID.
DenseMap<unsigned, OptRange> OptRanges;
- /// The OptSpecifiers that were queried from this argument list.
- mutable DenseSet<unsigned> QueriedOpts;
-
- /// Record the queried OptSpecifiers.
- template <typename... OptSpecifiers>
- void recordQueriedOpts(OptSpecifiers... Ids) const {
- SmallVector<unsigned, 4> OptsSpecifiers({toOptSpecifier(Ids).getID()...});
- QueriedOpts.insert(OptsSpecifiers.begin(), OptsSpecifiers.end());
- }
-
/// Get the range of indexes in which options with the specified IDs might
/// reside, or (0, 0) if there are no such options.
OptRange getRange(std::initializer_list<OptSpecifier> Ids) const;
@@ -213,7 +203,6 @@
template<typename ...OptSpecifiers>
iterator_range<filtered_iterator<sizeof...(OptSpecifiers)>>
filtered(OptSpecifiers ...Ids) const {
- recordQueriedOpts(Ids...);
OptRange Range = getRange({toOptSpecifier(Ids)...});
auto B = Args.begin() + Range.first;
auto E = Args.begin() + Range.second;
@@ -225,7 +214,6 @@
template<typename ...OptSpecifiers>
iterator_range<filtered_reverse_iterator<sizeof...(OptSpecifiers)>>
filtered_reverse(OptSpecifiers ...Ids) const {
- recordQueriedOpts(Ids...);
OptRange Range = getRange({toOptSpecifier(Ids)...});
auto B = Args.rend() - Range.second;
auto E = Args.rend() - Range.first;
@@ -320,10 +308,6 @@
A->render(*this, Output);
}
- /// AddAllArgsExcept - Render all arguments not matching any of the excluded
- /// ids.
- void AddAllArgsExcept(ArgStringList &Output,
- const DenseSet<unsigned> &ExcludeIds) const;
/// AddAllArgsExcept - Render all arguments matching any of the given ids
/// and not matching any of the excluded ids.
void AddAllArgsExcept(ArgStringList &Output, ArrayRef<OptSpecifier> Ids,
@@ -357,13 +341,6 @@
/// ClaimAllArgs - Claim all arguments.
///
void ClaimAllArgs() const;
-
- /// Return the OptSpecifiers queried from this argument list.
- const DenseSet<unsigned> &getQueriedOpts() const { return QueriedOpts; }
-
- /// Clear the set of queried OptSpecifiers.
- void clearQueriedOpts() const { QueriedOpts.clear(); }
-
/// @}
/// @name Arg Synthesis
/// @{
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96325.326362.patch
Type: text/x-patch
Size: 3423 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210225/74b33fec/attachment.bin>
More information about the llvm-commits
mailing list