MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / FlagHasValidForm

Method FlagHasValidForm

source/opt/optimizer.cpp:287–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285}
286
287bool Optimizer::FlagHasValidForm(const std::string& flag) const {
288 if (flag == "-O" || flag == "-Os") {
289 return true;
290 } else if (flag.size() > 2 && flag.substr(0, 2) == "--") {
291 return true;
292 }
293
294 Errorf(consumer(), nullptr, {},
295 "%s is not a valid flag. Flag passes should have the form "
296 "'--pass_name[=pass_args]'. Special flag names also accepted: -O "
297 "and -Os.",
298 flag.c_str());
299 return false;
300}
301
302bool Optimizer::RegisterPassFromFlag(const std::string& flag) {
303 return RegisterPassFromFlag(flag, false);

Callers 1

TESTFunction · 0.80

Calls 3

ErrorfFunction · 0.85
c_strMethod · 0.80
sizeMethod · 0.45

Tested by 1

TESTFunction · 0.64