5#if defined(INCLUDE_IL_PRINTER)
10#if !defined(DART_PRECOMPILED_RUNTIME)
19 print_flow_graph_filter,
21 "Print only IR of functions with matching names");
27static bool PassesFilter(
const char* filter,
29 uint8_t** compiler_pass_filter) {
30 if (filter ==
nullptr) {
34#if !defined(DART_PRECOMPILED_RUNTIME)
35 if (strcmp(filter,
"@pragma") == 0) {
37 const auto has_pragma =
39 function, Symbols::vm_testing_print_flow_graph(),
41 if (has_pragma && !pass_filter.IsNull() &&
42 compiler_pass_filter !=
nullptr) {
44 String::Cast(pass_filter).ToCString());
51 const char* scrubbed_name =
function.QualifiedScrubbedNameCString();
55 intptr_t
len = strlen(filter) + 1;
56 char* filter_buffer =
new char[
len];
57 strncpy(filter_buffer, filter,
len);
58 char* token = strtok_r(filter_buffer,
",", &save_ptr);
60 while (token !=
nullptr) {
62 (strstr(scrubbed_name, token) !=
nullptr)) {
66 const intptr_t token_len = strlen(token);
67 if (token[token_len - 1] ==
'%') {
68 if (function_name_len > token_len) {
71 if (strncmp(
suffix, token, token_len - 1) == 0) {
77 token = strtok_r(
nullptr,
",", &save_ptr);
79 delete[] filter_buffer;
84bool PrintFilter::ShouldPrint(
const Function&
function,
85 uint8_t** compiler_pass_filter ) {
86 return PassesFilter(FLAG_print_flow_graph_filter,
function,
87 compiler_pass_filter);
static uint8_t * ParseFiltersFromPragma(const char *filter)
static bool FindPragma(Thread *T, bool only_core, const Object &object, const String &pragma_name, bool multiple=false, Object *options=nullptr)
static Thread * Current()
Dart_NativeFunction function
DEFINE_FLAG(bool, print_cluster_information, false, "Print information about clusters written to snapshot")
const char *const function_name