@@ -160,13 +160,13 @@ DependencyScanningTool::initScannerForAction(
160
160
161
161
llvm::ErrorOr<std::unique_ptr<CompilerInstance>>
162
162
DependencyScanningTool::initCompilerInstanceForScan (
163
- ArrayRef<const char *> Command ) {
163
+ ArrayRef<const char *> CommandArgs ) {
164
164
// State unique to an individual scan
165
165
auto Instance = std::make_unique<CompilerInstance>();
166
166
Instance->addDiagnosticConsumer (&PDC);
167
167
168
168
// Basic error checking on the arguments
169
- if (Command .empty ()) {
169
+ if (CommandArgs .empty ()) {
170
170
Instance->getDiags ().diagnose (SourceLoc (), diag::error_no_frontend_args);
171
171
return std::make_error_code (std::errc::invalid_argument);
172
172
}
@@ -180,16 +180,7 @@ DependencyScanningTool::initCompilerInstanceForScan(
180
180
// We must do so because LLVM options parsing is done using a managed
181
181
// static `GlobalParser`.
182
182
llvm::cl::ResetAllOptionOccurrences ();
183
-
184
- // Parse arguments.
185
- std::string CommandString;
186
- for (const auto *c : Command) {
187
- CommandString.append (c);
188
- CommandString.append (" " );
189
- }
190
- SmallVector<const char *, 4 > Args;
191
- llvm::cl::TokenizeGNUCommandLine (CommandString, Saver, Args);
192
- if (Invocation.parseArgs (Args, Instance->getDiags ())) {
183
+ if (Invocation.parseArgs (CommandArgs, Instance->getDiags ())) {
193
184
return std::make_error_code (std::errc::invalid_argument);
194
185
}
195
186
0 commit comments