mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 02:33:06 +01:00
[clang][cli] NFC: Remove ArgList infrastructure for recording queries
This patch removes the infrastructure for recording queries in `ArgList`, partially reverting D94472. The infrastructure was used during command line round-trip to determine which arguments should a certain subset of `CompilerInvocation` generate. Since D96280, the command line arguments are being generated all at once, making this code no longer necessary. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D96325
This commit is contained in:
parent
b05a86b7ed
commit
d57c2e0c00
@ -137,16 +137,6 @@ private:
|
|||||||
/// The first and last index of each different OptSpecifier ID.
|
/// The first and last index of each different OptSpecifier ID.
|
||||||
DenseMap<unsigned, OptRange> OptRanges;
|
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
|
/// Get the range of indexes in which options with the specified IDs might
|
||||||
/// reside, or (0, 0) if there are no such options.
|
/// reside, or (0, 0) if there are no such options.
|
||||||
OptRange getRange(std::initializer_list<OptSpecifier> Ids) const;
|
OptRange getRange(std::initializer_list<OptSpecifier> Ids) const;
|
||||||
@ -213,7 +203,6 @@ public:
|
|||||||
template<typename ...OptSpecifiers>
|
template<typename ...OptSpecifiers>
|
||||||
iterator_range<filtered_iterator<sizeof...(OptSpecifiers)>>
|
iterator_range<filtered_iterator<sizeof...(OptSpecifiers)>>
|
||||||
filtered(OptSpecifiers ...Ids) const {
|
filtered(OptSpecifiers ...Ids) const {
|
||||||
recordQueriedOpts(Ids...);
|
|
||||||
OptRange Range = getRange({toOptSpecifier(Ids)...});
|
OptRange Range = getRange({toOptSpecifier(Ids)...});
|
||||||
auto B = Args.begin() + Range.first;
|
auto B = Args.begin() + Range.first;
|
||||||
auto E = Args.begin() + Range.second;
|
auto E = Args.begin() + Range.second;
|
||||||
@ -225,7 +214,6 @@ public:
|
|||||||
template<typename ...OptSpecifiers>
|
template<typename ...OptSpecifiers>
|
||||||
iterator_range<filtered_reverse_iterator<sizeof...(OptSpecifiers)>>
|
iterator_range<filtered_reverse_iterator<sizeof...(OptSpecifiers)>>
|
||||||
filtered_reverse(OptSpecifiers ...Ids) const {
|
filtered_reverse(OptSpecifiers ...Ids) const {
|
||||||
recordQueriedOpts(Ids...);
|
|
||||||
OptRange Range = getRange({toOptSpecifier(Ids)...});
|
OptRange Range = getRange({toOptSpecifier(Ids)...});
|
||||||
auto B = Args.rend() - Range.second;
|
auto B = Args.rend() - Range.second;
|
||||||
auto E = Args.rend() - Range.first;
|
auto E = Args.rend() - Range.first;
|
||||||
@ -320,10 +308,6 @@ public:
|
|||||||
A->render(*this, Output);
|
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
|
/// AddAllArgsExcept - Render all arguments matching any of the given ids
|
||||||
/// and not matching any of the excluded ids.
|
/// and not matching any of the excluded ids.
|
||||||
void AddAllArgsExcept(ArgStringList &Output, ArrayRef<OptSpecifier> Ids,
|
void AddAllArgsExcept(ArgStringList &Output, ArrayRef<OptSpecifier> Ids,
|
||||||
@ -357,13 +341,6 @@ public:
|
|||||||
/// ClaimAllArgs - Claim all arguments.
|
/// ClaimAllArgs - Claim all arguments.
|
||||||
///
|
///
|
||||||
void ClaimAllArgs() const;
|
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
|
/// @name Arg Synthesis
|
||||||
/// @{
|
/// @{
|
||||||
|
@ -90,22 +90,11 @@ StringRef ArgList::getLastArgValue(OptSpecifier Id, StringRef Default) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> ArgList::getAllArgValues(OptSpecifier Id) const {
|
std::vector<std::string> ArgList::getAllArgValues(OptSpecifier Id) const {
|
||||||
recordQueriedOpts(Id);
|
|
||||||
SmallVector<const char *, 16> Values;
|
SmallVector<const char *, 16> Values;
|
||||||
AddAllArgValues(Values, Id);
|
AddAllArgValues(Values, Id);
|
||||||
return std::vector<std::string>(Values.begin(), Values.end());
|
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,
|
void ArgList::AddAllArgsExcept(ArgStringList &Output,
|
||||||
ArrayRef<OptSpecifier> Ids,
|
ArrayRef<OptSpecifier> Ids,
|
||||||
ArrayRef<OptSpecifier> ExcludeIds) const {
|
ArrayRef<OptSpecifier> ExcludeIds) const {
|
||||||
|
Loading…
Reference in New Issue
Block a user