1111#include " support/Logger.h"
1212#include " support/Trace.h"
1313#include " clang/Driver/Driver.h"
14- #include " clang/Driver/Options.h"
1514#include " clang/Frontend/CompilerInvocation.h"
15+ #include " clang/Options/Options.h"
1616#include " clang/Tooling/CompilationDatabase.h"
1717#include " clang/Tooling/Tooling.h"
1818#include " llvm/ADT/ArrayRef.h"
@@ -206,7 +206,7 @@ void CommandMangler::operator()(tooling::CompileCommand &Command,
206206 if (Cmd.empty ())
207207 return ;
208208
209- auto &OptTable = clang::driver:: getDriverOptTable ();
209+ auto &OptTable = getDriverOptTable ();
210210 // OriginalArgs needs to outlive ArgList.
211211 llvm::SmallVector<const char *, 16 > OriginalArgs;
212212 OriginalArgs.reserve (Cmd.size ());
@@ -222,8 +222,8 @@ void CommandMangler::operator()(tooling::CompileCommand &Command,
222222 llvm::opt::InputArgList ArgList;
223223 ArgList = OptTable.ParseArgs (
224224 llvm::ArrayRef (OriginalArgs).drop_front (), IgnoredCount, IgnoredCount,
225- llvm::opt::Visibility (IsCLMode ? driver:: options::CLOption
226- : driver:: options::ClangOption));
225+ llvm::opt::Visibility (IsCLMode ? options::CLOption
226+ : options::ClangOption));
227227
228228 llvm::SmallVector<unsigned , 1 > IndicesToDrop;
229229 // Having multiple architecture options (e.g. when building fat binaries)
@@ -232,7 +232,7 @@ void CommandMangler::operator()(tooling::CompileCommand &Command,
232232 // As there are no signals to figure out which one user actually wants. They
233233 // can explicitly specify one through `CompileFlags.Add` if need be.
234234 unsigned ArchOptCount = 0 ;
235- for (auto *Input : ArgList.filtered (driver:: options::OPT_arch)) {
235+ for (auto *Input : ArgList.filtered (options::OPT_arch)) {
236236 ++ArchOptCount;
237237 for (auto I = 0U ; I <= Input->getNumValues (); ++I)
238238 IndicesToDrop.push_back (Input->getIndex () + I);
@@ -262,13 +262,12 @@ void CommandMangler::operator()(tooling::CompileCommand &Command,
262262 // explicitly at the end of the flags. This ensures modifications done in the
263263 // following steps apply in more cases (like setting -x, which only affects
264264 // inputs that come after it).
265- for (auto *Input : ArgList.filtered (driver:: options::OPT_INPUT)) {
265+ for (auto *Input : ArgList.filtered (options::OPT_INPUT)) {
266266 SawInput (Input->getValue (0 ));
267267 IndicesToDrop.push_back (Input->getIndex ());
268268 }
269269 // Anything after `--` is also treated as input, drop them as well.
270- if (auto *DashDash =
271- ArgList.getLastArgNoClaim (driver::options::OPT__DASH_DASH)) {
270+ if (auto *DashDash = ArgList.getLastArgNoClaim (options::OPT__DASH_DASH)) {
272271 auto DashDashIndex = DashDash->getIndex () + 1 ; // +1 accounts for Cmd[0]
273272 // Another +1 so we don't treat the `--` itself as an input.
274273 for (unsigned I = DashDashIndex + 1 ; I < Cmd.size (); ++I)
@@ -424,11 +423,11 @@ DriverMode getDriverMode(const std::vector<std::string> &Args) {
424423// Returns the set of DriverModes where an option may be used.
425424unsigned char getModes (const llvm::opt::Option &Opt) {
426425 unsigned char Result = DM_None;
427- if (Opt.hasVisibilityFlag (driver:: options::ClangOption))
426+ if (Opt.hasVisibilityFlag (options::ClangOption))
428427 Result |= DM_GCC;
429- if (Opt.hasVisibilityFlag (driver:: options::CC1Option))
428+ if (Opt.hasVisibilityFlag (options::CC1Option))
430429 Result |= DM_CC1;
431- if (Opt.hasVisibilityFlag (driver:: options::CLOption))
430+ if (Opt.hasVisibilityFlag (options::CLOption))
432431 Result |= DM_CL;
433432 return Result;
434433}
@@ -442,8 +441,8 @@ llvm::ArrayRef<ArgStripper::Rule> ArgStripper::rulesFor(llvm::StringRef Arg) {
442441 using TableTy =
443442 llvm::StringMap<llvm::SmallVector<Rule, 4 >, llvm::BumpPtrAllocator>;
444443 static TableTy *Table = [] {
445- auto &DriverTable = driver:: getDriverOptTable ();
446- using DriverID = clang::driver:: options::ID;
444+ auto &DriverTable = getDriverOptTable ();
445+ using DriverID = clang::options::ID;
447446
448447 // Collect sets of aliases, so we can treat -foo and -foo= as synonyms.
449448 // Conceptually a double-linked list: PrevAlias[I] -> I -> NextAlias[I].
@@ -468,7 +467,7 @@ llvm::ArrayRef<ArgStripper::Rule> ArgStripper::rulesFor(llvm::StringRef Arg) {
468467 FLAGS, VISIBILITY, PARAM, HELPTEXT, HELPTEXTSFORVARIANTS, \
469468 METAVAR, VALUES, SUBCOMMANDIDS_OFFSET) \
470469 {DriverID::OPT_##ID, DriverID::OPT_##ALIAS, ALIASARGS},
471- #include " clang/Driver /Options.inc"
470+ #include " clang/Options /Options.inc"
472471#undef OPTION
473472 };
474473 for (auto &E : AliasTable)
0 commit comments