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 Nov 3, 2018
1 parent 0479dc0 commit 51d5693
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 6 deletions.
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 @@ -1189,7 +1193,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 @@ -5559,7 +5559,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;
SPTR pdsym = SST_SYMG(stktop);
int pdtype = PDNUMG(pdsym);
Expand Down Expand Up @@ -10759,7 +10759,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
22 changes: 17 additions & 5 deletions tools/flang2/flang2exe/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@

static bool process_input(char *argv0, bool *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 @@ -113,7 +121,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 @@ -201,7 +213,7 @@ process_input(char *argv0, bool *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 @@ -269,7 +281,7 @@ process_input(char *argv0, bool *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 @@ -297,14 +309,14 @@ process_input(char *argv0, bool *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 @@ -928,7 +940,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.cpp
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
4 changes: 4 additions & 0 deletions tools/shared/ccffinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ static int prevchildnest = -1;
static int prevlineno = 0;
static bool anymessages;

#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

0 comments on commit 51d5693

Please sign in to comment.