Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
make_depend.cxx File Reference
#include "cmplrs/make_depend.h"
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include "x_stdio.h"
#include <stdlib.h>
#include <string.h>
#include "x_string.h"
#include <unistd.h>
#include <sys/mman.h>
#include <sys/stat.h>
Include dependency graph for make_depend.cxx:

Go to the source code of this file.

Classes

struct  dependency
struct  mdrule
struct  mdfile

Defines

#define ENTER(s)
#define EXIT(s)
#define LOG(s)
#define FREECOUNT(x)   ((x) - (x) / 4)
#define TABLESIZE(n)   ((n) + (n) / 3)
#define INITIALSIZE   (1 << 8)
#define INITSTABSIZE   (0x40000)
#define MAXSTRINGLEN   512
#define SKIP_BLANKS   while ( next<limit && *next==' ' ) {next++;}
#define SKIP_TO_EOL   while ( next<limit && *next!='\n') {next++;}
#define IS_EOL   (*next=='\n')
#define IS_EOF   (next>=limit)
#define SCAN_FOR(c)   while ( next<limit && *next!=c && *next!='\n') {next++;}
#define ERR(x)   { h->error x ; goto cleanup; }

Typedefs

typedef struct dependency Dependency
typedef struct mdfile MDfile_t

Functions

static void MDfile_init (MDfile_t *m)
static int MDtoolcmp (const char *tool, const char *s, int slen)
static int MDtargcmp (const char *targ, const char *s, int slen)
void MDnewstab (MDhandle h)
char * MDstrcpy (MDhandle h, char *src)
static DependencyMDhash (MDhandle h, char *s)
static DependencyMDlookup (MDhandle h, char *dependency)
static void MDgrow (MDhandle h)
MDhandle MDopen (char *toolname, char *filename, char *target, void(*error)(char *,...))
void MDupdate (MDhandle h, char *dependency)
static char * MDparseline (char *line, char *limit, char **targ, char **tool)
void MDclose (MDhandle h, char *target)

Variables

char scratch [80]

Define Documentation

#define ENTER (   s)

Definition at line 112 of file make_depend.cxx.

Referenced by MDclose().

#define ERR (   x)    { h->error x ; goto cleanup; }

Definition at line 630 of file make_depend.cxx.

Referenced by MDclose().

#define EXIT (   s)

Definition at line 113 of file make_depend.cxx.

