@@ -34,6 +34,16 @@ static cl::opt<String> cc_checks_command("cc-checks-command", cl::desc("Automati
3434namespace sw
3535{
3636
37+ static path getServiceDir (const path &bdir)
38+ {
39+ return bdir / " misc" ;
40+ }
41+
42+ static path getChecksDir (const path &bdir)
43+ {
44+ return getServiceDir (bdir) / " checks" ;
45+ }
46+
3747static String toString (CheckType t)
3848{
3949 switch (t)
@@ -231,8 +241,8 @@ CheckSet::CheckSet(Checker &checker)
231241{
232242}
233243
234- Checker::Checker (Build &build )
235- : build(build )
244+ Checker::Checker (SwBuild &swbld )
245+ : swbld(swbld )
236246{
237247}
238248
@@ -246,7 +256,7 @@ CheckSet &Checker::addSet(const String &name)
246256
247257void CheckSet::performChecks (const TargetSettings &ts)
248258{
249- static const auto checks_dir = checker.build .getContext ().getLocalStorage ().storage_dir_etc / " sw" / " checks" ;
259+ static const auto checks_dir = checker.swbld .getContext ().getLocalStorage ().storage_dir_etc / " sw" / " checks" ;
250260
251261 // std::unique_lock lk(m);
252262
@@ -381,7 +391,7 @@ int main() { return IsBigEndian(); }
381391 {
382392 // remove tmp dir
383393 error_code ec;
384- fs::remove_all (checker.build . getChecksDir ( ), ec);
394+ fs::remove_all (getChecksDir ( checker.swbld . getBuildDirectory () ), ec);
385395 };
386396
387397 // auto &e = getExecutor();
@@ -555,7 +565,7 @@ int main() { return IsBigEndian(); }
555565 }
556566 s += " }" ;
557567
558- auto d = checker.build . getServiceDir ( );
568+ auto d = getServiceDir ( checker.swbld . getBuildDirectory () );
559569 auto cyclic_path = d / " cyclic" ;
560570 write_file (cyclic_path / " deps_checks.dot" , s);
561571
@@ -671,7 +681,7 @@ bool Check::lessDuringExecution(const CommandNode &in) const
671681
672682path Check::getOutputFilename () const
673683{
674- auto d = check_set->checker .build . getChecksDir ( );
684+ auto d = getChecksDir ( check_set->checker .swbld . getBuildDirectory () );
675685 // static std::atomic_int64_t n = 0;
676686 auto up = unique_path ();
677687 // auto up = std::to_string(++n);
@@ -796,14 +806,12 @@ int main(int ac, char* av[])
796806}
797807
798808#define SETUP_SOLUTION () \
799- auto b = check_set->checker.build .getContext().createBuild(); \
809+ auto b = check_set->checker.swbld .getContext().createBuild(); \
800810 auto s = setupSolution(*b, f); \
801- ModuleSwappableData msd; \
802- msd.current_settings = getSettings(); \
803- s.setModuleData(msd)
811+ s.module_data.current_settings = getSettings()
804812
805813#define EXECUTE_SOLUTION () \
806- for (auto &t : msd. added_targets) \
814+ for (auto &t : s.module_data. added_targets) \
807815 b->getTargets ()[t->getPackage()].push_back(t); \
808816 if (!execute(*b)) \
809817 return
@@ -954,7 +962,7 @@ void TypeSize::run() const
954962 return ;
955963 }
956964
957- if (!check_set->t ->getSolution ().getHostOs ().canRunTargetExecutables (check_set->t ->getBuildSettings ().TargetOS ))
965+ if (!check_set->t ->getContext ().getHostOs ().canRunTargetExecutables (check_set->t ->getBuildSettings ().TargetOS ))
958966 {
959967 requires_manual_setup = true ;
960968 executable = e.getOutputFile ();
@@ -1028,7 +1036,7 @@ void TypeAlignment::run() const
10281036 return ;
10291037 }
10301038
1031- if (!check_set->t ->getSolution ().getHostOs ().canRunTargetExecutables (check_set->t ->getBuildSettings ().TargetOS ))
1039+ if (!check_set->t ->getContext ().getHostOs ().canRunTargetExecutables (check_set->t ->getBuildSettings ().TargetOS ))
10321040 {
10331041 requires_manual_setup = true ;
10341042 executable = e.getOutputFile ();
@@ -1338,7 +1346,7 @@ void SourceRuns::run() const
13381346 return ;
13391347 }
13401348
1341- if (!check_set->t ->getSolution ().getHostOs ().canRunTargetExecutables (check_set->t ->getBuildSettings ().TargetOS ))
1349+ if (!check_set->t ->getContext ().getHostOs ().canRunTargetExecutables (check_set->t ->getBuildSettings ().TargetOS ))
13421350 {
13431351 requires_manual_setup = true ;
13441352 executable = e.getOutputFile ();
0 commit comments