ΒΆvoid addTargetAndModeForProgramName(
std::vector<std::string>& CommandLine,
llvm::StringRef InvokedAs)
void addTargetAndModeForProgramName(
std::vector<std::string>& CommandLine,
llvm::StringRef InvokedAs)
Description
Changes CommandLine to contain implicit flags that would have been defined had the compiler driver been invoked through the path InvokedAs. For example, when called with \c InvokedAs set to `i686-linux-android-g++`, the arguments '-target', 'i686-linux-android`, `--driver-mode=g++` will be inserted after the first argument in \c CommandLine. This function will not add new `-target` or `--driver-mode` flags if they are already present in `CommandLine` (even if they have different settings than would have been inserted).
Declared at: clang/include/clang/Tooling/Tooling.h:506
Parameters
- std::vector<std::string>& CommandLine
- the command line used to invoke the compiler driver or Clang tool, including the path to the executable as \c CommandLine[0].
- llvm::StringRef InvokedAs
- the path to the driver used to infer implicit flags.