#define LLVM_OPTION_OPTTABLE_H
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/Option/OptSpecifier.h"
/// The union of all option prefixes. If an argument does not begin with
/// one of these, it is an input.
StringSet<> PrefixesUnion;
- std::string PrefixChars;
+ SmallString<8> PrefixChars;
private:
const Info &getInfo(OptSpecifier Opt) const {
}
// Build prefix chars.
- for (StringSet<>::const_iterator I = PrefixesUnion.begin(),
- E = PrefixesUnion.end(); I != E; ++I) {
- StringRef Prefix = I->getKey();
+ for (const StringRef &Prefix : PrefixesUnion.keys()) {
for (char C : Prefix)
if (!is_contained(PrefixChars, C))
PrefixChars.push_back(C);
static bool isInput(const StringSet<> &Prefixes, StringRef Arg) {
if (Arg == "-")
return true;
- for (StringSet<>::const_iterator I = Prefixes.begin(),
- E = Prefixes.end(); I != E; ++I)
- if (Arg.startswith(I->getKey()))
+ for (const StringRef &Prefix : Prefixes.keys())
+ if (Arg.startswith(Prefix))
return false;
return true;
}