@@ -332,6 +332,22 @@ ImportObjCHeader("import-objc-header",
332
332
llvm::cl::desc (" header to implicitly import" ),
333
333
llvm::cl::cat(Category));
334
334
335
+ static llvm::cl::list<std::string>
336
+ PluginPath (" plugin-path" ,
337
+ llvm::cl::desc (" plugin-path" ),
338
+ llvm::cl::cat(Category));
339
+
340
+ static llvm::cl::list<std::string>
341
+ LoadPluginLibrary (" load-plugin-library" ,
342
+ llvm::cl::desc (" load plugin library" ),
343
+ llvm::cl::cat(Category));
344
+
345
+ static llvm::cl::list<std::string>
346
+ LoadPluginExecutable (" load-plugin-executable" ,
347
+ llvm::cl::desc (" load plugin executable" ),
348
+ llvm::cl::cat(Category));
349
+
350
+
335
351
static llvm::cl::opt<bool >
336
352
EnableSourceImport (" enable-source-import" , llvm::cl::Hidden,
337
353
llvm::cl::cat (Category), llvm::cl::init(false ));
@@ -4473,6 +4489,33 @@ int main(int argc, char *argv[]) {
4473
4489
}
4474
4490
}
4475
4491
4492
+ for (auto path : options::PluginPath) {
4493
+ InitInvok.getSearchPathOptions ().PluginSearchPaths .push_back (path);
4494
+ }
4495
+ if (!options::LoadPluginLibrary.empty ()) {
4496
+ std::vector<std::string> paths;
4497
+ for (auto path: options::LoadPluginLibrary) {
4498
+ llvm::errs () << " LoadPluginLibrary: " << path << " \n " ;
4499
+ paths.push_back (path);
4500
+ }
4501
+ InitInvok.getSearchPathOptions ().setCompilerPluginLibraryPaths (paths);
4502
+ }
4503
+ if (!options::LoadPluginExecutable.empty ()) {
4504
+ std::vector<PluginExecutablePathAndModuleNames> pairs;
4505
+ for (auto arg: options::LoadPluginExecutable) {
4506
+ StringRef path;
4507
+ StringRef modulesStr;
4508
+ std::tie (path, modulesStr) = StringRef (arg).rsplit (' #' );
4509
+ std::vector<std::string> moduleNames;
4510
+ for (auto name : llvm::split (modulesStr, ' ,' )) {
4511
+ moduleNames.emplace_back (name);
4512
+ }
4513
+ pairs.push_back ({std::string (path), std::move (moduleNames)});
4514
+ }
4515
+
4516
+ InitInvok.getSearchPathOptions ().setCompilerPluginExecutablePaths (std::move (pairs));
4517
+ }
4518
+
4476
4519
// Process the clang arguments last and allow them to override previously
4477
4520
// set options.
4478
4521
if (!CCArgs.empty ()) {
0 commit comments