Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make use of FLANG_VENDOR #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tools/flang1/flang1exe/listing.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,13 @@ list_ln(const char *beg, const 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);
pawosm-arm marked this conversation as resolved.
Show resolved Hide resolved
#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
11 changes: 10 additions & 1 deletion tools/flang1/flang1exe/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ static const char *feature = "pgfortran";

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

#if DEBUG
static int dodebug = 0;
Expand Down Expand Up @@ -1143,7 +1147,12 @@ do_debug(const char *phase)
return;
}
if (dodebug)
#ifdef FLANG_VENDOR
fprintf(gbl.dbgfil, "{%s%s after %s\n", FLANG_VENDOR, FLANG_LANGUAGE,
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 @@ -5621,7 +5621,7 @@ ref_pd(SST *stktop, ITEM *list)
int pvar;
int nelems, eltype;
const 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 = 0;
SPTR pdsym = SST_SYMG(stktop);
int pdtype = PDNUMG(pdsym);
Expand Down Expand Up @@ -10833,7 +10833,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 FLANG_LANGUAGE " %s", get_version_string());
#else
sprintf(verstr, "flang %s", get_version_string());
#endif
sptr = getstring(verstr, strlen(verstr));

goto const_str_val;
Expand Down
6 changes: 5 additions & 1 deletion tools/flang1/flang1exe/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@
#include "release.h"
#include "version.h"

#define LANGUAGE "F90"
#define LANGUAGE FLANG_LANGUAGE

#ifdef FLANG_VENDOR
#define PRODUCT FLANG_VENDOR FLANG_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/flang1/flang1exe/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
*
*/

#ifndef FLANG_LANGUAGE
#define FLANG_LANGUAGE "F90"
#endif

typedef struct {
const char *lang; /* language */
const char *host; /* host */
Expand Down
18 changes: 13 additions & 5 deletions tools/flang2/flang2exe/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@

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

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

#if DEBUG & sun
#ifndef _ERRNO_H
extern int errno;
Expand Down Expand Up @@ -199,7 +207,7 @@ process_input(char *argv0, bool *need_cuda_constructor)
gbl.func_count++;
gbl.multi_func_count = gbl.func_count;

TR("F90 ILM INPUT begins\n")
TR(DNAME " ILM INPUT begins\n")
if (!IS_PARFILE)
{
upper(0);
Expand Down Expand Up @@ -278,7 +286,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 @@ -315,14 +323,14 @@ process_input(char *argv0, bool *need_cuda_constructor)
gbl.ompaccel_isdevice = true;
#endif

TR("F90 SCHEDULER begins\n");
TR(DNAME " SCHEDULER begins\n");
DUMP("before-schedule");
schedule();
xtimes[5] += get_rutime();
DUMP("schedule");
} /* CUDAG(GBL_CURRFUNC) & CUDA_HOST */
}
TR("F90 ASSEMBLER begins\n");
TR(DNAME " ASSEMBLER begins\n");
assemble();
xtimes[6] += get_rutime();
upper_save_syminfo();
Expand Down Expand Up @@ -986,7 +994,7 @@ process_stb_file()
gbl.func_count++;
gbl.multi_func_count = 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
6 changes: 5 additions & 1 deletion tools/flang2/flang2exe/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@
#include "version.h"

#ifndef LANGUAGE
#define LANGUAGE "F90"
#define LANGUAGE FLANG_LANGUAGE
#endif

#ifdef FLANG_VENDOR
#define PRODUCT FLANG_VENDOR FLANG_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/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
#ifndef VERSION_H_
#define VERSION_H_

#ifndef FLANG_LANGUAGE
#define FLANG_LANGUAGE "F90"
#endif

typedef struct {
const char *lang; /* language */
const char *host; /* host */
Expand Down
4 changes: 4 additions & 0 deletions tools/shared/ccffinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ static int prevlineno = 0;
static bool anymessages;
#endif

#ifdef FLANG_VENDOR
#define BUILD_VENDOR FLANG_VENDOR
pawosm-arm marked this conversation as resolved.
Show resolved Hide resolved
#else
#define BUILD_VENDOR "flang-compiler"
#endif

FIHB fihb = {(FIH *)0, 0, 0, 0, 0, 0, 0, 0};
FIHB ifihb = {(FIH *)0, 0, 0, 0, 0, 0, 0, 0}; /* bottom-up auto-inliner */
Expand Down