Referenced by add_substring_length(), adjust_char_value_len(), allocate_stmt_semantics(), analyse_loops(), and_opr_handler(), array_construct_semantics(), array_dim_resolution(), assignment_stmt_semantics(), attr_semantics(), build_loop_tbl(), call_list_semantics(), case_stmt_semantics(), case_value_range_semantics(), cc_get_stmt(), char_len_resolution(), check_and_allocate_common_storage(), check_array_bounds(), check_target_and_value(), cif_call_site_rec(), cif_flush_include_recs(), cif_label_rec(), cif_message_rec(), cif_send_attr(), cif_usage_rec(), concat_opr_handler(), const_init_semantics(), create_constructor_constant(), data_imp_do_semantics(), data_stmt_semantics(), deallocate_stmt_semantics(), default_init_semantics(), determine_slice_size(), do_stmt_semantics(), dump_bd_ntry(), dump_gb_ntry(), else_stmt_semantics(), emit_format_msg(), end_blk_mp_semantics(), end_do_blk(), end_forall_semantics(), end_labeled_do(), end_select_blk(), eq_opr_handler(), final_arg_work(), final_attr_semantics(), find_base_attr(), find_left_attr(), flatten_function_call(), fold_aggragate_expression(), fold_all_subscripts(), fold_clen_opr(), fold_nested_substrings(), folder_driver(), forall_semantics(), gen_attr_and_IR_for_lbl(), gen_default_init_code(), gen_entry_dope_code(), gen_forall_if_mask(), gen_il(), gen_internal_dope_vector(), gen_loop_end_ir(), gen_runtime_ptr_chk(), gen_single_automatic_allocate(), gen_whole_subscript(), get_dir_token_from_str(), get_operand_digit(), get_operand_dot(), get_stmt_tmp(), get_type_desc(), global_name_semantics(), goto_stmt_semantics(), has_been_reprivatized(), imp_do_metamorphed(), init_whole_array(), insert_constant(), insert_unordered_constant(), interpret_binary_intrinsic_opr(), interpret_binary_opr(), interpret_data_imp_do(), io_list_semantics(), ir_is_symbolic_constant(), is_dollar_directive(), is_par_directive(), is_star_directive(), iss_blk_stk_err(), label_ref_semantics(), lbound_intrinsic(), lg_opr_handler(), loc_intrinsic(), lt_opr_handler(), MDclose(), merge_dimension(), merge_parameter(), merge_type(), minus_opr_handler(), mult_opr_handler(), next_arg_is_kwd_equal(), not_opr_handler(), ntr_bnds_sh_tmp_list(), ntr_bnds_tmp_list(), ntr_derived_type_tbl(), ntr_global_bounds_tbl(), ntr_global_type_tbl(), ntr_type_tbl(), num_images_intrinsic(), object_semantics(), operation_is_intrinsic(), optimize_reshape(), optimize_whole_array_init(), outer_imp_do_count(), outmoded_if_stmt_semantics(), output_mod_info_file(), paren_grp_is_cplx_const(), parse_allocate_stmt(), parse_array_spec(), parse_assert_directive(), parse_assign_stmt(), parse_assignment_stmt(), parse_buffer_stmt(), parse_call_stmt(), parse_case_stmt(), parse_cc_operand(), parse_cycle_stmt(), parse_data_imp_do(), parse_data_stmt(), parse_deallocate_stmt(), parse_define_str(), parse_deref(), parse_dir_directives(), parse_directive_stmt(), parse_distribution_dir(), parse_do_stmt(), parse_doall_cmic(), parse_dollar_directives(), parse_doparallel_cmic(), parse_else_stmt(), parse_end_stmt(), parse_equivalence_stmt(), parse_exit_stmt(), parse_fill_align_symbol(), parse_forall(), parse_format_stmt(), parse_goto_stmt(), parse_if_stmt(), parse_imp_do(), parse_implicit_stmt(), parse_initializer(), parse_int_spec_expr(), parse_io_control_list(), parse_label_list(), parse_lhs(), parse_mp_directive(), parse_namelist_stmt(), parse_nullify_stmt(), parse_open_mp_clauses(), parse_open_mp_directives(), parse_openad_directives(), parse_openad_varlist(), parse_operand(), parse_par_directives(), parse_parallel_cmic(), parse_parameter_stmt(), parse_pe_array_spec(), parse_pointer_stmt(), parse_prefetch_ref(), parse_prefix_spec(), parse_redistribute_dir(), parse_select_stmt(), parse_sgi_dir_inline(), parse_star_dir_directives(), parse_star_directives(), parse_stmt_func_stmt(), parse_type_dcl_stmt(), parse_use_stmt(), parse_where_stmt(), pe_array_dim_resolution(), plus_opr_handler(), power_opr_handler(), print_buffered_messages(), print_nxt_line(), process_data_imp_do_target(), put_format_in_tbl(), read_in_module_tbl(), read_line(), read_sytb_from_module_file(), resolve_attr(), resolve_ext_opr(), scan_cc_macro(), scan_fortran_macro(), scan_fortran_stmt(), send_attr_ntry(), send_derived_type(), send_procedure(), send_stor_blk(), set_at_actual_arg(), set_global_value_variables(), short_circuit_branch(), size_intrinsic(), srch_ar_file_for_module_tbl(), srch_name_tbl(), stmt_func_call_opr_handler(), stmt_is_DATA_stmt(), stmt_is_save_stmt(), struct_construct_opr_handler(), transform_char_sequence_ref(), tree_produces_dealloc(), type_init_semantics(), ubound_intrinsic(), uplus_opr_handler(), use_stmt_semantics(), verify_interface(), and where_stmt_semantics().

#define FREECOUNT (   x)    ((x) - (x) / 4)

Definition at line 122 of file make_depend.cxx.

Referenced by MDgrow(), and MDopen().

#define INITIALSIZE   (1 << 8)

Definition at line 124 of file make_depend.cxx.

Referenced by MDopen().

#define INITSTABSIZE   (0x40000)

Definition at line 125 of file make_depend.cxx.

Referenced by MDnewstab().

