From ca089b24d48ef6fa8da2d0bb8c25bb802c4a95c0 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 13 Jul 2017 19:25:18 +0000 Subject: Vendor import of llvm trunk r307894: https://llvm.org/svn/llvm-project/llvm/trunk@307894 --- lib/Option/OptTable.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/Option/OptTable.cpp') diff --git a/lib/Option/OptTable.cpp b/lib/Option/OptTable.cpp index acb9e8d015bc..bcd365236e46 100644 --- a/lib/Option/OptTable.cpp +++ b/lib/Option/OptTable.cpp @@ -225,11 +225,15 @@ OptTable::suggestValueCompletions(StringRef Option, StringRef Arg) const { return {}; } -std::vector OptTable::findByPrefix(StringRef Cur) const { +std::vector +OptTable::findByPrefix(StringRef Cur, unsigned short DisableFlags) const { std::vector Ret; for (const Info &In : OptionInfos.slice(FirstSearchableIndex)) { - if (!In.Prefixes) + if (!In.Prefixes || (!In.HelpText && !In.GroupID)) + continue; + if (In.Flags & DisableFlags) continue; + for (int I = 0; In.Prefixes[I]; I++) { std::string S = std::string(In.Prefixes[I]) + std::string(In.Name); if (StringRef(S).startswith(Cur)) -- cgit v1.3