"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/Tooling/CommonOptionsParser.cpp" between
cfe-8.0.1.src.tar.xz and cfe-9.0.0.src.tar.xz

About: Clang is an LLVM front end for the C, C++, and Objective-C languages. Clang aims to provide a better user experience through expressive diagnostics, a high level of conformance to language standards, fast compilation, and low memory use.

CommonOptionsParser.cpp  (cfe-8.0.1.src.tar.xz):CommonOptionsParser.cpp  (cfe-9.0.0.src.tar.xz)
//===--- CommonOptionsParser.cpp - common options for clang tools ---------===// //===--- CommonOptionsParser.cpp - common options for clang tools ---------===//
// //
// The LLVM Compiler Infrastructure // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// // See https://llvm.org/LICENSE.txt for license information.
// This file is distributed under the University of Illinois Open Source // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// License. See LICENSE.TXT for details.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file implements the CommonOptionsParser class used to parse common // This file implements the CommonOptionsParser class used to parse common
// command-line options for clang tools, so that they can be run as separate // command-line options for clang tools, so that they can be run as separate
// command-line applications with a consistent common interface for handling // command-line applications with a consistent common interface for handling
// compilation database and input files. // compilation database and input files.
// //
// It provides a common subset of command-line options, common algorithm // It provides a common subset of command-line options, common algorithm
// for locating a compilation database and source files, and help messages // for locating a compilation database and source files, and help messages
skipping to change at line 43 skipping to change at line 42
const char *const CommonOptionsParser::HelpMessage = const char *const CommonOptionsParser::HelpMessage =
"\n" "\n"
"-p <build-path> is used to read a compile command database.\n" "-p <build-path> is used to read a compile command database.\n"
"\n" "\n"
"\tFor example, it can be a CMake build directory in which a file named\n" "\tFor example, it can be a CMake build directory in which a file named\n"
"\tcompile_commands.json exists (use -DCMAKE_EXPORT_COMPILE_COMMANDS=ON\n" "\tcompile_commands.json exists (use -DCMAKE_EXPORT_COMPILE_COMMANDS=ON\n"
"\tCMake option to get this output). When no build path is specified,\n" "\tCMake option to get this output). When no build path is specified,\n"
"\ta search for compile_commands.json will be attempted through all\n" "\ta search for compile_commands.json will be attempted through all\n"
"\tparent paths of the first input file . See:\n" "\tparent paths of the first input file . See:\n"
"\thttp://clang.llvm.org/docs/HowToSetupToolingForLLVM.html for an\n" "\thttps://clang.llvm.org/docs/HowToSetupToolingForLLVM.html for an\n"
"\texample of setting up Clang Tooling on a source tree.\n" "\texample of setting up Clang Tooling on a source tree.\n"
"\n" "\n"
"<source0> ... specify the paths of source files. These paths are\n" "<source0> ... specify the paths of source files. These paths are\n"
"\tlooked up in the compile command database. If the path of a file is\n" "\tlooked up in the compile command database. If the path of a file is\n"
"\tabsolute, it needs to point into CMake's source tree. If the path is\n" "\tabsolute, it needs to point into CMake's source tree. If the path is\n"
"\trelative, the current working directory needs to be in the CMake\n" "\trelative, the current working directory needs to be in the CMake\n"
"\tsource tree and the file must be in a subdirectory of the current\n" "\tsource tree and the file must be in a subdirectory of the current\n"
"\tworking directory. \"./\" prefixes in the relative files will be\n" "\tworking directory. \"./\" prefixes in the relative files will be\n"
"\tautomatically removed, but the rest of a relative path must be a\n" "\tautomatically removed, but the rest of a relative path must be a\n"
"\tsuffix of a path in the compile command database.\n" "\tsuffix of a path in the compile command database.\n"
skipping to change at line 87 skipping to change at line 86
std::vector<CompileCommand> Commands) const { std::vector<CompileCommand> Commands) const {
for (CompileCommand &Command : Commands) for (CompileCommand &Command : Commands)
for (const auto &Adjuster : Adjusters) for (const auto &Adjuster : Adjusters)
Command.CommandLine = Adjuster(Command.CommandLine, Command.Filename); Command.CommandLine = Adjuster(Command.CommandLine, Command.Filename);
return Commands; return Commands;
} }
llvm::Error CommonOptionsParser::init( llvm::Error CommonOptionsParser::init(
int &argc, const char **argv, cl::OptionCategory &Category, int &argc, const char **argv, cl::OptionCategory &Category,
llvm::cl::NumOccurrencesFlag OccurrencesFlag, const char *Overview) { llvm::cl::NumOccurrencesFlag OccurrencesFlag, const char *Overview) {
static cl::opt<bool> Help("h", cl::desc("Alias for -help"), cl::Hidden,
cl::sub(*cl::AllSubCommands));
static cl::opt<std::string> BuildPath("p", cl::desc("Build path"), static cl::opt<std::string> BuildPath("p", cl::desc("Build path"),
cl::Optional, cl::cat(Category), cl::Optional, cl::cat(Category),
cl::sub(*cl::AllSubCommands)); cl::sub(*cl::AllSubCommands));
static cl::list<std::string> SourcePaths( static cl::list<std::string> SourcePaths(
cl::Positional, cl::desc("<source0> [... <sourceN>]"), OccurrencesFlag, cl::Positional, cl::desc("<source0> [... <sourceN>]"), OccurrencesFlag,
cl::cat(Category), cl::sub(*cl::AllSubCommands)); cl::cat(Category), cl::sub(*cl::AllSubCommands));
static cl::list<std::string> ArgsAfter( static cl::list<std::string> ArgsAfter(
 End of changes. 3 change blocks. 
7 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)