#define IS_EOF   (next>=limit)

Definition at line 526 of file make_depend.cxx.

Referenced by MDparseline().

#define IS_EOL   (*next=='\n')

Definition at line 525 of file make_depend.cxx.

Referenced by MDparseline().

#define LOG (   s)

Definition at line 114 of file make_depend.cxx.

Referenced by MDclose().

#define MAXSTRINGLEN   512

Definition at line 133 of file make_depend.cxx.

Referenced by MDstrcpy().

#define SCAN_FOR (   c)    while ( next<limit && *next!=c && *next!='\n') {next++;}

Definition at line 527 of file make_depend.cxx.

Referenced by MDparseline().

#define SKIP_BLANKS   while ( next<limit && *next==' ' ) {next++;}

Definition at line 523 of file make_depend.cxx.

Referenced by MDparseline().

#define SKIP_TO_EOL   while ( next<limit && *next!='\n') {next++;}

Definition at line 524 of file make_depend.cxx.

Referenced by MDparseline().

#define TABLESIZE (   n)    ((n) + (n) / 3)

Definition at line 123 of file make_depend.cxx.


Typedef Documentation

typedef struct dependency Dependency

Definition at line 137 of file make_depend.cxx.

typedef struct mdfile MDfile_t

Function Documentation

static void MDfile_init ( MDfile_t m) [static]

Definition at line 175 of file make_depend.cxx.

References mdfile::base, mdfile::f, mdfile::filename, mdfile::limit, mdfile::size, and mdfile::stb.

Referenced by MDclose().

static void MDgrow ( MDhandle  h) [static]

Definition at line 378 of file make_depend.cxx.

References d, mdrule::error, exit(), mdrule::filename, free(), FREECOUNT, mdrule::freecount, mdrule::hashmask, MDlookup(), dependency::name, and mdrule::table.

Referenced by MDupdate().

Here is the call graph for this function:

static Dependency* MDhash ( MDhandle  h,
char *  s 
) [static]

Definition at line 329 of file make_depend.cxx.

References c, mdrule::hashmask, len, s, and mdrule::table.

Referenced by MDlookup().

static Dependency* MDlookup ( MDhandle  h,
char *  dependency 
) [static]

Definition at line 354 of file make_depend.cxx.

References d, mdrule::hashmask, MDhash(), dependency::name, dependency::next, and mdrule::table.

Referenced by MDgrow(), and MDupdate().

Here is the call graph for this function:

void MDnewstab ( MDhandle  h)

Definition at line 267 of file make_depend.cxx.

References INITSTABSIZE, mdrule::stab, mdrule::stabcur, and mdrule::stabmax.

Referenced by MDopen(), and MDstrcpy().

MDhandle MDopen ( char *  toolname,
char *  filename,
char *  target,
void(*)(char *,...)  error 
)
static char* MDparseline ( char *  line,
char *  limit,
char **  targ,
char **  tool 
) [static]

Definition at line 531 of file make_depend.cxx.

References IS_EOF, IS_EOL, next, SCAN_FOR, SKIP_BLANKS, and SKIP_TO_EOL.

Referenced by MDclose().

char* MDstrcpy ( MDhandle  h,
char *  src 
)

Definition at line 286 of file make_depend.cxx.

References mdrule::error, exit(), mdrule::filename, MAXSTRINGLEN, MDnewstab(), NULL, mdrule::stabcur, mdrule::stabmax, and ux_memccpy().

Referenced by MDopen(), and MDupdate().

Here is the call graph for this function:

static int MDtargcmp ( const char *  targ,
const char *  s,
int  slen 
) [static]

Definition at line 218 of file make_depend.cxx.

Referenced by MDclose().

static int MDtoolcmp ( const char *  tool,
const char *  s,
int  slen 
) [static]

Definition at line 195 of file make_depend.cxx.

Referenced by MDclose().

void MDupdate ( MDhandle  h,
char *  dependency 
)

Definition at line 448 of file make_depend.cxx.

References d, mdrule::entries, mdrule::freecount, MDgrow(), MDlookup(), MDstrcpy(), and dependency::name.

Referenced by cwh_write_makedepend().

Here is the call graph for this function:


Variable Documentation

char scratch[80]

Definition at line 135 of file make_depend.cxx.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines