TargetLibraryInfoImpl *TLII, ToolOutputFile *Out,
ToolOutputFile *ThinLTOLinkOut,
ToolOutputFile *OptRemarkFile,
- StringRef PassPipeline, ArrayRef<StringRef> Passes,
+ StringRef PassPipeline,
ArrayRef<PassPlugin> PassPlugins,
OutputKind OK, VerifierKind VK,
bool ShouldPreserveAssemblyUseListOrder,
// Add passes according to the -passes options.
if (!PassPipeline.empty()) {
- assert(Passes.empty() &&
- "PassPipeline and Passes should not both contain passes");
if (auto Err = PB.parsePassPipeline(MPM, PassPipeline)) {
errs() << Arg0 << ": " << toString(std::move(Err)) << "\n";
return false;
}
}
- // Add passes specified using the legacy PM syntax (i.e. not using
- // -passes). This should be removed later when such support has been
- // deprecated, i.e. when all lit tests running opt (and not using
- // -enable-new-pm=0) have been updated to use -passes.
- for (auto PassName : Passes) {
- if (auto Err = PB.parsePassPipeline(MPM, PassName)) {
- errs() << Arg0 << ": " << toString(std::move(Err)) << "\n";
- return false;
- }
- }
if (VK > VK_NoVerifier)
MPM.addPass(VerifierPass());
bool runPassPipeline(StringRef Arg0, Module &M, TargetMachine *TM,
TargetLibraryInfoImpl *TLII, ToolOutputFile *Out,
ToolOutputFile *ThinLinkOut, ToolOutputFile *OptRemarkFile,
- StringRef PassPipeline, ArrayRef<StringRef> PassInfos,
+ StringRef PassPipeline,
ArrayRef<PassPlugin> PassPlugins, opt_tool::OutputKind OK,
opt_tool::VerifierKind VK,
bool ShouldPreserveAssemblyUseListOrder,
"-debug-pass-manager, or use the legacy PM (-enable-new-pm=0)\n";
return 1;
}
- if (PassPipeline.getNumOccurrences() > 0 && PassList.size() > 0) {
- errs()
- << "Cannot specify passes via both -foo-pass and --passes=foo-pass\n";
- return 1;
- }
auto NumOLevel = OptLevelO0 + OptLevelO1 + OptLevelO2 + OptLevelO3 +
OptLevelOs + OptLevelOz;
if (NumOLevel > 1) {
errs() << "Cannot specify multiple -O#\n";
return 1;
}
- if (NumOLevel > 0 &&
- (PassPipeline.getNumOccurrences() > 0 || PassList.size() > 0)) {
+ if (NumOLevel > 0 && (PassPipeline.getNumOccurrences() > 0)) {
errs() << "Cannot specify -O# and --passes=/--foo-pass, use "
"-passes='default<O#>,other-pass'\n";
return 1;
}
std::string Pipeline = PassPipeline;
- SmallVector<StringRef, 4> Passes;
if (OptLevelO0)
Pipeline = "default<O0>";
if (OptLevelO1)
Pipeline = "default<Os>";
if (OptLevelOz)
Pipeline = "default<Oz>";
- for (const auto &P : PassList)
- Passes.push_back(P->getPassArgument());
OutputKind OK = OK_NoOutput;
if (!NoOutput)
OK = OutputAssembly
// layer.
return runPassPipeline(argv[0], *M, TM.get(), &TLII, Out.get(),
ThinLinkOut.get(), RemarksFile.get(), Pipeline,
- Passes, PluginList, OK, VK, PreserveAssemblyUseListOrder,
+ PluginList, OK, VK, PreserveAssemblyUseListOrder,
PreserveBitcodeUseListOrder, EmitSummaryIndex,
EmitModuleHash, EnableDebugify,
VerifyDebugInfoPreserve)