File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5959
6060DECLARE_string (arch);
6161
62+ DEFINE_string (semantics_search_paths, " " , " Colon-separated list of search paths to use when searching for semantics files." );
63+
6264namespace {
6365#ifdef WIN32
6466extern " C" std::uint32_t GetProcessId (std::uint32_t handle);
@@ -484,11 +486,22 @@ std::string FindHostSemanticsBitcodeFile(void) {
484486
485487// Find the path to the semantics bitcode file.
486488std::string FindSemanticsBitcodeFile (const std::string &arch) {
489+ if (!FLAGS_semantics_search_paths.empty ()) {
490+ std::stringstream pp;
491+ pp << FLAGS_semantics_search_paths;
492+ for (std::string sem_dir; std::getline (pp, sem_dir, ' :' ); ) {
493+ std::stringstream ss;
494+ ss << sem_dir << " /" << arch << " .bc" ;
495+ if (auto sem_path = ss.str (); FileExists (sem_path)) {
496+ return sem_path;
497+ }
498+ }
499+ }
500+
487501 for (auto sem_dir : gSemanticsSearchPaths ) {
488502 std::stringstream ss;
489503 ss << sem_dir << " /" << arch << " .bc" ;
490- auto sem_path = ss.str ();
491- if (FileExists (sem_path)) {
504+ if (auto sem_path = ss.str (); FileExists (sem_path)) {
492505 return sem_path;
493506 }
494507 }
You can’t perform that action at this time.
0 commit comments