mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-05-04 01:11:29 +02:00
Take advantage of Triple and TargetData.
A lot of system specific knowledge is already present in LLVM. This is used to populate several fields in global.params instead of hard coded values in main(). Ensures that the frontend and LLVM have always the same values.
This commit is contained in:
36
dmd/mars.h
36
dmd/mars.h
@@ -71,6 +71,10 @@ the target object file format:
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#if IN_LLVM
|
||||
#include "llvm/ADT/Triple.h"
|
||||
#endif
|
||||
|
||||
#ifdef __DMC__
|
||||
#ifdef DEBUG
|
||||
#undef assert
|
||||
@@ -140,14 +144,15 @@ struct OutBuffer;
|
||||
// LDC
|
||||
enum ARCH
|
||||
{
|
||||
ARCHinvalid,
|
||||
ARCHx86,
|
||||
ARCHx86_64,
|
||||
ARCHppc,
|
||||
ARCHppc_64,
|
||||
ARCHarm,
|
||||
ARCHthumb
|
||||
ARCHinvalid = llvm::Triple::UnknownArch,
|
||||
ARCHx86 = llvm::Triple::x86,
|
||||
ARCHx86_64 = llvm::Triple::x86_64,
|
||||
ARCHppc = llvm::Triple::ppc,
|
||||
ARCHppc_64 = llvm::Triple::ppc64,
|
||||
ARCHarm = llvm::Triple::arm,
|
||||
ARCHthumb = llvm::Triple::thumb,
|
||||
};
|
||||
|
||||
enum OUTPUTFLAG
|
||||
{
|
||||
OUTPUTFLAGno,
|
||||
@@ -157,13 +162,13 @@ enum OUTPUTFLAG
|
||||
|
||||
enum OS
|
||||
{
|
||||
OSinvalid,
|
||||
OSLinux,
|
||||
OSHaiku,
|
||||
OSWindows,
|
||||
OSMacOSX,
|
||||
OSFreeBSD,
|
||||
OSSolaris,
|
||||
OSinvalid = llvm::Triple::UnknownOS,
|
||||
OSLinux = llvm::Triple::Linux,
|
||||
OSHaiku = llvm::Triple::Haiku,
|
||||
OSWindows = llvm::Triple::Win32,
|
||||
OSMacOSX = llvm::Triple::MacOSX,
|
||||
OSFreeBSD = llvm::Triple::FreeBSD,
|
||||
OSSolaris = llvm::Triple::Solaris,
|
||||
};
|
||||
|
||||
typedef unsigned char ubyte;
|
||||
@@ -303,8 +308,7 @@ struct Param
|
||||
bool useAvailableExternally;
|
||||
|
||||
// target stuff
|
||||
const char* llvmArch;
|
||||
const char *targetTriple;
|
||||
llvm::Triple *targetTriple;
|
||||
|
||||
// Codegen cl options
|
||||
bool singleObj;
|
||||
|
||||
Reference in New Issue
Block a user