/llvm-project/clang/unittests/Tooling/ |
H A D | CompilationDatabaseTest.cpp | 160 ASSERT_EQ(1u, Commands[0].CommandLine.size()); 161 EXPECT_EQ(Command1, Commands[0].CommandLine[0]) << ErrorMessage; 165 ASSERT_EQ(1u, Commands[1].CommandLine.size()); 166 EXPECT_EQ(Command2, Commands[1].CommandLine[0]) << ErrorMessage; 184 ASSERT_EQ(1u, Commands[0].CommandLine.size()); 185 EXPECT_EQ(Command2, Commands[0].CommandLine[0]) << ErrorMessage; 188 ASSERT_EQ(1u, Commands[1].CommandLine.size()); 189 EXPECT_EQ(Command1, Commands[1].CommandLine[0]) << ErrorMessage; 224 EXPECT_EQ(1u, FoundCommand.CommandLine.size()) << ErrorMessage; in TEST() 225 EXPECT_EQ(Arguments, FoundCommand.CommandLine[0]) << ErrorMessage; in TEST() [all …]
|
/llvm-project/clang-tools-extra/clangd/unittests/ |
H A D | CompileCommandsTests.cpp | 54 Cmd.CommandLine = {Target + "-clang++", "--", "foo.cc", "bar.cc"}; in TEST() 56 EXPECT_THAT(Cmd.CommandLine, in TEST() 69 Cmd.CommandLine = {"clang", "foo.cc"}; in TEST() 73 EXPECT_THAT(Cmd.CommandLine, ElementsAre(testPath("clang"), "-x", in TEST() 81 Cmd.CommandLine = {"clang++", "foo.cc"}; in TEST() 83 EXPECT_THAT(Cmd.CommandLine, in TEST() 92 Cmd.CommandLine = {"clang++", "foo.cc"}; in TEST() 94 EXPECT_THAT(llvm::join(Cmd.CommandLine, " "), in TEST() 103 Cmd.CommandLine = {"clang++", "foo.cc"}; in TEST() 105 EXPECT_EQ(testPath("fake/clang++"), Cmd.CommandLine in TEST() [all...] |
H A D | GlobalCompilationDatabaseTests.cpp | 46 EXPECT_THAT(Cmd.CommandLine, ElementsAre("clang", testPath("foo/bar.cc"))); in TEST() 51 EXPECT_THAT(Cmd.CommandLine, ElementsAre("clang", "-xobjective-c++-header", in TEST() 54 EXPECT_THAT(Cmd.CommandLine, ElementsAre("clang", "-xobjective-c++-header", in TEST() 90 EXPECT_THAT(CDB.getCompileCommand(testPath("foo.cc"))->CommandLine, in TEST_F() 97 EXPECT_THAT(CDB.getCompileCommand(testPath("foo.cc"))->CommandLine, in TEST_F() 102 EXPECT_THAT(CDB.getCompileCommand(testPath("missing.cc"))->CommandLine, in TEST_F() 108 EXPECT_THAT(CDB.getFallbackCommand(testPath("bar.cc")).CommandLine, in TEST_F() 117 EXPECT_THAT(CDB.getCompileCommand(testPath("bar.cc"))->CommandLine, in TEST_F() 120 EXPECT_THAT(CDB.getFallbackCommand(testPath("foo.cc")).CommandLine, in TEST_F() 144 Cmd.CommandLine in TEST_F() [all...] |
H A D | TestFS.cpp | 67 auto CommandLine = ExtraClangFlags; in getCompileCommand() local 68 CommandLine.insert(CommandLine.begin(), "clang"); in getCompileCommand() 71 CommandLine.push_back(std::string(File)); in getCompileCommand() 76 CommandLine.push_back(std::string(RelativeFilePath.str())); in getCompileCommand() 82 FileName, std::move(CommandLine), "")}; in getCompileCommand()
|
H A D | BackgroundIndexTests.cpp | 107 Cmd.CommandLine = {"clang++", "-DA=1", testPath("root/A.cc")}; in TEST_F() 126 Cmd.CommandLine = {"clang++", Filename}; in TEST_F() 200 Cmd.CommandLine = {"clang++", "-DA=1", testPath("root/A.cc")}; in TEST_F() 212 Cmd.CommandLine = {"clang++", Cmd.Filename}; in TEST_F() 255 Cmd.CommandLine = {"clang++", testPath("root/A.cc")}; in TEST_F() 285 Cmd.CommandLine = {"clang++", testPath("root/A.cc")}; in TEST_F() 355 Cmd.CommandLine = {"clang++", testPath("root/A.cc")}; in TEST_F() 404 Cmd.CommandLine = {"clang++", testPath("root/A.cc")}; in TEST_F() 478 Cmd.CommandLine = {"clang++", testPath("root/A.cc")}; in TEST_F() 540 Cmd.CommandLine in TEST_F() [all...] |
H A D | SerializationTests.cpp | 110 CommandLine: 199 EXPECT_THAT(Cmd.CommandLine, ElementsAre("cmd1", "cmd2")); in TEST() 301 Cmd.CommandLine.push_back("cmd1"); in TEST() 302 Cmd.CommandLine.push_back("cmd2"); in TEST() 318 EXPECT_EQ(SerializedCmd.CommandLine, Cmd.CommandLine); in TEST()
|
/llvm-project/clang/lib/Tooling/ |
H A D | Tooling.cpp | 46 #include "llvm/Support/CommandLine.h" 271 void addTargetAndModeForProgramName(std::vector<std::string> &CommandLine, in addTargetAndModeForProgramName() argument 273 if (CommandLine.empty() || InvokedAs.empty()) in addTargetAndModeForProgramName() 291 // Skip CommandLine[0]. in addTargetAndModeForProgramName() 292 for (auto Token = ++CommandLine.begin(); Token != CommandLine.end(); in addTargetAndModeForProgramName() 300 CommandLine.insert(++CommandLine.begin(), TargetMode.DriverMode); in addTargetAndModeForProgramName() 303 CommandLine.insert(++CommandLine in addTargetAndModeForProgramName() 308 addExpandedResponseFiles(std::vector<std::string> & CommandLine,llvm::StringRef WorkingDir,llvm::cl::TokenizerCallback Tokenizer,llvm::vfs::FileSystem & FS) addExpandedResponseFiles() argument 353 ToolInvocation(std::vector<std::string> CommandLine,ToolAction * Action,FileManager * Files,std::shared_ptr<PCHContainerOperations> PCHContainerOps) ToolInvocation() argument 359 ToolInvocation(std::vector<std::string> CommandLine,std::unique_ptr<FrontendAction> FAction,FileManager * Files,std::shared_ptr<PCHContainerOperations> PCHContainerOps) ToolInvocation() argument 597 std::vector<std::string> CommandLine = CompileCommand.CommandLine; run() local [all...] |
H A D | InterpolatingCompilationDatabase.cpp | 139 std::vector<std::string> OldArgs = std::move(Cmd.CommandLine); in TransferableCommand() 140 Cmd.CommandLine.clear(); in TransferableCommand() 160 Cmd.CommandLine.emplace_back(OldArgs.front()); in TransferableCommand() 199 Cmd.CommandLine.insert(Cmd.CommandLine.end(), in TransferableCommand() 231 Result.CommandLine.push_back(std::string(Flag)); in transferTo() 233 Result.CommandLine.push_back("-x"); in transferTo() 234 Result.CommandLine.push_back(types::getTypeName(TargetType)); in transferTo() 240 Result.CommandLine.emplace_back(( in transferTo() 244 Result.CommandLine.push_back("--"); in transferTo() 245 Result.CommandLine.push_back(std::string(Filename)); in transferTo()
|
H A D | GuessTargetAndModeCompilationDatabase.cpp | 41 if (Cmd.CommandLine.empty()) in addTargetAndMode() 43 addTargetAndModeForProgramName(Cmd.CommandLine, Cmd.CommandLine.front()); in addTargetAndMode()
|
H A D | CompilationDatabase.cpp | 335 std::vector<const char *> CommandLine(DoubleDash + 1, Argv + Argc); in loadFromCommandLine() local 339 if (!stripPositionalArgs(CommandLine, StrippedArgs, ErrorMsg)) in loadFromCommandLine() 374 const Twine &Directory, ArrayRef<std::string> CommandLine) { in FixedCompilationDatabase() argument 377 CommandLine.begin(), CommandLine.end()); in FixedCompilationDatabase() 386 Result[0].CommandLine.push_back(std::string(FilePath)); in getCompileCommands()
|
H A D | JSONCompilationDatabase.cpp | 54 CommandLineArgumentParser(StringRef CommandLine) in CommandLineArgumentParser() argument 55 : Input(CommandLine), Position(Input.begin()-1) {} in CommandLineArgumentParser() 62 CommandLine.push_back(Argument); in parse() 64 return CommandLine; in parse() 132 std::vector<std::string> CommandLine; member in __anon5a1737c60111::CommandLineArgumentParser
|
/llvm-project/clang/include/clang/Tooling/ |
H A D | CompilationDatabase.h | 47 std::vector<std::string> CommandLine, const Twine &Output) in CompileCommand() 49 CommandLine(std::move(CommandLine)), Output(Output.str()) {} in CompileCommand() 58 std::vector<std::string> CommandLine; member 70 LHS.CommandLine == RHS.CommandLine && LHS.Output == RHS.Output && 200 ArrayRef<std::string> CommandLine);
|
H A D | Tooling.h | 249 /// \param CommandLine The command line arguments to clang. Note that clang 250 /// uses its binary name (CommandLine[0]) to locate its builtin headers. 258 ToolInvocation(std::vector<std::string> CommandLine, 265 /// \param CommandLine The command line arguments to clang. 270 ToolInvocation(std::vector<std::string> CommandLine, ToolAction *Action, 301 std::vector<std::string> CommandLine; 489 /// Changes CommandLine to contain implicit flags that would have been 494 /// be inserted after the first argument in \c CommandLine. 497 /// are already present in `CommandLine` (even if they have different settings 502 /// \param CommandLine th 295 std::vector<std::string> CommandLine; global() variable [all...] |
/llvm-project/clang-tools-extra/clangd/ |
H A D | SystemIncludeExtractor.cpp | 103 llvm::SmallString<128> Driver(Cmd.CommandLine.front()); in DriverArgs() 111 for (size_t I = 0, E = Cmd.CommandLine.size(); I < E; ++I) { in DriverArgs() 112 llvm::StringRef Arg = Cmd.CommandLine[I]; in DriverArgs() 117 Lang = Cmd.CommandLine[I + 1]; in DriverArgs() 131 Sysroot = Cmd.CommandLine[I + 1]; in DriverArgs() 134 ISysroot = Cmd.CommandLine[I + 1]; in DriverArgs() 141 Target = Cmd.CommandLine[I + 1]; in DriverArgs() 146 Stdlib = Cmd.CommandLine[I + 1]; in DriverArgs() 159 Specs.push_back(Cmd.CommandLine[I + 1]); in DriverArgs() 439 auto InsertAt = llvm::find(Cmd.CommandLine, " in addSystemIncludes() [all...] |
/llvm-project/clang/lib/Tooling/DependencyScanning/ |
H A D | DependencyScanningTool.cpp | 74 const std::vector<std::string> &CommandLine, StringRef CWD) { in getDependencyFile() argument 78 Worker.computeDependencies(CWD, CommandLine, Consumer, Controller); in getDependencyFile() 130 auto Result = Worker.computeDependencies(CWD, Command.CommandLine, Consumer, in getP1689ModuleDependencyFile() 143 const std::vector<std::string> &CommandLine, StringRef CWD, in getTranslationUnitDependencies() argument 149 Worker.computeDependencies(CWD, CommandLine, Consumer, Controller); in getTranslationUnitDependencies() 156 StringRef ModuleName, const std::vector<std::string> &CommandLine, in getModuleDependencies() argument 161 llvm::Error Result = Worker.computeDependencies(CWD, CommandLine, Consumer, in getModuleDependencies()
|
H A D | DependencyScanningWorker.cpp | 525 StringRef WorkingDirectory, const std::vector<std::string> &CommandLine, in computeDependencies() 529 for (const std::string &Arg : CommandLine) 540 if (computeDependencies(WorkingDirectory, CommandLine, Consumer, Controller, in forEachDriverJob() 588 std::vector<std::string> CommandLine, DependencyScanningAction &Action, in createAndRunToolInvocation() 593 // Save executable path before providing CommandLine to ToolInvocation in computeDependencies() 594 std::string Executable = CommandLine[0]; in computeDependencies() 595 ToolInvocation Invocation(std::move(CommandLine), &Action, &FM, in computeDependencies() 608 StringRef WorkingDirectory, const std::vector<std::string> &CommandLine, in computeDependencies() 636 ModifiedCommandLine = CommandLine; in computeDependencies() 641 ModifiedCommandLine ? *ModifiedCommandLine : CommandLine; in computeDependencies() 508 computeDependencies(StringRef WorkingDirectory,const std::vector<std::string> & CommandLine,DependencyConsumer & Consumer,DependencyActionController & Controller,std::optional<StringRef> ModuleName) computeDependencies() argument 571 createAndRunToolInvocation(std::vector<std::string> CommandLine,DependencyScanningAction & Action,FileManager & FM,std::shared_ptr<clang::PCHContainerOperations> & PCHContainerOps,DiagnosticsEngine & Diags,DependencyConsumer & Consumer) createAndRunToolInvocation() argument 591 computeDependencies(StringRef WorkingDirectory,const std::vector<std::string> & CommandLine,DependencyConsumer & Consumer,DependencyActionController & Controller,DiagnosticConsumer & DC,std::optional<StringRef> ModuleName) computeDependencies() argument [all...] |
/llvm-project/clang-tools-extra/modularize/ |
H A D | CoverageChecker.h | 49 llvm::ArrayRef<std::string> CommandLine; variable 80 llvm::ArrayRef<std::string> CommandLine, 95 llvm::ArrayRef<std::string> CommandLine, clang::ModuleMap *ModuleMap);
|
H A D | CoverageChecker.cpp | 29 // to be passed in via the CommandLine parameter. 68 #include "llvm/Support/CommandLine.h" 147 ArrayRef<std::string> CommandLine, in CoverageChecker() argument 150 CommandLine(CommandLine), in CoverageChecker() 157 ArrayRef<std::string> CommandLine, clang::ModuleMap *ModuleMap) { in createCoverageChecker() argument 160 CommandLine, ModuleMap); in createCoverageChecker() 281 FixedCompilationDatabase Compilations(Twine(PathBuf), CommandLine); in collectUmbrellaHeaderHeaders()
|
/llvm-project/clang-tools-extra/clangd/index/ |
H A D | Serialization.cpp | 425 std::vector<llvm::StringRef> CommandLine; member 432 writeVar(Cmd.CommandLine.size(), CmdOS); in writeCompileCommand() 433 for (llvm::StringRef C : Cmd.CommandLine) in writeCompileCommand() 441 if (!CmdReader.consumeSize(Cmd.CommandLine)) in readCompileCommand() 443 for (llvm::StringRef &C : Cmd.CommandLine) in readCompileCommand() 546 Result.Cmd->CommandLine.reserve(Cmd.CommandLine.size()); in readRIFF() 547 for (llvm::StringRef C : Cmd.CommandLine) in readRIFF() 548 Result.Cmd->CommandLine.emplace_back(C); in readRIFF() 609 InternedCmd.CommandLine in writeRIFF() [all...] |
/llvm-project/llvm/utils/KillTheDoctor/ |
H A D | KillTheDoctor.cpp | 311 std::string CommandLine(ProgramToRun); in main() local 316 errs() << ToolName << ": Failed to find program: '" << CommandLine in main() 325 CommandLine.push_back(' '); in main() 326 CommandLine.append(Arg); in main() 331 << ToolName << ": Command Line: " << CommandLine << '\n'; in main() 345 const_cast<LPSTR>(CommandLine.c_str()), in main()
|
/llvm-project/clang/tools/libclang/ |
H A D | CXCompilationDatabase.cpp | 128 return static_cast<CompileCommand *>(CCmd)->CommandLine.size(); in clang_CompileCommand_getNumArgs() 139 if (Arg >= Cmd->CommandLine.size()) in clang_CompileCommand_getArg() 142 return cxstring::createRef(Cmd->CommandLine[Arg].c_str()); in clang_CompileCommand_getArg()
|
/llvm-project/llvm/docs/ |
H A D | CommandLine.rst | 2 CommandLine 2.0 Library Manual 11 This document describes the CommandLine argument processing library. It will 12 show you how to use it, and what it can do. The CommandLine library uses a 20 CommandLine library to have the following features: 22 #. Speed: The CommandLine library is very quick and uses little resources. The 29 #. Type Safe: As a user of CommandLine, you don't have to worry about 34 #. No subclasses required: To use CommandLine, you instantiate variables that 45 #. Cleaner: CommandLine supports enum and other types directly, meaning that 50 #. Powerful: The CommandLine library supports many different types of arguments, 53 possible because CommandLine is... [all …]
|
/llvm-project/clang/tools/clang-scan-deps/ |
H A D | ClangScanDeps.cpp | 21 #include "llvm/Support/CommandLine.h" 96 static std::vector<const char *> CommandLine; 232 CommandLine.assign(A->getValues().begin(), A->getValues().end()); in SharedStream() 734 if (!(CommandLine.empty() ^ CompilationDB.empty())) { in getCompilationDatabase() 748 driver::Driver TheDriver(CommandLine[0], llvm::sys::getDefaultTargetTriple(), in getCompilationDatabase() 752 TheDriver.BuildCompilation(CommandLine)); in getCompilationDatabase() 759 CommandLine[0]); in getCompilationDatabase() 784 ArrayRef<const char *> CommandLine) in getCompilationDatabase() 786 for (auto *C : CommandLine) in getCompilationDatabase() 787 Command.CommandLine in getCompilationDatabase() 91 static std::vector<const char *> CommandLine; global() variable 767 InplaceCompilationDatabase(StringRef InputFile,StringRef OutputFile,ArrayRef<const char * > CommandLine) getCompilationDatabase() argument [all...] |
/llvm-project/clang/include/clang/Tooling/DependencyScanning/ |
H A D | DependencyScanningTool.h | 93 getDependencyFile(const std::vector<std::string> &CommandLine, StringRef CWD); 135 getTranslationUnitDependencies(const std::vector<std::string> &CommandLine, 144 StringRef ModuleName, const std::vector<std::string> &CommandLine,
|
H A D | DependencyScanningWorker.h | 93 const std::vector<std::string> &CommandLine, 101 StringRef WorkingDirectory, const std::vector<std::string> &CommandLine,
|