GCC Middle and Back End API Reference
genextract.c File Reference

Data Structures

struct  extraction
struct  code_ptr
struct  accum_extract

Typedefs

typedef char * locstr

Functions

static void walk_rtx (rtx, struct accum_extract *)
static void gen_insn ()
static void VEC_safe_set_locstr ()
static char * VEC_char_to_string ()
static void walk_rtx ()
static void print_path ()
static void print_header ()
int main ()

Variables

static struct extractionextractions
static struct code_ptrpeepholes
int line_no

Typedef Documentation

typedef char* locstr
@verbatim 

Generate code from machine description to extract operands from insn as rtl. Copyright (C) 1987-2013 Free Software Foundation, Inc.

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 structure contains all the information needed to describe one
   set of extractions methods.  Each method may be used by more than
   one pattern if the operands are in the same place.

   The string for each operand describes that path to the operand and
   contains `0' through `9' when going into an expression and `a' through
   `z' when going into a vector.  We assume here that only the first operand
   of an rtl expression is a vector.  genrecog.c makes the same assumption
   (and uses the same representation) and it is currently true.  

Function Documentation

static void gen_insn ( )
static
     Walk the insn's pattern, remembering at all times the path
     down to the walking point.  
     See if we find something that already had this extraction method.  
         This extraction is the same as ours.  Just link us in.  
     Otherwise, make a new extraction method.  We stash the arrays
     after the extraction structure in memory.  
int main ( )
     Read the machine description.  
     Write out code to handle peepholes and the insn_codes that it should
     be called for.  
         The vector in the insn says how many operands it has.
         And all it contains are operands.  In fact, the vector was
         created just for the sake of this function.  We need to set the
         location of the operands for sake of simplifications after
         extraction, like eliminating subregs.  
     Write out all the ways to extract insn operands.  

References code_ptr::insn_code, insn_code_number, code_ptr::next, and peepholes.

static void print_header ( )
static
     N.B. Code below avoids putting squiggle braces in column 1 inside
     a string, because this confuses some editors' syntax highlighting
     engines.  
static void print_path ( )
static
   Given a PATH, representing a path down the instruction's
   pattern from the root to a certain point, output code to
   evaluate to the rtx at that point.  
         Don't emit "pat", since we may try to take the address of it,
         which isn't what is intended.  
     We first write out the operations (XEXP or XVECEXP) in reverse
     order, then write "pat", then the indices in forward order.  
static char* VEC_char_to_string ( )
static
   Another helper subroutine of walk_rtx: given a vec<char>, convert it
   to a NUL-terminated string in malloc memory.  
static void VEC_safe_set_locstr ( )
static
   Helper subroutine of walk_rtx: given a vec<locstr>, an index, and a
   string, insert the string at the index, which should either already
   exist and be NULL, or not yet exist within the vector.  In the latter
   case the vector is enlarged as appropriate.  
static void walk_rtx ( rtx  ,
struct accum_extract  
)
static
   Forward declarations.  
static void walk_rtx ( )
static

Variable Documentation

struct extraction* extractions
static
   All extractions needed for this machine description.  
int line_no

Referenced by main().

struct code_ptr* peepholes
static
   All insn codes for old-style peepholes.  

Referenced by main().