|
GCC Middle and Back End API Reference
|
#include "config.h"#include "system.h"#include "coretypes.h"#include "backend.h"#include "tree.h"#include "tree-pass.h"#include "cgraph.h"
Data Structures | |
| class | constraint_data |
Functions | |
| static void | mark_fragile_ref_by_asm (symtab_node *node, bool maybe_local=false) |
| static tree | walk_through_constraints (tree *t, int *, void *dat) |
| void | analyze_toplevel_extended_asm () |
| void | ipa_asm_heuristics () |
| ipa_opt_pass_d * | make_pass_ipa_asm_lgen (gcc::context *ctxt) |
| ipa_opt_pass_d * | make_pass_ipa_asm_wpa (gcc::context *ctxt) |
| void analyze_toplevel_extended_asm | ( | void | ) |
Analyze constraints of toplevel extended assembly.
References ASM_INPUTS, ASM_OUTPUTS, asm_node::asm_str, toplevel_node::next, NULL, safe_as_a(), symtab, TREE_CHAIN, TREE_CODE, TREE_PURPOSE, TREE_STRING_POINTER, TREE_VALUE, walk_through_constraints(), and walk_tree.
Referenced by symbol_table::finalize_compilation_unit().
| void ipa_asm_heuristics | ( | ) |
Checks all toplevel assembly contents and compares them with known symbols. Marks those symbols with relevant flags. Heuristics: Detects anything in assembly that looks like an identifer. This pass must be in WPA, otherwise we will not see all possibly referenced symbols - if a symbol is only declared, it will not be in the callgraph if it is only referenced from toplevel assembly. However in WPA there may be multiple symbols with the same identifier. The chosen solution is to handle local symbols in LGEN pass first.
References symtab_node::asm_name(), asm_node::asm_str, symtab_node::decl, dump_file, FOR_EACH_SYMBOL, i, map, mark_fragile_ref_by_asm(), toplevel_node::next, safe_as_a(), symtab, TREE_CODE, TREE_PUBLIC, TREE_STRING_LENGTH, and TREE_STRING_POINTER.
| ipa_opt_pass_d * make_pass_ipa_asm_lgen | ( | gcc::context * | ctxt | ) |
| ipa_opt_pass_d * make_pass_ipa_asm_wpa | ( | gcc::context * | ctxt | ) |
|
static |
Toplevel assembly. Copyright (C) 2025 Free Software Foundation, Inc. Contributed by Michal Jires <mjires@suse.cz> This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
This symbol must be available and cannot be renamed. Marks the symbol and symbols that reference it.
References dyn_cast(), symtab_node::must_remain_in_tu_body, ipa_ref::referring, and TREE_PUBLIC.
Referenced by ipa_asm_heuristics(), and walk_through_constraints().
Mark symbols in constraints.
References DECL_EXTERNAL, gcc_assert, symtab_node::get(), symtab_node::get_create(), is_a(), mark_fragile_ref_by_asm(), NULL, asm_node::symbols_referenced, TREE_PUBLIC, and VAR_OR_FUNCTION_DECL_P.
Referenced by analyze_toplevel_extended_asm().