Skip to content

Commit 73af20a

Browse files
committed
make use of FLANG_VENDOR
Signed-off-by: Paul Osmialowski <[email protected]>
1 parent 23708ea commit 73af20a

File tree

9 files changed

+57
-9
lines changed

9 files changed

+57
-9
lines changed

tools/flang1/flang1exe/listing.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,13 @@ list_ln(const char *beg, const char *txt)
106106
if (!lf)
107107
return; /* in case error msg written before file
108108
* opened */
109+
#ifdef FLANG_VENDOR
110+
fprintf(lf, "\n\n\n%s%s (Version %8s) %s page %d\n\n",
111+
FLANG_VENDOR, version.lang, version.vsn, gbl.datetime, pgno);
112+
#else
109113
fprintf(lf, "\n\n\n%s (Version %8s) %s page %d\n\n",
110114
version.lang, version.vsn, gbl.datetime, pgno);
115+
#endif
111116
pgno++;
112117
pgpos = 6;
113118
}

tools/flang1/flang1exe/main.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ static const char *feature = "pgfortran";
9696

9797
/** Product name in debug output
9898
*/
99-
#define DNAME "F90"
99+
#ifdef FLANG_VENDOR
100+
#define DNAME FLANG_VENDOR FLANG_LANGUAGE
101+
#else
102+
#define DNAME FLANG_LANGUAGE
103+
#endif
100104

101105
#if DEBUG
102106
static int dodebug = 0;
@@ -1143,7 +1147,12 @@ do_debug(const char *phase)
11431147
return;
11441148
}
11451149
if (dodebug)
1150+
#ifdef FLANG_VENDOR
1151+
fprintf(gbl.dbgfil, "{%s%s after %s\n", FLANG_VENDOR, FLANG_LANGUAGE,
1152+
phase);
1153+
#else
11461154
fprintf(gbl.dbgfil, "{%s after %s\n", feature, phase);
1155+
#endif
11471156

11481157
current_phase = phase;
11491158
execute_actions_for_keyword(phase_dump_map, phase);

tools/flang1/flang1exe/semfunc.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5621,7 +5621,7 @@ ref_pd(SST *stktop, ITEM *list)
56215621
int pvar;
56225622
int nelems, eltype;
56235623
const char *sname = NULL;
5624-
char verstr[140]; /*140, get_version_str returns max 128 char + pf90 prefix */
5624+
char verstr[256]; /* get_version_str returns max 128 chars + vendor prefix */
56255625
FtnRtlEnum rtlRtn = 0;
56265626
SPTR pdsym = SST_SYMG(stktop);
56275627
int pdtype = PDNUMG(pdsym);
@@ -10833,7 +10833,13 @@ ref_pd(SST *stktop, ITEM *list)
1083310833
goto call_e74_cnt;
1083410834
}
1083510835

10836+
#ifdef FLANG_VENDOR
10837+
assert(strlen(FLANG_VENDOR) < 116, "FLANG_VENDOR string too long",
10838+
strlen(FLANG_VENDOR), 4);
10839+
sprintf(verstr, FLANG_VENDOR FLANG_LANGUAGE " %s", get_version_string());
10840+
#else
1083610841
sprintf(verstr, "flang %s", get_version_string());
10842+
#endif
1083710843
sptr = getstring(verstr, strlen(verstr));
1083810844

1083910845
goto const_str_val;

tools/flang1/flang1exe/version.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@
88
#include "release.h"
99
#include "version.h"
1010

11-
#define LANGUAGE "F90"
11+
#define LANGUAGE FLANG_LANGUAGE
1212

13+
#ifdef FLANG_VENDOR
14+
#define PRODUCT FLANG_VENDOR FLANG_LANGUAGE " "
15+
#else
1316
#define PRODUCT ""
17+
#endif
1418

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

tools/flang1/flang1exe/version.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
*
66
*/
77

8+
#ifndef FLANG_LANGUAGE
9+
#define FLANG_LANGUAGE "F90"
10+
#endif
11+
812
typedef struct {
913
const char *lang; /* language */
1014
const char *host; /* host */

tools/flang2/flang2exe/main.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@
5151

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

54+
/** Product name in debug output
55+
*/
56+
#ifdef FLANG_VENDOR
57+
#define DNAME FLANG_VENDOR FLANG_LANGUAGE
58+
#else
59+
#define DNAME FLANG_LANGUAGE
60+
#endif
61+
5462
#if DEBUG & sun
5563
#ifndef _ERRNO_H
5664
extern int errno;
@@ -199,7 +207,7 @@ process_input(char *argv0, bool *need_cuda_constructor)
199207
gbl.func_count++;
200208
gbl.multi_func_count = gbl.func_count;
201209

202-
TR("F90 ILM INPUT begins\n")
210+
TR(DNAME " ILM INPUT begins\n")
203211
if (!IS_PARFILE)
204212
{
205213
upper(0);
@@ -278,7 +286,7 @@ process_input(char *argv0, bool *need_cuda_constructor)
278286
AssignAddresses(); /* exp_rte.c */
279287
}
280288
}
281-
TR("F90 EXPANDER begins\n");
289+
TR(DNAME " EXPANDER begins\n");
282290

283291
expand(); /* expand ILM's into ILI */
284292
DUMP("expand");
@@ -315,14 +323,14 @@ process_input(char *argv0, bool *need_cuda_constructor)
315323
gbl.ompaccel_isdevice = true;
316324
#endif
317325

318-
TR("F90 SCHEDULER begins\n");
326+
TR(DNAME " SCHEDULER begins\n");
319327
DUMP("before-schedule");
320328
schedule();
321329
xtimes[5] += get_rutime();
322330
DUMP("schedule");
323331
} /* CUDAG(GBL_CURRFUNC) & CUDA_HOST */
324332
}
325-
TR("F90 ASSEMBLER begins\n");
333+
TR(DNAME " ASSEMBLER begins\n");
326334
assemble();
327335
xtimes[6] += get_rutime();
328336
upper_save_syminfo();
@@ -986,7 +994,7 @@ process_stb_file()
986994
gbl.func_count++;
987995
gbl.multi_func_count = gbl.func_count;
988996

989-
TR("F90 STBFILE INPUT begins\n")
997+
TR(DNAME " STBFILE INPUT begins\n")
990998
upper(1); /* should we generate upper_stbfil()? */
991999

9921000
if (gbl.eof_flag)

tools/flang2/flang2exe/version.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@
99
#include "version.h"
1010

1111
#ifndef LANGUAGE
12-
#define LANGUAGE "F90"
12+
#define LANGUAGE FLANG_LANGUAGE
1313
#endif
1414

15+
#ifdef FLANG_VENDOR
16+
#define PRODUCT FLANG_VENDOR FLANG_LANGUAGE " "
17+
#else
1518
#define PRODUCT ""
19+
#endif
1620

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

tools/flang2/flang2exe/version.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
#ifndef VERSION_H_
99
#define VERSION_H_
1010

11+
#ifndef FLANG_LANGUAGE
12+
#define FLANG_LANGUAGE "F90"
13+
#endif
14+
1115
typedef struct {
1216
const char *lang; /* language */
1317
const char *host; /* host */

tools/shared/ccffinfo.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ static int prevlineno = 0;
5050
static bool anymessages;
5151
#endif
5252

53+
#ifdef FLANG_VENDOR
54+
#define BUILD_VENDOR FLANG_VENDOR
55+
#else
5356
#define BUILD_VENDOR "flang-compiler"
57+
#endif
5458

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

0 commit comments

Comments
 (0)