Skip to content

Commit

Permalink
make use of FLANG_VENDOR
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Osmialowski <[email protected]>
  • Loading branch information
pawosm-arm committed Jul 19, 2017
1 parent e74ac47 commit f83f410
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 6 deletions.
4 changes: 4 additions & 0 deletions tools/flang1/flang1exe/ccffinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ int bu_auto_inline(void);

static int anyunits = 0;

#ifdef FLANG_VENDOR
#define BUILD_VENDOR FLANG_VENDOR
#else
#define BUILD_VENDOR "flang-compiler"
#endif

FIHB fihb = {(FIH *)0, 0, 0, 0, 0, 0, 0};
FIHB ifihb = {(FIH *)0, 0, 0, 0, 0, 0, 0}; /* bottom-up auto-inliner */
Expand Down
5 changes: 5 additions & 0 deletions tools/flang1/flang1exe/listing.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,13 @@ list_ln(char *beg, char *txt)
if (!lf)
return; /* in case error msg written before file
* opened */
#ifdef FLANG_VENDOR
fprintf(lf, "\n\n\n%s%s (Version %8s) %s page %d\n\n",
FLANG_VENDOR, version.lang, version.vsn, gbl.datetime, pgno);
#else
fprintf(lf, "\n\n\n%s (Version %8s) %s page %d\n\n",
version.lang, version.vsn, gbl.datetime, pgno);
#endif
pgno++;
pgpos = 6;
}
Expand Down
8 changes: 8 additions & 0 deletions tools/flang1/flang1exe/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ static char *accel = NULL;

/** Product name in debug output
*/
#ifdef FLANG_VENDOR
#define DNAME FLANG_VENDOR "F90"
#else
#define DNAME "F90"
#endif

#if DEBUG
static int dodebug = 0;
Expand Down Expand Up @@ -1185,7 +1189,11 @@ do_debug(char *phase)
return;
}
if (dodebug)
#ifdef FLANG_VENDOR
fprintf(gbl.dbgfil, "{%sF90 after %s\n", FLANG_VENDOR, phase);
#else
fprintf(gbl.dbgfil, "{%s after %s\n", feature, phase);
#endif

current_phase = phase;
execute_actions_for_keyword(phase_dump_map, phase);
Expand Down
8 changes: 7 additions & 1 deletion tools/flang1/flang1exe/semfunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -5458,7 +5458,7 @@ ref_pd(SST *stktop, ITEM *list)
int pvar;
int nelems, eltype;
char *sname = NULL;
char verstr[140]; /*140, get_version_str returns max 128 char + pf90 prefix */
char verstr[256]; /* get_version_str returns max 128 chars + vendor prefix */
FtnRtlEnum rtlRtn;

/* any integer type, or hollerith, or, if -x 51 0x20 not set, real/double */
Expand Down Expand Up @@ -10660,7 +10660,13 @@ ref_pd(SST *stktop, ITEM *list)
goto call_e74_cnt;
}

#ifdef FLANG_VENDOR
assert(strlen(FLANG_VENDOR) < 116, "FLANG_VENDOR string too long",
strlen(FLANG_VENDOR), 4);
sprintf(verstr, FLANG_VENDOR "F90 %s", get_version_string());
#else
sprintf(verstr, "flang %s", get_version_string());
#endif
sptr = getstring(verstr, strlen(verstr));

goto const_str_val;
Expand Down
4 changes: 4 additions & 0 deletions tools/flang1/flang1exe/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@

#define LANGUAGE "F90"

#ifdef FLANG_VENDOR
#define PRODUCT FLANG_VENDOR LANGUAGE " "
#else
#define PRODUCT ""
#endif

/* COPYRIGHT is extern to make it easy to find in symbol table */
/* it also has extra space to patch in interesting stuff */
Expand Down
4 changes: 4 additions & 0 deletions tools/flang2/flang2exe/ccffinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ int bu_auto_inline(void);

static int anyunits = 0;

#ifdef FLANG_VENDOR
#define BUILD_VENDOR FLANG_VENDOR
#else
#define BUILD_VENDOR "flang-compiler"
#endif

FIHB fihb = {(FIH *)0, 0, 0, 0, 0, 0, 0};
FIHB ifihb = {(FIH *)0, 0, 0, 0, 0, 0, 0}; /* bottom-up auto-inliner */
Expand Down
22 changes: 17 additions & 5 deletions tools/flang2/flang2exe/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ void acc_add_global(void); /* FIXME - does not belong here */

static LOGICAL process_input(char *argv0, LOGICAL *need_cuda_constructor);

/** Product name in debug output
*/
#ifdef FLANG_VENDOR
#define DNAME FLANG_VENDOR "F90"
#else
#define DNAME "F90"
#endif

#if DEBUG & sun
#ifndef _ERRNO_H
extern int errno;
Expand Down Expand Up @@ -120,7 +128,11 @@ static int dodebug = 0;
#define DEBUGQQ 0
#endif

#if defined(FLANG_VENDOR) && defined(DNAME)
static char *dbg_feature = DNAME;
#else
static char *dbg_feature = "flang";
#endif

static int ipa_import_mode = 0;

Expand Down Expand Up @@ -208,7 +220,7 @@ process_input(char *argv0, LOGICAL *need_cuda_constructor)
gbl.func_count++;

if (gbl.multiversion <= 1) {
TR("F90 ILM INPUT begins\n")
TR(DNAME " ILM INPUT begins\n")
if (!IS_PARFILE)
{
upper(0);
Expand Down Expand Up @@ -273,7 +285,7 @@ process_input(char *argv0, LOGICAL *need_cuda_constructor)
AssignAddresses(); /* exp_rte.c */
}
}
TR("F90 EXPANDER begins\n");
TR(DNAME " EXPANDER begins\n");

expand(); /* expand ILM's into ILI */
DUMP("expand");
Expand Down Expand Up @@ -301,14 +313,14 @@ process_input(char *argv0, LOGICAL *need_cuda_constructor)
rm_smove();
DUMP("rmsmove");

TR("F90 SCHEDULER begins\n");
TR(DNAME " SCHEDULER begins\n");
DUMP("before-schedule");
schedule();
xtimes[5] += getcpu();
DUMP("schedule");
} /* CUDAG(GBL_CURRFUNC) & CUDA_HOST */
}
TR("F90 ASSEMBLER begins\n");
TR(DNAME " ASSEMBLER begins\n");
assemble();
xtimes[6] += getcpu();
upper_save_syminfo();
Expand Down Expand Up @@ -929,7 +941,7 @@ process_stb_file()

gbl.func_count++;

TR("F90 STBFILE INPUT begins\n")
TR(DNAME " STBFILE INPUT begins\n")
upper(1); /* should we generate upper_stbfil()? */

if (gbl.eof_flag)
Expand Down
4 changes: 4 additions & 0 deletions tools/flang2/flang2exe/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
#define LANGUAGE "F90"
#endif

#ifdef FLANG_VENDOR
#define PRODUCT FLANG_VENDOR LANGUAGE " "
#else
#define PRODUCT ""
#endif

/* COPYRIGHT is extern to make it easy to find in symbol table */
/* it also has extra space to patch in interesting stuff */
Expand Down

0 comments on commit f83f410

Please sign in to comment.