diff --git a/include/revng/Pipeline/LLVMContainer.h b/include/revng/Pipeline/LLVMContainer.h index 3c6f88c9c..c07f35a83 100644 --- a/include/revng/Pipeline/LLVMContainer.h +++ b/include/revng/Pipeline/LLVMContainer.h @@ -8,6 +8,7 @@ #include #include #include +#include #include #include "llvm/ADT/DenseSet.h" @@ -209,7 +210,7 @@ private: Global.setLinkage(llvm::GlobalValue::InternalLinkage); } - revng_assert(llvm::verifyModule(*Composite, &llvm::dbgs()) == 0); + revng_assert(llvm::verifyModule(*Composite, nullptr) == 0); Module = std::move(Composite); revng_assert(BeforeEnumeration.contains(this->enumerate())); diff --git a/include/revng/Pipeline/Loader.h b/include/revng/Pipeline/Loader.h index 0b223be3e..e4441235a 100644 --- a/include/revng/Pipeline/Loader.h +++ b/include/revng/Pipeline/Loader.h @@ -135,7 +135,6 @@ public: } private: - void emitTerminators(Runner &Runner) const; llvm::Error parseSteps(Runner &Runner, const PipelineDeclaration &Declaration) const; llvm::Error parseDeclarations(Runner &Runner, diff --git a/include/revng/Pipeline/Step.h b/include/revng/Pipeline/Step.h index b5c9cf368..4f8331c52 100644 --- a/include/revng/Pipeline/Step.h +++ b/include/revng/Pipeline/Step.h @@ -82,7 +82,7 @@ public: /// /// The contained values stays unchanged. ContainerSet cloneAndRun(Context &Ctx, - const ContainerToTargetsMap &Targets, + ContainerSet &&Targets, llvm::raw_ostream *OS = nullptr); /// Returns the set of goals that are already contained in the backing diff --git a/lib/Pipeline/Loader.cpp b/lib/Pipeline/Loader.cpp index 190e2dbe0..7cbc97d4c 100644 --- a/lib/Pipeline/Loader.cpp +++ b/lib/Pipeline/Loader.cpp @@ -116,23 +116,12 @@ Loader::load(llvm::ArrayRef Pipelines) const { return load(Declarations); } -void Loader::emitTerminators(Runner &Runner) const { - auto LeafsCount = llvm::count_if(Runner, [&Runner](const Step &CurrentStep) { - return not Runner.hasSuccessors(CurrentStep); - }); - - for (const Step &CurrentStep : Runner) - if (not Runner.hasSuccessors(CurrentStep)) { - std::string - Name = (LeafsCount == 1 ? "End" : "End" + CurrentStep.getName()).str(); - Runner.emplaceStep(CurrentStep.getName().str(), std::move(Name)); - } -} llvm::Error Loader::parseSteps(Runner &Runner, const PipelineDeclaration &Declaration) const { - std::string LastAddedStep = Declaration.From; + std::string LastAddedStep = Declaration.From.empty() ? "begin" : + Declaration.From; for (const auto &Step : Declaration.Steps) { if (not isInvocationUsed(Step.EnabledWhen)) continue; @@ -205,10 +194,11 @@ Loader::load(llvm::ArrayRef Pipelines) const { if (auto Error = parseDeclarations(ToReturn, *Declaration); Error) return std::move(Error); + ToReturn.emplaceStep("", "begin"); + for (const auto *Declaration : ToSort) if (auto Error = parseSteps(ToReturn, *Declaration); Error) return std::move(Error); - emitTerminators(ToReturn); return ToReturn; } diff --git a/lib/Pipeline/Runner.cpp b/lib/Pipeline/Runner.cpp index bb204dcf4..2cef3ff7d 100644 --- a/lib/Pipeline/Runner.cpp +++ b/lib/Pipeline/Runner.cpp @@ -60,7 +60,7 @@ static void explainPipeline(const ContainerToTargetsMap &Targets, prettyPrintStatus(Targets, OS, 1); - if (Requirements.empty()) { + if (Requirements.size() <= 1) { OS.changeColor(llvm::raw_ostream::Colors::GREEN); OS << "Already satisfied\n"; return; @@ -71,8 +71,6 @@ static void explainPipeline(const ContainerToTargetsMap &Targets, OS << "Deduced Step Level Requirements: \n"; for (const PipelineExecutionEntry &Entry : llvm::reverse(Requirements)) { - if (Entry.Objectives.empty()) - continue; OS.indent(1); OS.changeColor(llvm::raw_ostream::Colors::MAGENTA); @@ -96,7 +94,7 @@ Error Runner::getInvalidations(StatusMap &Invalidated) const { ContainerToTargetsMap &Outputs = Invalidated[NextS.getName()]; - auto Deduced = S.deduceResults(Inputs); + auto Deduced = NextS.deduceResults(Inputs); NextS.containers().intersect(Deduced); Outputs.merge(Deduced); } @@ -155,7 +153,7 @@ PipelineFileMapping::parse(StringRef ToParse) { Error PipelineFileMapping::loadFromDisk(Runner &LoadInto) const { if (not LoadInto.containsStep(Step)) return llvm::createStringError(llvm::inconvertibleErrorCode(), - "No known step " + Container); + "No known step " + Step); if (not LoadInto[Step].containers().containsOrCanCreate(Container)) return llvm::createStringError(llvm::inconvertibleErrorCode(), @@ -167,7 +165,7 @@ Error PipelineFileMapping::loadFromDisk(Runner &LoadInto) const { Error PipelineFileMapping::storeToDisk(const Runner &LoadInto) const { if (not LoadInto.containsStep(Step)) return llvm::createStringError(llvm::inconvertibleErrorCode(), - "No known step " + Container); + "No known step " + Step); if (not LoadInto[Step].containers().containsOrCanCreate(Container)) return llvm::createStringError(llvm::inconvertibleErrorCode(), @@ -195,7 +193,6 @@ Error Runner::loadFromDisk(llvm::StringRef DirPath) { Error Runner::run(llvm::StringRef EndingStepName, const ContainerToTargetsMap &Targets, llvm::raw_ostream *DiagnosticLog) { - optional CurrentContainer = std::nullopt; ContainerToTargetsMap ToLoad; vector ToExec; @@ -208,20 +205,24 @@ Error Runner::run(llvm::StringRef EndingStepName, if (DiagnosticLog != nullptr) explainPipeline(Targets, ToLoad, ToExec, *DiagnosticLog); - size_t CurrentStep = 0; - for (auto &StepGoalsPairs : ToExec) { + if (ToExec.size() <= 1) + return Error::success(); + + auto &FirstStepContainers = ToExec.front().ToExecute->containers(); + auto CurrentContainer(FirstStepContainers.cloneFiltered(ToLoad)); + for (auto &StepGoalsPairs : + llvm::make_range(ToExec.begin() + 1, ToExec.end())) { auto &[Step, Goals] = StepGoalsPairs; - if (CurrentContainer.has_value()) { - Step->containers().mergeBack(std::move(*CurrentContainer)); - } - - CurrentStep++; - if (CurrentStep == ToExec.size()) - break; - - CurrentContainer = Step->cloneAndRun(*TheContext, ToLoad, DiagnosticLog); - ToLoad = Step->deduceResults(CurrentContainer->enumerate()); + CurrentContainer = Step->cloneAndRun(*TheContext, + std::move(CurrentContainer), + DiagnosticLog); } + + if (DiagnosticLog != nullptr) { + *DiagnosticLog << "Produced:\n"; + CurrentContainer.enumerate().dump(*DiagnosticLog); + } + return Error::success(); } @@ -250,6 +251,6 @@ void Runner::deduceAllPossibleTargets(State &Out) const { continue; const Step &Step = NextStep.getPredecessor(); - Out[NextStep.getName()].merge(Step.deduceResults(Out[Step.getName()])); + Out[NextStep.getName()].merge(NextStep.deduceResults(Out[Step.getName()])); } } diff --git a/lib/Pipeline/Step.cpp b/lib/Pipeline/Step.cpp index 2ce1e968e..bf6ea4c33 100644 --- a/lib/Pipeline/Step.cpp +++ b/lib/Pipeline/Step.cpp @@ -11,6 +11,7 @@ #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" +#include "revng/Pipeline/ContainerSet.h" #include "revng/Pipeline/Step.h" #include "revng/Support/Debug.h" @@ -31,10 +32,10 @@ Step::analyzeGoals(const ContainerToTargetsMap &RequiredGoals, ContainerToTargetsMap &AlreadyAviable) const { ContainerToTargetsMap Targets = RequiredGoals; + removeSatisfiedGoals(Targets, AlreadyAviable); for (const auto &Pipe : llvm::make_range(Pipes.rbegin(), Pipes.rend())) { Targets = Pipe->getRequirements(Targets); } - removeSatisfiedGoals(Targets, AlreadyAviable); return Targets; } @@ -51,7 +52,7 @@ void Step::explainStartStep(const ContainerToTargetsMap &Targets, OS->changeColor(llvm::raw_ostream::Colors::MAGENTA); (*OS) << getName(); OS->changeColor(llvm::raw_ostream::Colors::GREEN); - (*OS) << " by cloning\n"; + (*OS) << " running on \n"; prettyPrintStatus(Targets, *OS, Indentation + 1); } @@ -87,21 +88,22 @@ void Step::explainExecutedPipe(const Context &Ctx, (*OS) << "\n"; } -ContainerSet Step::cloneAndRun(Context &Ctx, - const ContainerToTargetsMap &Targets, - llvm::raw_ostream *OS) { - auto RunningContainers = Containers.cloneFiltered(Targets); - explainStartStep(Targets, OS); +ContainerSet +Step::cloneAndRun(Context &Ctx, ContainerSet &&Input, llvm::raw_ostream *OS) { + auto InputEnumeration = Input.enumerate(); + explainStartStep(InputEnumeration, OS); for (auto &Pipe : Pipes) { - if (not Pipe->areRequirementsMet(RunningContainers.enumerate())) + if (not Pipe->areRequirementsMet(Input.enumerate())) continue; explainExecutedPipe(Ctx, Pipe, OS); - Pipe->run(Ctx, RunningContainers); - llvm::cantFail(RunningContainers.verify()); + Pipe->run(Ctx, Input); + llvm::cantFail(Input.verify()); } - return RunningContainers; + Containers.mergeBack(std::move(Input)); + InputEnumeration = deduceResults(InputEnumeration); + return Containers.cloneFiltered(InputEnumeration); } void Step::removeSatisfiedGoals(TargetsList &RequiredInputs, diff --git a/python/revng/cli/translate/__init__.py b/python/revng/cli/translate/__init__.py index 3ca135da3..cf7a97f23 100644 --- a/python/revng/cli/translate/__init__.py +++ b/python/revng/cli/translate/__init__.py @@ -47,7 +47,7 @@ def run_translate(args, post_dash_dash_args, search_path, search_prefixes, comma out_file = args.output if args.output else args.input[0] + ".translated" - step_name = "EndRecompile" + step_name = "Recompile" if args.isolate: step_name = step_name + "Isolated" command = command + [ @@ -56,7 +56,7 @@ def run_translate(args, post_dash_dash_args, search_path, search_prefixes, comma "--step", step_name, "-i", - "Lift:input:" + args.input[0], + "begin:input:" + args.input[0], "-o", step_name + ":output:" + out_file, ] diff --git a/python/revng/cli/translate/pipelines/isolate-translate.yml b/python/revng/cli/translate/pipelines/isolate-translate.yml index dc4cd946b..7465f8654 100644 --- a/python/revng/cli/translate/pipelines/isolate-translate.yml +++ b/python/revng/cli/translate/pipelines/isolate-translate.yml @@ -1,4 +1,4 @@ -From: Lifted +From: Lift Containers: Steps: - Name: Isolate diff --git a/python/revng/cli/translate/pipelines/translate.yml b/python/revng/cli/translate/pipelines/translate.yml index 30ac5e556..4867387ce 100644 --- a/python/revng/cli/translate/pipelines/translate.yml +++ b/python/revng/cli/translate/pipelines/translate.yml @@ -15,7 +15,6 @@ Steps: - Type: LLVMPipe UsedContainers: [module] Passes: [globaldce] - - Name: Lifted - Name: Recompile Pipes: - Type: LinkSupport diff --git a/tests/tools/pipeline/CMakeLists.txt b/tests/tools/pipeline/CMakeLists.txt index 3664bb279..d29183fc8 100644 --- a/tests/tools/pipeline/CMakeLists.txt +++ b/tests/tools/pipeline/CMakeLists.txt @@ -16,6 +16,7 @@ macro(add_pipeline_test TEST_NAME PIPELINE_FILE TARGETS + TARGET_STEP INPUTS_LIST OUTPUTS_LIST FLAGS @@ -29,7 +30,8 @@ macro(add_pipeline_test -o ${OUTPUTS_LIST} \ -l ${CMAKE_BINARY_DIR}/lib/librevngStringContainerLibrary.so \ -p ${CMAKE_BINARY_DIR}/${TEST_NAME} \ - -f ${FLAGS}" + -f ${FLAGS} \ + --step ${TARGET_STEP}" ) set_tests_properties("${TEST_NAME}" PROPERTIES @@ -44,6 +46,7 @@ macro(add_pipeline_dump_test TEST_NAME PIPELINE_FILE) dc:dc:StringKind -l "${CMAKE_BINARY_DIR}/lib/librevngStringContainerLibrary.so" -d + --step FirstStep ) set_tests_properties("${TEST_NAME}" PROPERTIES @@ -55,6 +58,7 @@ macro(test_pipeline_output TEST_NAME PIPELINE_FILE TARGETS + TARGET_STEP INPUTS_LIST OUTPUTS_LIST FLAGS @@ -65,6 +69,7 @@ macro(test_pipeline_output add_pipeline_test("${TEST_NAME}" "${PIPELINE_FILE}" "${TARGETS}" + "${TARGET_STEP}" "${INPUTS_LIST}" "${OUTPUTS_LIST}" "${FLAGS}" @@ -83,6 +88,7 @@ macro(ensure_pipeline_failure TEST_NAME PIPELINE_FILE TARGETS + TARGET_STEP INPUTS_LIST OUTPUTS_LIST FLAGS @@ -90,6 +96,7 @@ macro(ensure_pipeline_failure add_pipeline_test("${TEST_NAME}" "${PIPELINE_FILE}" "${TARGETS}" + "${TARGET_STEP}" "${INPUTS_LIST}" "${OUTPUTS_LIST}" "${FLAGS}" @@ -98,12 +105,13 @@ macro(ensure_pipeline_failure set_tests_properties("${TEST_NAME}" PROPERTIES WILL_FAIL TRUE) endmacro() -set(COPY_PIPE_TEST_INPUTS "FirstStep:Strings1:${CMAKE_CURRENT_SOURCE_DIR}/CopyPipeTestInput.txt") -set(COPY_PIPE_TEST_OUTPUTS "End:Strings2:CopyPipeTestOutput.txt") +set(COPY_PIPE_TEST_INPUTS "begin:Strings1:${CMAKE_CURRENT_SOURCE_DIR}/CopyPipeTestInput.txt") +set(COPY_PIPE_TEST_OUTPUTS "FirstStep:Strings2:CopyPipeTestOutput.txt") test_pipeline_output(pipeline-copy-pipe CopyPipeTestPipeline.yml Strings2:Root:StringKind + FirstStep "${COPY_PIPE_TEST_INPUTS}" "${COPY_PIPE_TEST_OUTPUTS}" None @@ -115,6 +123,7 @@ test_pipeline_output(pipeline-copy-pipe test_pipeline_output(pipeline-copy-pipe-flag CopyPipeFlagTestPipeline.yml Strings2:Root:StringKind + FirstStep "${COPY_PIPE_TEST_INPUTS}" "${COPY_PIPE_TEST_OUTPUTS}" None @@ -126,6 +135,7 @@ test_pipeline_output(pipeline-copy-pipe-flag ensure_pipeline_failure(pipeline-flag-fail-test CopyPipeFlagTestPipeline.yml Strings2:Root:StringKind + FirstStep "${COPY_PIPE_TEST_INPUTS}" "${COPY_PIPE_TEST_OUTPUTS}" DisableCopyPipe @@ -135,6 +145,7 @@ ensure_pipeline_failure(pipeline-flag-fail-test ensure_pipeline_failure(pipeline-test-missing-pipe MissingPassPipelineTest.yml Strings2:Root:StringKind + FirstStep "${COPY_PIPE_TEST_INPUTS}" "${COPY_PIPE_TEST_OUTPUTS}" DontCare diff --git a/tests/tools/pipeline/MultiStepPipelineTest.sh b/tests/tools/pipeline/MultiStepPipelineTest.sh index 911c8dd1c..3889dc8ba 100755 --- a/tests/tools/pipeline/MultiStepPipelineTest.sh +++ b/tests/tools/pipeline/MultiStepPipelineTest.sh @@ -13,9 +13,10 @@ function run() { "$PWD/bin/revng-pipeline" \ -P="$SCRIPT_DIR/MultiStepPipeline.yml" \ Strings3:Root:StringKind\ - -i "FirstStep:Strings1:$SCRIPT_DIR/MultiStepPipelineInput.txt" \ - -o "End:Strings3:$OUTPUT" \ + -i "begin:Strings1:$SCRIPT_DIR/MultiStepPipelineInput.txt" \ + -o "SecondStep:Strings3:$OUTPUT" \ -p "$WORKING_DIRECTORY" \ + --step SecondStep \ -s \ "$@" } diff --git a/tests/unit/Pipeline.cpp b/tests/unit/Pipeline.cpp index f1b01c7af..c52d2fc56 100644 --- a/tests/unit/Pipeline.cpp +++ b/tests/unit/Pipeline.cpp @@ -458,13 +458,16 @@ BOOST_AUTO_TEST_CASE(StepCanCloneAndRun) { ContainerSet Containers; auto Factory = getMapFactoryContainer(); Containers.add(CName, Factory, Factory("dont_care")); - cast(Containers[CName]).get(Target({}, RootKind)) = 1; - Step Step("first_step", move(Containers), bindPipe(CName, CName)); ContainerToTargetsMap Targets; Targets[CName].emplace_back(RootKind2); - auto Result = Step.cloneAndRun(Ctx, {}); + + Containers = ContainerSet(); + auto Factory2 = getMapFactoryContainer(); + Containers.add(CName, Factory, Factory("dont_care")); + cast(Containers[CName]).get(Target({}, RootKind)) = 1; + auto Result = Step.cloneAndRun(Ctx, std::move(Containers)); auto &Cont = cast(Result.at(CName)); BOOST_TEST(Cont.get(Target({}, RootKind2)) == 1); @@ -480,16 +483,12 @@ BOOST_AUTO_TEST_CASE(PipelineCanBeManuallyExectued) { Registry.createEmpty(), bindPipe(CName, CName))); - auto &C1 = Pip["first_step"].containers().getOrCreate(CName); + auto Containers = Registry.createEmpty(); + auto &C1 = Containers.getOrCreate(CName); C1.get(Target(RootKind)) = 1; - Pip.addStep(Step("End", Registry.createEmpty(), Pip["first_step"])); - - ContainerToTargetsMap Targets; - Targets[CName].emplace_back(Target(RootKind2)); - auto Res = Pip["first_step"].cloneAndRun(Ctx, {}); + auto Res = Pip["first_step"].cloneAndRun(Ctx, std::move(Containers)); BOOST_TEST(cast(Res.at(CName)).get(Target(RootKind2)) == 1); - Pip["first_step"].containers().mergeBack(std::move(Res)); const auto &StartingContainer = Pip["first_step"] .containers() .getOrCreate(CName); @@ -507,14 +506,17 @@ BOOST_AUTO_TEST_CASE(SingleElementPipelineCanBeRunned) { auto &C1 = cast(Content[CName]); C1.get(Target(RootKind)) = 1; - Step StepToAdd("first_step", move(Content), bindPipe(CName, CName)); + Step StepToAdd("first_step", move(Content)); Pip.addStep(std::move(StepToAdd)); ContainerSet &BCI = Pip["first_step"].containers(); BOOST_TEST(cast(BCI.at(CName)).get(Target(RootKind)) == 1); ContainerSet Containers2; Containers2.add(CName, Factory, make_unique("dont_care")); - Pip.addStep(Step("End", move(Containers2), Pip["first_step"])); + Pip.addStep(Step("End", + move(Containers2), + Pip["first_step"], + bindPipe(CName, CName))); ContainerToTargetsMap Targets; Targets[CName].emplace_back(Target(RootKind2)); @@ -574,8 +576,8 @@ BOOST_AUTO_TEST_CASE(SingleElementPipelineBackwardFinedGrained) { Pipeline.addDefaultConstructibleFactory(CName); const std::string Name = "first_step"; - Pipeline.emplaceStep("", Name, bindPipe(CName, CName)); - Pipeline.emplaceStep(Name, "End"); + Pipeline.emplaceStep("", Name); + Pipeline.emplaceStep(Name, "End", bindPipe(CName, CName)); auto &Container(Pipeline[Name].containers().getOrCreate(CName)); Container.get(Target(RootKind)) = 1; @@ -697,13 +699,13 @@ BOOST_AUTO_TEST_CASE(SingleElementLLVMPipelineBackwardFinedGrained) { Pipeline.addContainerFactory(CName, makeDefaultLLVMContainerFactory(Ctx, C)); const std::string Name = "first_step"; + Pipeline.emplaceStep("", Name); Pipeline - .emplaceStep("", - Name, + .emplaceStep(Name, + "End", LLVMContainer::wrapLLVMPasses(CName, LLVMPassFunctionCreator(), LLVMPassFunctionIdentity())); - Pipeline.emplaceStep(Name, "End"); auto &C1(Pipeline[Name].containers().getOrCreate(CName)); makeF(C1.getModule(), "root"); @@ -729,12 +731,12 @@ BOOST_AUTO_TEST_CASE(LLVMPurePipe) { const std::string Name = "first_step"; PureLLVMPassWrapper IdentityPass("IdentityPass"); - Pipeline.emplaceStep("", - Name, + Pipeline.emplaceStep("", Name); + Pipeline.emplaceStep(Name, + "End", LLVMContainer::wrapLLVMPasses(CName, LLVMPassFunctionCreator(), IdentityPass)); - Pipeline.emplaceStep(Name, "End"); auto &C1 = Pipeline[Name].containers().getOrCreate(CName); makeF(C1.getModule(), "root"); @@ -757,8 +759,8 @@ BOOST_AUTO_TEST_CASE(SingleElementPipelineForwardFinedGrained) { Pipeline.addDefaultConstructibleFactory(CName); const std::string Name = "first_step"; - Pipeline.emplaceStep("", Name, bindPipe(CName, CName)); - Pipeline.emplaceStep(Name, "End"); + Pipeline.emplaceStep("", Name); + Pipeline.emplaceStep(Name, "End", bindPipe(CName, CName)); auto &C1 = Pipeline[Name].containers().getOrCreate(CName); C1.get(Target({}, RootKind)) = 1; @@ -786,8 +788,8 @@ BOOST_AUTO_TEST_CASE(SingleElementPipelineInvalidation) { Pipeline.addDefaultConstructibleFactory(CName); const std::string Name = "first_step"; - Pipeline.emplaceStep("", Name, bindPipe(CName, CName)); - Pipeline.emplaceStep(Name, "End"); + Pipeline.emplaceStep("", Name); + Pipeline.emplaceStep(Name, "End", bindPipe(CName, CName)); auto &C1 = Pipeline[Name].containers().getOrCreate(CName); C1.get(Target({}, RootKind)) = 1; @@ -845,16 +847,16 @@ BOOST_AUTO_TEST_CASE(LoaderTest) { auto &Pipeline = *MaybePipeline; const std::string Name = "FirstStep"; BOOST_TEST((Pipeline[Name].getName() == Name)); - BOOST_TEST((Pipeline["End"].getName() == "End")); + BOOST_TEST((Pipeline["begin"].getName() == "begin")); ContainerToTargetsMap Targets; Targets.add(CName, { "f1" }, FunctionKind); - auto &C1 = Pipeline[Name].containers().getOrCreate(CName); + auto &C1 = Pipeline["begin"].containers().getOrCreate(CName); C1.get(Target(RootKind)) = 1; - auto Error = Pipeline.run("End", Targets); + auto Error = Pipeline.run(Name, Targets); BOOST_TEST(!Error); - auto &FinalContainer = Pipeline["End"].containers().get(CName); + auto &FinalContainer = Pipeline[Name].containers().get(CName); Target FinalTarget({ "f1" }, FunctionKind); auto Val = FinalContainer.get(FinalTarget); @@ -1150,10 +1152,10 @@ BOOST_AUTO_TEST_CASE(LLVMKindTest) { Runner Pipeline(Ctx); Pipeline.addContainerFactory(CName, makeLLVMContainerFactory(Ctx, C)); - Pipeline.emplaceStep("", - "first_step", + Pipeline.emplaceStep("", "first_step"); + Pipeline.emplaceStep("first_step", + "End", Cont::wrapLLVMPasses(CName, LLVMPassFunctionCreator())); - Pipeline.emplaceStep("first_step", "End"); makeF(Pipeline["first_step"] .containers() @@ -1226,16 +1228,16 @@ BOOST_AUTO_TEST_CASE(MultiStepInvalidationTest) { const std::string Name = "first_step"; const std::string SecondName = "second_step"; - Pipeline.emplaceStep("", Name, bindPipe(CName, CName)); - Pipeline.emplaceStep(Name, SecondName, bindPipe(CName, CName2)); - Pipeline.emplaceStep(SecondName, "End"); + Pipeline.emplaceStep("", Name); + Pipeline.emplaceStep(Name, + SecondName, + bindPipe(CName, CName)); + Pipeline.emplaceStep(SecondName, "End", bindPipe(CName, CName2)); auto &C1 = Pipeline[Name].containers().getOrCreate(CName); auto &C1End = Pipeline["End"].containers().getOrCreate(CName); auto &C2End = Pipeline["End"].containers().getOrCreate(CName2); - C1.get(Target({}, RootKind)) = 1; - const auto T = Target({}, RootKind); C1.get(T) = 1; diff --git a/tests/unit/PipelineC.cpp b/tests/unit/PipelineC.cpp index 60f114391..da486c7ae 100644 --- a/tests/unit/PipelineC.cpp +++ b/tests/unit/PipelineC.cpp @@ -51,8 +51,8 @@ BOOST_AUTO_TEST_CASE(CAPILoadTest) { auto *FirstStep = rp_manager_get_step(runner, 0); BOOST_TEST(rp_manager_containers_count(runner) == 2); - BOOST_TEST(rp_manager_step_name_to_index(runner, "FirstStep") == 0); - BOOST_TEST(rp_manager_step_name_to_index(runner, "End") == 1); + BOOST_TEST(rp_manager_step_name_to_index(runner, "begin") == 0); + BOOST_TEST(rp_manager_step_name_to_index(runner, "FirstStep") == 1); BOOST_TEST(rp_manager_get_kind_from_name(runner, "MISSING") == nullptr); BOOST_TEST(rp_manager_get_kind_from_name(runner, "Root") != nullptr); } diff --git a/tools/pipeline/Main.cpp b/tools/pipeline/Main.cpp index ffe651097..488934f71 100644 --- a/tools/pipeline/Main.cpp +++ b/tools/pipeline/Main.cpp @@ -48,10 +48,10 @@ static opt ModelOverride("m", init("")); static opt TargetStep("step", + Required, desc("name the step in which to produce the " "elements"), - cat(PipelineCategory), - init("End")); + cat(PipelineCategory)); static opt ProduceAllPossibleTargets("produce-all", desc("Try producing all possible "