Skip to content

Commit

Permalink
Quick hack for missing LINK
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuclaw committed Mar 24, 2021
1 parent c8979af commit 701fe78
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 111 deletions.
1 change: 1 addition & 0 deletions gcc/config/i386/i386-d.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm.h"
#include "d/d-target.h"
#include "d/d-target-def.h"
#include "d/dmd/globaltypes.h" /* For enum LINK. */

/* Implement TARGET_D_CPU_VERSIONS for x86 targets. */

Expand Down
111 changes: 1 addition & 110 deletions gcc/d/dmd/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,63 +15,11 @@
#include "root/outbuffer.h"
#include "root/filename.h"
#include "compiler.h"
#include "globaltypes.h"

// Can't include arraytypes.h here, need to declare these directly.
template <typename TYPE> struct Array;

typedef unsigned char Diagnostic;
enum
{
DIAGNOSTICerror, // generate an error
DIAGNOSTICinform, // generate a warning
DIAGNOSTICoff // disable diagnostic
};

// The state of array bounds checking
typedef unsigned char CHECKENABLE;
enum
{
CHECKENABLEdefault, // initial value
CHECKENABLEoff, // never do bounds checking
CHECKENABLEon, // always do bounds checking
CHECKENABLEsafeonly // do bounds checking only in @safe functions
};

typedef unsigned char CHECKACTION;
enum
{
CHECKACTION_D, // call D assert on failure
CHECKACTION_C, // call C assert on failure
CHECKACTION_halt // cause program halt on failure
};

enum CPU
{
x87,
mmx,
sse,
sse2,
sse3,
ssse3,
sse4_1,
sse4_2,
avx, // AVX1 instruction set
avx2, // AVX2 instruction set
avx512, // AVX-512 instruction set

// Special values that don't survive past the command line processing
baseline, // (default) the minimum capability CPU
native // the machine the compiler is being run on
};

enum CppStdRevision
{
CppStdRevisionCpp98 = 199711,
CppStdRevisionCpp11 = 201103,
CppStdRevisionCpp14 = 201402,
CppStdRevisionCpp17 = 201703
};

// Put command line switches in here
struct Param
{
Expand Down Expand Up @@ -200,11 +148,6 @@ struct Param
DString mapfile;
};

typedef unsigned structalign_t;
// magic value means "match whatever the underlying C compiler does"
// other values are all powers of 2
#define STRUCTALIGN_DEFAULT ((structalign_t) ~0)

struct Global
{
DString inifilename;
Expand Down Expand Up @@ -264,23 +207,6 @@ struct Global

extern Global global;

// Be careful not to care about sign when using dinteger_t
// use this instead of integer_t to
// avoid conflicts with system #include's
typedef uint64_t dinteger_t;
// Signed and unsigned variants
typedef int64_t sinteger_t;
typedef uint64_t uinteger_t;

typedef int8_t d_int8;
typedef uint8_t d_uns8;
typedef int16_t d_int16;
typedef uint16_t d_uns16;
typedef int32_t d_int32;
typedef uint32_t d_uns32;
typedef int64_t d_int64;
typedef uint64_t d_uns64;

// file location
struct Loc
{
Expand All @@ -300,38 +226,3 @@ struct Loc
const char *toChars() const;
bool equals(const Loc& loc);
};

enum LINK
{
LINKdefault,
LINKd,
LINKc,
LINKcpp,
LINKwindows,
LINKobjc,
LINKsystem
};

enum CPPMANGLE
{
CPPMANGLEdefault,
CPPMANGLEstruct,
CPPMANGLEclass
};

enum MATCH
{
MATCHnomatch, // no match
MATCHconvert, // match with conversions
MATCHconst, // match with conversion to const
MATCHexact // exact match
};

enum PINLINE
{
PINLINEdefault, // as specified on the command line
PINLINEnever, // never inline
PINLINEalways // always inline
};

typedef uinteger_t StorageClass;
123 changes: 123 additions & 0 deletions gcc/d/dmd/globaltypes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@

/* Compiler implementation of the D programming language
* Copyright (C) 1999-2021 by The D Language Foundation, All Rights Reserved
* written by Walter Bright
* http://www.digitalmars.com
* Distributed under the Boost Software License, Version 1.0.
* http://www.boost.org/LICENSE_1_0.txt
* https://github.com/dlang/dmd/blob/master/src/dmd/globaltypes.h
*/

#pragma once

#include "root/dsystem.h"

typedef unsigned char Diagnostic;
enum
{
DIAGNOSTICerror, // generate an error
DIAGNOSTICinform, // generate a warning
DIAGNOSTICoff // disable diagnostic
};

// The state of array bounds checking
typedef unsigned char CHECKENABLE;
enum
{
CHECKENABLEdefault, // initial value
CHECKENABLEoff, // never do bounds checking
CHECKENABLEon, // always do bounds checking
CHECKENABLEsafeonly // do bounds checking only in @safe functions
};

typedef unsigned char CHECKACTION;
enum
{
CHECKACTION_D, // call D assert on failure
CHECKACTION_C, // call C assert on failure
CHECKACTION_halt // cause program halt on failure
};

enum CPU
{
x87,
mmx,
sse,
sse2,
sse3,
ssse3,
sse4_1,
sse4_2,
avx, // AVX1 instruction set
avx2, // AVX2 instruction set
avx512, // AVX-512 instruction set

// Special values that don't survive past the command line processing
baseline, // (default) the minimum capability CPU
native // the machine the compiler is being run on
};

enum CppStdRevision
{
CppStdRevisionCpp98 = 199711,
CppStdRevisionCpp11 = 201103,
CppStdRevisionCpp14 = 201402,
CppStdRevisionCpp17 = 201703
};

typedef unsigned structalign_t;
// magic value means "match whatever the underlying C compiler does"
// other values are all powers of 2
#define STRUCTALIGN_DEFAULT ((structalign_t) ~0)

// Be careful not to care about sign when using dinteger_t
// use this instead of integer_t to
// avoid conflicts with system #include's
typedef uint64_t dinteger_t;
// Signed and unsigned variants
typedef int64_t sinteger_t;
typedef uint64_t uinteger_t;

typedef int8_t d_int8;
typedef uint8_t d_uns8;
typedef int16_t d_int16;
typedef uint16_t d_uns16;
typedef int32_t d_int32;
typedef uint32_t d_uns32;
typedef int64_t d_int64;
typedef uint64_t d_uns64;

enum LINK
{
LINKdefault,
LINKd,
LINKc,
LINKcpp,
LINKwindows,
LINKobjc,
LINKsystem
};

enum CPPMANGLE
{
CPPMANGLEdefault,
CPPMANGLEstruct,
CPPMANGLEclass
};

enum MATCH
{
MATCHnomatch, // no match
MATCHconvert, // match with conversions
MATCHconst, // match with conversion to const
MATCHexact // exact match
};

enum PINLINE
{
PINLINEdefault, // as specified on the command line
PINLINEnever, // never inline
PINLINEalways // always inline
};

typedef uinteger_t StorageClass;
2 changes: 1 addition & 1 deletion gcc/d/dmd/root/dsystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@

#pragma once

#include "d-system.h"
#include "d/d-system.h"

0 comments on commit 701fe78

Please sign in to comment.