434 {
435 if (initialized_) {
437 }
438
439 qsort(flags_, num_flags_, sizeof flags_[0], CompareFlagNames);
440
441 const char*
const kPrefix =
"--";
442 const intptr_t kPrefixLen = strlen(kPrefix);
443
444 int i = 0;
445 while ((i < number_of_vm_flags) &&
447 const char* option = vm_flags[i] + kPrefixLen;
448 Parse(option);
449 i++;
450 }
451
452 if (!FLAG_ignore_unrecognized_flags) {
453 int unrecognized_count = 0;
454 TextBuffer
error(64);
455 for (intptr_t j = 0; j < num_flags_; j++) {
456 Flag*
flag = flags_[j];
457 if (
flag->IsUnrecognized()) {
458 if (unrecognized_count == 0) {
459 error.Printf(
"Unrecognized flags: %s",
flag->name_);
460 } else {
462 }
463 unrecognized_count++;
464 }
465 }
466 if (unrecognized_count > 0) {
467 return error.Steal();
468 }
469 }
470 if (FLAG_print_flags) {
471 PrintFlags();
472 }
473
474 initialized_ = true;
475 return nullptr;
476}
static char * StrDup(const char *s)
const uint8_t uint32_t uint32_t GError ** error
static bool IsValidFlag(const char *name, const char *prefix, intptr_t prefix_length)