mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-06 10:57:35 +03:00
Further changes to compile using MSVC.
This commit is contained in:
parent
bb2ca5b4f5
commit
48f8ffeb0b
6 changed files with 26 additions and 9 deletions
19
dmd2/mars.c
19
dmd2/mars.c
|
@ -37,13 +37,14 @@
|
||||||
#if !IN_LLVM
|
#if !IN_LLVM
|
||||||
#include "lib.h"
|
#include "lib.h"
|
||||||
#include "json.h"
|
#include "json.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if WINDOWS_SEH
|
#if WINDOWS_SEH
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
long __cdecl __ehfilter(LPEXCEPTION_POINTERS ep);
|
long __cdecl __ehfilter(LPEXCEPTION_POINTERS ep);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !IN_LLVM
|
||||||
int response_expand(int *pargc, char ***pargv);
|
int response_expand(int *pargc, char ***pargv);
|
||||||
void browse(const char *url);
|
void browse(const char *url);
|
||||||
void getenv_setargv(const char *envvar, int *pargc, char** *pargv);
|
void getenv_setargv(const char *envvar, int *pargc, char** *pargv);
|
||||||
|
@ -1617,3 +1618,19 @@ Ldone:
|
||||||
*pargc = argc;
|
*pargc = argc;
|
||||||
*pargv = argv->tdata();
|
*pargv = argv->tdata();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if WINDOWS_SEH
|
||||||
|
|
||||||
|
long __cdecl __ehfilter(LPEXCEPTION_POINTERS ep)
|
||||||
|
{
|
||||||
|
//printf("%x\n", ep->ExceptionRecord->ExceptionCode);
|
||||||
|
if (ep->ExceptionRecord->ExceptionCode == STATUS_STACK_OVERFLOW)
|
||||||
|
{
|
||||||
|
#if 1 //ndef DEBUG
|
||||||
|
return EXCEPTION_EXECUTE_HANDLER;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
return EXCEPTION_CONTINUE_SEARCH;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -44,7 +44,7 @@ LLType* DtoComplexBaseType(Type* t)
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
LLConstant* DtoConstComplex(Type* _ty, long double re, long double im)
|
LLConstant* DtoConstComplex(Type* _ty, longdouble re, longdouble im)
|
||||||
{
|
{
|
||||||
TY ty = _ty->toBasetype()->ty;
|
TY ty = _ty->toBasetype()->ty;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
llvm::StructType* DtoComplexType(Type* t);
|
llvm::StructType* DtoComplexType(Type* t);
|
||||||
LLType* DtoComplexBaseType(Type* t);
|
LLType* DtoComplexBaseType(Type* t);
|
||||||
|
|
||||||
LLConstant* DtoConstComplex(Type* t, long double re, long double im);
|
LLConstant* DtoConstComplex(Type* t, longdouble re, longdouble im);
|
||||||
|
|
||||||
LLConstant* DtoComplexShuffleMask(unsigned a, unsigned b);
|
LLConstant* DtoComplexShuffleMask(unsigned a, unsigned b);
|
||||||
|
|
||||||
|
|
|
@ -412,11 +412,11 @@ DValue* ComplexExp::toElem(IRState* p)
|
||||||
if (c->isNullValue()) {
|
if (c->isNullValue()) {
|
||||||
Type* t = type->toBasetype();
|
Type* t = type->toBasetype();
|
||||||
if (t->ty == Tcomplex32)
|
if (t->ty == Tcomplex32)
|
||||||
c = DtoConstFP(Type::tfloat32, 0);
|
c = DtoConstFP(Type::tfloat32, ldouble(0));
|
||||||
else if (t->ty == Tcomplex64)
|
else if (t->ty == Tcomplex64)
|
||||||
c = DtoConstFP(Type::tfloat64, 0);
|
c = DtoConstFP(Type::tfloat64, ldouble(0));
|
||||||
else if (t->ty == Tcomplex80)
|
else if (t->ty == Tcomplex80)
|
||||||
c = DtoConstFP(Type::tfloat80, 0);
|
c = DtoConstFP(Type::tfloat80, ldouble(0));
|
||||||
else
|
else
|
||||||
assert(0);
|
assert(0);
|
||||||
res = DtoAggrPair(DtoType(type), c, c);
|
res = DtoAggrPair(DtoType(type), c, c);
|
||||||
|
@ -1879,7 +1879,7 @@ DValue* PostExp::toElem(IRState* p)
|
||||||
else if (e1type->isfloating())
|
else if (e1type->isfloating())
|
||||||
{
|
{
|
||||||
assert(e2type->isfloating());
|
assert(e2type->isfloating());
|
||||||
LLValue* one = DtoConstFP(e1type, 1.0);
|
LLValue* one = DtoConstFP(e1type, ldouble(1.0));
|
||||||
if (op == TOKplusplus) {
|
if (op == TOKplusplus) {
|
||||||
post = llvm::BinaryOperator::CreateFAdd(val,one,"tmp",p->scopebb());
|
post = llvm::BinaryOperator::CreateFAdd(val,one,"tmp",p->scopebb());
|
||||||
}
|
}
|
||||||
|
|
|
@ -578,7 +578,7 @@ llvm::ConstantInt* DtoConstUbyte(unsigned char i)
|
||||||
return LLConstantInt::get(LLType::getInt8Ty(gIR->context()), i, false);
|
return LLConstantInt::get(LLType::getInt8Ty(gIR->context()), i, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
LLConstant* DtoConstFP(Type* t, long double value)
|
LLConstant* DtoConstFP(Type* t, longdouble value)
|
||||||
{
|
{
|
||||||
LLType* llty = DtoType(t);
|
LLType* llty = DtoType(t);
|
||||||
assert(llty->isFloatingPointTy());
|
assert(llty->isFloatingPointTy());
|
||||||
|
|
|
@ -55,7 +55,7 @@ LLConstantInt* DtoConstSize_t(uint64_t);
|
||||||
LLConstantInt* DtoConstUint(unsigned i);
|
LLConstantInt* DtoConstUint(unsigned i);
|
||||||
LLConstantInt* DtoConstInt(int i);
|
LLConstantInt* DtoConstInt(int i);
|
||||||
LLConstantInt* DtoConstUbyte(unsigned char i);
|
LLConstantInt* DtoConstUbyte(unsigned char i);
|
||||||
LLConstant* DtoConstFP(Type* t, long double value);
|
LLConstant* DtoConstFP(Type* t, longdouble value);
|
||||||
|
|
||||||
LLConstant* DtoConstString(const char*);
|
LLConstant* DtoConstString(const char*);
|
||||||
LLConstant* DtoConstStringPtr(const char* str, const char* section = 0);
|
LLConstant* DtoConstStringPtr(const char* str, const char* section = 0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue