Update SPIRV-Tools to 2020.1 / SPIRV-Cross to 65aa0c3 (#2121)

This commit is contained in:
Ben Doherty
2020-03-10 15:32:41 -07:00
committed by GitHub
parent a2818037b3
commit a2c6c34739
1747 changed files with 265215 additions and 44507 deletions

View File

@@ -37,5 +37,22 @@ std::string CardinalToOrdinal(size_t cardinal) {
return ToString(cardinal) + suffix;
}
std::pair<std::string, std::string> SplitFlagArgs(const std::string& flag) {
if (flag.size() < 2) return make_pair(flag, std::string());
// Detect the last dash before the pass name. Since we have to
// handle single dash options (-O and -Os), count up to two dashes.
size_t dash_ix = 0;
if (flag[0] == '-' && flag[1] == '-')
dash_ix = 2;
else if (flag[0] == '-')
dash_ix = 1;
size_t ix = flag.find('=');
return (ix != std::string::npos)
? make_pair(flag.substr(dash_ix, ix - 2), flag.substr(ix + 1))
: make_pair(flag.substr(dash_ix), std::string());
}
} // namespace utils
} // namespace spvtools