GCC Middle and Back End API Reference
genconditions.c File Reference
#include "bconfig.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "rtl.h"
#include "errors.h"
#include "hashtab.h"
#include "read-md.h"
#include "gensupport.h"
Include dependency graph for genconditions.c:

Functions

static void write_header (void)
static void write_conditions (void)
static int write_one_condition (void **, void *)
static int write_one_condition (void **slot, void *ARG_UNUSED(dummy))
static void write_writer ()
int main ()

Variables

static int saw_eh_return

Function Documentation

int main ( )
 Read the machine description.   
     N.B. define_insn_and_split, define_cond_exec are handled
     entirely within read_md_rtx; we never see them.   
         except.h needs to know whether there is an eh_return
         pattern in the machine description.   
static void write_conditions ( )
static

Write out the complete conditions table, its size, and a flag indicating that gensupport.c can now do insn elision.

static void write_header ( void  )
static

Generate the header for insn-conditions.c.

static int write_one_condition ( void **  ,
void *   
)
static
static int write_one_condition ( void **  slot,
void *  ARG_UNUSEDdummy 
)
static

Write out one entry in the conditions table, using the data pointed to by SLOT. Each entry looks like this:

{ "! optimize_size && ! TARGET_READ_MODIFY_WRITE", __builtin_constant_p (! optimize_size && ! TARGET_READ_MODIFY_WRITE) ? (int) (! optimize_size && ! TARGET_READ_MODIFY_WRITE) : -1) },

static void write_writer ( )
static

Emit code which will convert the C-format table to a (define_conditions) form, which the MD reader can understand. The result will be added to the set of files scanned by 'downstream' generators.


Variable Documentation

int saw_eh_return
static

Process machine description and calculate constant conditions. Copyright (C) 2001-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/. In a machine description, all of the insn patterns - define_insn, define_expand, define_split, define_peephole, define_peephole2 - contain an optional C expression which makes the final decision about whether or not this pattern is usable. That expression may turn out to be always false when the compiler is built. If it is, most of the programs that generate code from the machine description can simply ignore the entire pattern. so we can include except.h in the generated file.