mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-09-17 19:07:05 +02:00
Some missed LLVMDC -> LDC.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
LLVMDC is released under the "three-clause BSD" license reproduced below with
|
LDC is released under the "three-clause BSD" license reproduced below with
|
||||||
the following exceptions:
|
the following exceptions:
|
||||||
|
|
||||||
The DMD frontend in dmd/* is originally written by Walter Bright and released
|
The DMD frontend in dmd/* is originally written by Walter Bright and released
|
||||||
@@ -10,7 +10,7 @@ the GPL version 2 or later.
|
|||||||
|
|
||||||
|
|
||||||
-- "three-clause BSD" --
|
-- "three-clause BSD" --
|
||||||
Copyright (c) 2007-2008 LLVMDC Team.
|
Copyright (c) 2007-2008 LDC Team.
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
@@ -21,7 +21,7 @@ are permitted provided that the following conditions are met:
|
|||||||
* Redistributions in binary form must reproduce the above copyright notice, this
|
* Redistributions in binary form must reproduce the above copyright notice, this
|
||||||
list of conditions and the following disclaimer in the documentation and/or
|
list of conditions and the following disclaimer in the documentation and/or
|
||||||
other materials provided with the distribution.
|
other materials provided with the distribution.
|
||||||
* Neither the name of the LLVMDC Team nor the names of its contributors may be
|
* Neither the name of the LDC Team nor the names of its contributors may be
|
||||||
used to endorse or promote products derived from this software without specific
|
used to endorse or promote products derived from this software without specific
|
||||||
prior written permission.
|
prior written permission.
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ int atoi(char[] s) {
|
|||||||
return !neg ? i : -i;
|
return !neg ? i : -i;
|
||||||
}
|
}
|
||||||
|
|
||||||
version(LLVMDC)
|
version(LDC)
|
||||||
{
|
{
|
||||||
pragma(intrinsic, "llvm.sqrt.f64")
|
pragma(intrinsic, "llvm.sqrt.f64")
|
||||||
double sqrt(double val);
|
double sqrt(double val);
|
||||||
|
|||||||
+1
-1
@@ -308,7 +308,7 @@ Expression *BinExp::arrayOp(Scope *sc)
|
|||||||
else
|
else
|
||||||
{ /* In library, refer to it.
|
{ /* In library, refer to it.
|
||||||
*/
|
*/
|
||||||
// LLVMDC FIXME
|
// LDC FIXME
|
||||||
fd = FuncDeclaration::genCfunc(NULL, type, name);
|
fd = FuncDeclaration::genCfunc(NULL, type, name);
|
||||||
}
|
}
|
||||||
sv->ptrvalue = fd; // cache symbol in hash table
|
sv->ptrvalue = fd; // cache symbol in hash table
|
||||||
|
|||||||
+1
-1
@@ -1183,7 +1183,7 @@ Expression *BinExp::scaleFactor(Scope *sc)
|
|||||||
stride = t1b->nextOf()->size(loc);
|
stride = t1b->nextOf()->size(loc);
|
||||||
if (!t->equals(t2b))
|
if (!t->equals(t2b))
|
||||||
e2 = e2->castTo(sc, t);
|
e2 = e2->castTo(sc, t);
|
||||||
// LLVMDC: llvm uses typesafe pointer arithmetic
|
// LDC: llvm uses typesafe pointer arithmetic
|
||||||
#if !IN_LLVM
|
#if !IN_LLVM
|
||||||
if (t1b->next->isbit())
|
if (t1b->next->isbit())
|
||||||
// BUG: should add runtime check for misaligned offsets
|
// BUG: should add runtime check for misaligned offsets
|
||||||
|
|||||||
+1
-1
@@ -127,7 +127,7 @@ void VersionCondition::checkPredefined(Loc loc, char *ident)
|
|||||||
{
|
{
|
||||||
static char* reserved[] =
|
static char* reserved[] =
|
||||||
{
|
{
|
||||||
"DigitalMars", "LLVM", "LLVMDC", "LLVM64",
|
"DigitalMars", "LLVM", "LDC", "LLVM64",
|
||||||
"X86", "X86_64", "PPC", "PPC64",
|
"X86", "X86_64", "PPC", "PPC64",
|
||||||
"Windows", "Win32", "Win64",
|
"Windows", "Win32", "Win64",
|
||||||
"linux", "darwin", "Posix",
|
"linux", "darwin", "Posix",
|
||||||
|
|||||||
+11
-11
@@ -267,7 +267,7 @@ Expression *getRightThis(Loc loc, Scope *sc, AggregateDeclaration *ad,
|
|||||||
//printf("rewriting e1 to %s's this\n", f->toChars());
|
//printf("rewriting e1 to %s's this\n", f->toChars());
|
||||||
n++;
|
n++;
|
||||||
|
|
||||||
// LLVMDC seems dmd misses it sometimes here :/
|
// LDC seems dmd misses it sometimes here :/
|
||||||
f->vthis->nestedref = 1;
|
f->vthis->nestedref = 1;
|
||||||
|
|
||||||
e1 = new VarExp(loc, f->vthis);
|
e1 = new VarExp(loc, f->vthis);
|
||||||
@@ -3756,7 +3756,7 @@ Expression *VarExp::semantic(Scope *sc)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// LLVMDC: Fixes bug 1161, http://d.puremagic.com/issues/show_bug.cgi?id=1161
|
// LDC: Fixes bug 1161, http://d.puremagic.com/issues/show_bug.cgi?id=1161
|
||||||
// check access to VarDeclaration
|
// check access to VarDeclaration
|
||||||
accessCheck(loc, sc, NULL, var);
|
accessCheck(loc, sc, NULL, var);
|
||||||
|
|
||||||
@@ -5555,7 +5555,7 @@ Expression *DelegateExp::semantic(Scope *sc)
|
|||||||
if (!type)
|
if (!type)
|
||||||
{
|
{
|
||||||
e1 = e1->semantic(sc);
|
e1 = e1->semantic(sc);
|
||||||
// LLVMDC we need a copy as we store the LLVM tpye in TypeFunction, and delegate/members have different types for 'this'
|
// LDC we need a copy as we store the LLVM tpye in TypeFunction, and delegate/members have different types for 'this'
|
||||||
type = new TypeDelegate(func->type->syntaxCopy());
|
type = new TypeDelegate(func->type->syntaxCopy());
|
||||||
type = type->semantic(loc, sc);
|
type = type->semantic(loc, sc);
|
||||||
AggregateDeclaration *ad = func->toParent()->isAggregateDeclaration();
|
AggregateDeclaration *ad = func->toParent()->isAggregateDeclaration();
|
||||||
@@ -6223,7 +6223,7 @@ Expression *AddrExp::semantic(Scope *sc)
|
|||||||
FuncDeclaration *f = dve->var->isFuncDeclaration();
|
FuncDeclaration *f = dve->var->isFuncDeclaration();
|
||||||
VarDeclaration *v = dve->var->isVarDeclaration();
|
VarDeclaration *v = dve->var->isVarDeclaration();
|
||||||
|
|
||||||
// LLVMDC
|
// LDC
|
||||||
if (f && f->isIntrinsic())
|
if (f && f->isIntrinsic())
|
||||||
{
|
{
|
||||||
error("cannot take the address of intrinsic function %s", e1->toChars());
|
error("cannot take the address of intrinsic function %s", e1->toChars());
|
||||||
@@ -7843,7 +7843,7 @@ Expression *ShlAssignExp::semantic(Scope *sc)
|
|||||||
e1->checkIntegral();
|
e1->checkIntegral();
|
||||||
e2 = e2->checkIntegral();
|
e2 = e2->checkIntegral();
|
||||||
//e2 = e2->castTo(sc, Type::tshiftcnt);
|
//e2 = e2->castTo(sc, Type::tshiftcnt);
|
||||||
e2 = e2->castTo(sc, e1->type); // LLVMDC
|
e2 = e2->castTo(sc, e1->type); // LDC
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7872,7 +7872,7 @@ Expression *ShrAssignExp::semantic(Scope *sc)
|
|||||||
e1->checkIntegral();
|
e1->checkIntegral();
|
||||||
e2 = e2->checkIntegral();
|
e2 = e2->checkIntegral();
|
||||||
//e2 = e2->castTo(sc, Type::tshiftcnt);
|
//e2 = e2->castTo(sc, Type::tshiftcnt);
|
||||||
e2 = e2->castTo(sc, e1->type); // LLVMDC
|
e2 = e2->castTo(sc, e1->type); // LDC
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7901,7 +7901,7 @@ Expression *UshrAssignExp::semantic(Scope *sc)
|
|||||||
e1->checkIntegral();
|
e1->checkIntegral();
|
||||||
e2 = e2->checkIntegral();
|
e2 = e2->checkIntegral();
|
||||||
//e2 = e2->castTo(sc, Type::tshiftcnt);
|
//e2 = e2->castTo(sc, Type::tshiftcnt);
|
||||||
e2 = e2->castTo(sc, e1->type); // LLVMDC
|
e2 = e2->castTo(sc, e1->type); // LDC
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8389,7 +8389,7 @@ Expression *ShlExp::semantic(Scope *sc)
|
|||||||
e2 = e2->checkIntegral();
|
e2 = e2->checkIntegral();
|
||||||
e1 = e1->integralPromotions(sc);
|
e1 = e1->integralPromotions(sc);
|
||||||
//e2 = e2->castTo(sc, Type::tshiftcnt);
|
//e2 = e2->castTo(sc, Type::tshiftcnt);
|
||||||
e2 = e2->castTo(sc, e1->type); // LLVMDC
|
e2 = e2->castTo(sc, e1->type); // LDC
|
||||||
type = e1->type;
|
type = e1->type;
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
@@ -8414,7 +8414,7 @@ Expression *ShrExp::semantic(Scope *sc)
|
|||||||
e2 = e2->checkIntegral();
|
e2 = e2->checkIntegral();
|
||||||
e1 = e1->integralPromotions(sc);
|
e1 = e1->integralPromotions(sc);
|
||||||
//e2 = e2->castTo(sc, Type::tshiftcnt);
|
//e2 = e2->castTo(sc, Type::tshiftcnt);
|
||||||
e2 = e2->castTo(sc, e1->type); // LLVMDC
|
e2 = e2->castTo(sc, e1->type); // LDC
|
||||||
type = e1->type;
|
type = e1->type;
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
@@ -8439,7 +8439,7 @@ Expression *UshrExp::semantic(Scope *sc)
|
|||||||
e2 = e2->checkIntegral();
|
e2 = e2->checkIntegral();
|
||||||
e1 = e1->integralPromotions(sc);
|
e1 = e1->integralPromotions(sc);
|
||||||
//e2 = e2->castTo(sc, Type::tshiftcnt);
|
//e2 = e2->castTo(sc, Type::tshiftcnt);
|
||||||
e2 = e2->castTo(sc, e1->type); // LLVMDC
|
e2 = e2->castTo(sc, e1->type); // LDC
|
||||||
type = e1->type;
|
type = e1->type;
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
@@ -9092,7 +9092,7 @@ void CondExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
|
|||||||
|
|
||||||
#if IN_LLVM
|
#if IN_LLVM
|
||||||
|
|
||||||
// Strictly LLVMDC specific stuff
|
// Strictly LDC specific stuff
|
||||||
|
|
||||||
GEPExp::GEPExp(Loc loc, Expression* e, Identifier* id, unsigned idx)
|
GEPExp::GEPExp(Loc loc, Expression* e, Identifier* id, unsigned idx)
|
||||||
: UnaExp(loc, TOKgep, sizeof(GEPExp), e)
|
: UnaExp(loc, TOKgep, sizeof(GEPExp), e)
|
||||||
|
|||||||
+14
-14
@@ -158,7 +158,7 @@ struct Expression : Object
|
|||||||
// Back end
|
// Back end
|
||||||
virtual elem *toElem(IRState *irs);
|
virtual elem *toElem(IRState *irs);
|
||||||
virtual dt_t **toDt(dt_t **pdt);
|
virtual dt_t **toDt(dt_t **pdt);
|
||||||
// LLVMDC
|
// LDC
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ struct IntegerExp : Expression
|
|||||||
Expression *toLvalue(Scope *sc, Expression *e);
|
Expression *toLvalue(Scope *sc, Expression *e);
|
||||||
elem *toElem(IRState *irs);
|
elem *toElem(IRState *irs);
|
||||||
dt_t **toDt(dt_t **pdt);
|
dt_t **toDt(dt_t **pdt);
|
||||||
// LLVMDC
|
// LDC
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -210,7 +210,7 @@ struct RealExp : Expression
|
|||||||
void toMangleBuffer(OutBuffer *buf);
|
void toMangleBuffer(OutBuffer *buf);
|
||||||
elem *toElem(IRState *irs);
|
elem *toElem(IRState *irs);
|
||||||
dt_t **toDt(dt_t **pdt);
|
dt_t **toDt(dt_t **pdt);
|
||||||
// LLVMDC
|
// LDC
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -238,7 +238,7 @@ struct ComplexExp : Expression
|
|||||||
#endif
|
#endif
|
||||||
elem *toElem(IRState *irs);
|
elem *toElem(IRState *irs);
|
||||||
dt_t **toDt(dt_t **pdt);
|
dt_t **toDt(dt_t **pdt);
|
||||||
// LLVMDC
|
// LDC
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -317,7 +317,7 @@ struct NullExp : Expression
|
|||||||
Expression *interpret(InterState *istate);
|
Expression *interpret(InterState *istate);
|
||||||
elem *toElem(IRState *irs);
|
elem *toElem(IRState *irs);
|
||||||
dt_t **toDt(dt_t **pdt);
|
dt_t **toDt(dt_t **pdt);
|
||||||
// LLVMDC
|
// LDC
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -347,7 +347,7 @@ struct StringExp : Expression
|
|||||||
void toMangleBuffer(OutBuffer *buf);
|
void toMangleBuffer(OutBuffer *buf);
|
||||||
elem *toElem(IRState *irs);
|
elem *toElem(IRState *irs);
|
||||||
dt_t **toDt(dt_t **pdt);
|
dt_t **toDt(dt_t **pdt);
|
||||||
// LLVMDC
|
// LDC
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -400,7 +400,7 @@ struct ArrayLiteralExp : Expression
|
|||||||
int inlineCost(InlineCostState *ics);
|
int inlineCost(InlineCostState *ics);
|
||||||
Expression *doInline(InlineDoState *ids);
|
Expression *doInline(InlineDoState *ids);
|
||||||
Expression *inlineScan(InlineScanState *iss);
|
Expression *inlineScan(InlineScanState *iss);
|
||||||
// LLVMDC
|
// LDC
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -427,7 +427,7 @@ struct AssocArrayLiteralExp : Expression
|
|||||||
int inlineCost(InlineCostState *ics);
|
int inlineCost(InlineCostState *ics);
|
||||||
Expression *doInline(InlineDoState *ids);
|
Expression *doInline(InlineDoState *ids);
|
||||||
Expression *inlineScan(InlineScanState *iss);
|
Expression *inlineScan(InlineScanState *iss);
|
||||||
// LLVMDC
|
// LDC
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -460,7 +460,7 @@ struct StructLiteralExp : Expression
|
|||||||
int inlineCost(InlineCostState *ics);
|
int inlineCost(InlineCostState *ics);
|
||||||
Expression *doInline(InlineDoState *ids);
|
Expression *doInline(InlineDoState *ids);
|
||||||
Expression *inlineScan(InlineScanState *iss);
|
Expression *inlineScan(InlineScanState *iss);
|
||||||
// LLVMDC
|
// LDC
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -594,7 +594,7 @@ struct VarExp : Expression
|
|||||||
int inlineCost(InlineCostState *ics);
|
int inlineCost(InlineCostState *ics);
|
||||||
Expression *doInline(InlineDoState *ids);
|
Expression *doInline(InlineDoState *ids);
|
||||||
//Expression *inlineScan(InlineScanState *iss);
|
//Expression *inlineScan(InlineScanState *iss);
|
||||||
// LLVMDC
|
// LDC
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -826,7 +826,7 @@ struct DotVarExp : UnaExp
|
|||||||
void dump(int indent);
|
void dump(int indent);
|
||||||
elem *toElem(IRState *irs);
|
elem *toElem(IRState *irs);
|
||||||
|
|
||||||
//LLVMDC: since we don't convert abc.def -> *(&abc + ABC.def.offsetof)
|
//LDC: since we don't convert abc.def -> *(&abc + ABC.def.offsetof)
|
||||||
// these are needed
|
// these are needed
|
||||||
Expression *optimize(int result);
|
Expression *optimize(int result);
|
||||||
Expression *interpret(InterState *istate);
|
Expression *interpret(InterState *istate);
|
||||||
@@ -901,7 +901,7 @@ struct AddrExp : UnaExp
|
|||||||
MATCH implicitConvTo(Type *t);
|
MATCH implicitConvTo(Type *t);
|
||||||
Expression *castTo(Scope *sc, Type *t);
|
Expression *castTo(Scope *sc, Type *t);
|
||||||
Expression *optimize(int result);
|
Expression *optimize(int result);
|
||||||
// LLVMDC
|
// LDC
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1004,7 +1004,7 @@ struct CastExp : UnaExp
|
|||||||
// For operator overloading
|
// For operator overloading
|
||||||
Identifier *opId();
|
Identifier *opId();
|
||||||
|
|
||||||
// LLVMDC
|
// LDC
|
||||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1501,7 +1501,7 @@ struct LineInitExp : DefaultInitExp
|
|||||||
|
|
||||||
#if IN_LLVM
|
#if IN_LLVM
|
||||||
|
|
||||||
// this stuff is strictly LLVMDC
|
// this stuff is strictly LDC
|
||||||
|
|
||||||
struct GEPExp : UnaExp
|
struct GEPExp : UnaExp
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-2
@@ -94,7 +94,7 @@ Dsymbol *FuncDeclaration::syntaxCopy(Dsymbol *s)
|
|||||||
f->fbody = fbody ? fbody->syntaxCopy() : NULL;
|
f->fbody = fbody ? fbody->syntaxCopy() : NULL;
|
||||||
assert(!fthrows); // deprecated
|
assert(!fthrows); // deprecated
|
||||||
|
|
||||||
// LLVMDC
|
// LDC
|
||||||
f->intrinsicName = intrinsicName;
|
f->intrinsicName = intrinsicName;
|
||||||
|
|
||||||
return f;
|
return f;
|
||||||
@@ -2020,7 +2020,7 @@ int FuncDeclaration::addPostInvariant()
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//
|
//
|
||||||
// LLVMDC: Adjusted to give argument info to the runtime function decl.
|
// LDC: Adjusted to give argument info to the runtime function decl.
|
||||||
//
|
//
|
||||||
|
|
||||||
FuncDeclaration *FuncDeclaration::genCfunc(Arguments *args, Type *treturn, char *name)
|
FuncDeclaration *FuncDeclaration::genCfunc(Arguments *args, Type *treturn, char *name)
|
||||||
|
|||||||
+1
-1
@@ -702,7 +702,7 @@ void Lexer::scan(Token *t)
|
|||||||
}
|
}
|
||||||
else if (id == Id::VENDOR)
|
else if (id == Id::VENDOR)
|
||||||
{
|
{
|
||||||
t->ustring = (unsigned char *)"LLVMDC";
|
t->ustring = (unsigned char *)"LDC";
|
||||||
goto Lstring;
|
goto Lstring;
|
||||||
}
|
}
|
||||||
else if (id == Id::TIMESTAMP)
|
else if (id == Id::TIMESTAMP)
|
||||||
|
|||||||
+1
-1
@@ -161,7 +161,7 @@ enum TOK
|
|||||||
TOKshared,
|
TOKshared,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// LLVMDC specific
|
// LDC specific
|
||||||
#if IN_LLVM
|
#if IN_LLVM
|
||||||
TOKgep,
|
TOKgep,
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-1
@@ -122,7 +122,7 @@ Module::Module(char *filename, Identifier *ident, int doDocComment, int doHdrGen
|
|||||||
}
|
}
|
||||||
srcfile = new File(srcfilename);
|
srcfile = new File(srcfilename);
|
||||||
|
|
||||||
// LLVMDC
|
// LDC
|
||||||
llvmForceLogging = false;
|
llvmForceLogging = false;
|
||||||
this->doDocComment = doDocComment;
|
this->doDocComment = doDocComment;
|
||||||
this->doHdrGen = doHdrGen;
|
this->doHdrGen = doHdrGen;
|
||||||
|
|||||||
+1
-1
@@ -169,7 +169,7 @@ struct Module : Package
|
|||||||
Symbol *toSymbol();
|
Symbol *toSymbol();
|
||||||
void genmoduleinfo();
|
void genmoduleinfo();
|
||||||
|
|
||||||
// LLVMDC
|
// LDC
|
||||||
void buildTargetFiles();
|
void buildTargetFiles();
|
||||||
File* buildFilePath(char* forcename, char* path, char* ext);
|
File* buildFilePath(char* forcename, char* path, char* ext);
|
||||||
Module *isModule() { return this; }
|
Module *isModule() { return this; }
|
||||||
|
|||||||
+17
-17
@@ -103,7 +103,7 @@ ClassDeclaration *Type::typeinfofunction;
|
|||||||
ClassDeclaration *Type::typeinfodelegate;
|
ClassDeclaration *Type::typeinfodelegate;
|
||||||
ClassDeclaration *Type::typeinfotypelist;
|
ClassDeclaration *Type::typeinfotypelist;
|
||||||
|
|
||||||
// LLVMDC
|
// LDC
|
||||||
Type* Type::topaque;
|
Type* Type::topaque;
|
||||||
|
|
||||||
Type *Type::tvoidptr;
|
Type *Type::tvoidptr;
|
||||||
@@ -210,7 +210,7 @@ void Type::init()
|
|||||||
mangleChar[Ttuple] = 'B';
|
mangleChar[Ttuple] = 'B';
|
||||||
mangleChar[Tslice] = '@';
|
mangleChar[Tslice] = '@';
|
||||||
|
|
||||||
// LLVMDC
|
// LDC
|
||||||
mangleChar[Topaque] = 'O';
|
mangleChar[Topaque] = 'O';
|
||||||
|
|
||||||
for (i = 0; i < TMAX; i++)
|
for (i = 0; i < TMAX; i++)
|
||||||
@@ -234,7 +234,7 @@ void Type::init()
|
|||||||
|
|
||||||
tvoidptr = tvoid->pointerTo();
|
tvoidptr = tvoid->pointerTo();
|
||||||
|
|
||||||
// LLVMDC
|
// LDC
|
||||||
topaque = new TypeOpaque();
|
topaque = new TypeOpaque();
|
||||||
|
|
||||||
// set size_t / ptrdiff_t types and pointer size
|
// set size_t / ptrdiff_t types and pointer size
|
||||||
@@ -726,7 +726,7 @@ Identifier *Type::getTypeInfoIdent(int internal)
|
|||||||
name = (char *)alloca(19 + sizeof(len) * 3 + len + 1);
|
name = (char *)alloca(19 + sizeof(len) * 3 + len + 1);
|
||||||
buf.writeByte(0);
|
buf.writeByte(0);
|
||||||
sprintf(name, "_D%dTypeInfo_%s6__initZ", 9 + len, buf.data);
|
sprintf(name, "_D%dTypeInfo_%s6__initZ", 9 + len, buf.data);
|
||||||
// LLVMDC
|
// LDC
|
||||||
// it is not clear where the underscore that's stripped here is added back in
|
// it is not clear where the underscore that's stripped here is added back in
|
||||||
// if (global.params.isWindows)
|
// if (global.params.isWindows)
|
||||||
// name++; // C mangling will add it back in
|
// name++; // C mangling will add it back in
|
||||||
@@ -1002,7 +1002,7 @@ unsigned TypeBasic::alignsize()
|
|||||||
|
|
||||||
switch (ty)
|
switch (ty)
|
||||||
{
|
{
|
||||||
//LLVMDC: llvm aligns 12 byte reals to 4 byte
|
//LDC: llvm aligns 12 byte reals to 4 byte
|
||||||
case Tfloat80:
|
case Tfloat80:
|
||||||
case Timaginary80:
|
case Timaginary80:
|
||||||
case Tcomplex80:
|
case Tcomplex80:
|
||||||
@@ -1010,7 +1010,7 @@ unsigned TypeBasic::alignsize()
|
|||||||
sz = 4;
|
sz = 4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//LLVMDC: llvm aligns these to 4 byte boundaries
|
//LDC: llvm aligns these to 4 byte boundaries
|
||||||
case Tint64:
|
case Tint64:
|
||||||
case Tuns64:
|
case Tuns64:
|
||||||
case Tfloat64:
|
case Tfloat64:
|
||||||
@@ -1554,7 +1554,7 @@ Expression *TypeArray::dotExp(Scope *sc, Expression *e, Identifier *ident)
|
|||||||
Expression *ec;
|
Expression *ec;
|
||||||
Expressions *arguments;
|
Expressions *arguments;
|
||||||
|
|
||||||
//LLVMDC: Build arguments.
|
//LDC: Build arguments.
|
||||||
static FuncDeclaration *adReverseChar_fd = NULL;
|
static FuncDeclaration *adReverseChar_fd = NULL;
|
||||||
if(!adReverseChar_fd) {
|
if(!adReverseChar_fd) {
|
||||||
Arguments* args = new Arguments;
|
Arguments* args = new Arguments;
|
||||||
@@ -1585,7 +1585,7 @@ Expression *TypeArray::dotExp(Scope *sc, Expression *e, Identifier *ident)
|
|||||||
Expression *ec;
|
Expression *ec;
|
||||||
Expressions *arguments;
|
Expressions *arguments;
|
||||||
|
|
||||||
//LLVMDC: Build arguments.
|
//LDC: Build arguments.
|
||||||
static FuncDeclaration *adSortChar_fd = NULL;
|
static FuncDeclaration *adSortChar_fd = NULL;
|
||||||
if(!adSortChar_fd) {
|
if(!adSortChar_fd) {
|
||||||
Arguments* args = new Arguments;
|
Arguments* args = new Arguments;
|
||||||
@@ -1620,7 +1620,7 @@ Expression *TypeArray::dotExp(Scope *sc, Expression *e, Identifier *ident)
|
|||||||
|
|
||||||
assert(size);
|
assert(size);
|
||||||
dup = (ident == Id::dup);
|
dup = (ident == Id::dup);
|
||||||
//LLVMDC: Build arguments.
|
//LDC: Build arguments.
|
||||||
static FuncDeclaration *adDup_fd = NULL;
|
static FuncDeclaration *adDup_fd = NULL;
|
||||||
if(!adDup_fd) {
|
if(!adDup_fd) {
|
||||||
Arguments* args = new Arguments;
|
Arguments* args = new Arguments;
|
||||||
@@ -1656,7 +1656,7 @@ Expression *TypeArray::dotExp(Scope *sc, Expression *e, Identifier *ident)
|
|||||||
Expressions *arguments;
|
Expressions *arguments;
|
||||||
bool isBit = (n->ty == Tbit);
|
bool isBit = (n->ty == Tbit);
|
||||||
|
|
||||||
//LLVMDC: Build arguments.
|
//LDC: Build arguments.
|
||||||
static FuncDeclaration *adSort_fd = NULL;
|
static FuncDeclaration *adSort_fd = NULL;
|
||||||
if(!adSort_fd) {
|
if(!adSort_fd) {
|
||||||
Arguments* args = new Arguments;
|
Arguments* args = new Arguments;
|
||||||
@@ -1680,7 +1680,7 @@ Expression *TypeArray::dotExp(Scope *sc, Expression *e, Identifier *ident)
|
|||||||
arguments = new Expressions();
|
arguments = new Expressions();
|
||||||
arguments->push(e);
|
arguments->push(e);
|
||||||
if (next->ty != Tbit)
|
if (next->ty != Tbit)
|
||||||
arguments->push(n->getTypeInfo(sc)); // LLVMDC, we don't support the getInternalTypeInfo
|
arguments->push(n->getTypeInfo(sc)); // LDC, we don't support the getInternalTypeInfo
|
||||||
// optimization arbitrarily, not yet at least...
|
// optimization arbitrarily, not yet at least...
|
||||||
e = new CallExp(e->loc, ec, arguments);
|
e = new CallExp(e->loc, ec, arguments);
|
||||||
e->type = next->arrayOf();
|
e->type = next->arrayOf();
|
||||||
@@ -2346,7 +2346,7 @@ Expression *TypeAArray::dotExp(Scope *sc, Expression *e, Identifier *ident)
|
|||||||
Expression *ec;
|
Expression *ec;
|
||||||
Expressions *arguments;
|
Expressions *arguments;
|
||||||
|
|
||||||
//LLVMDC: Build arguments.
|
//LDC: Build arguments.
|
||||||
static FuncDeclaration *aaLen_fd = NULL;
|
static FuncDeclaration *aaLen_fd = NULL;
|
||||||
if(!aaLen_fd) {
|
if(!aaLen_fd) {
|
||||||
Arguments* args = new Arguments;
|
Arguments* args = new Arguments;
|
||||||
@@ -2367,7 +2367,7 @@ Expression *TypeAArray::dotExp(Scope *sc, Expression *e, Identifier *ident)
|
|||||||
int size = key->size(e->loc);
|
int size = key->size(e->loc);
|
||||||
|
|
||||||
assert(size);
|
assert(size);
|
||||||
//LLVMDC: Build arguments.
|
//LDC: Build arguments.
|
||||||
static FuncDeclaration *aaKeys_fd = NULL;
|
static FuncDeclaration *aaKeys_fd = NULL;
|
||||||
if(!aaKeys_fd) {
|
if(!aaKeys_fd) {
|
||||||
Arguments* args = new Arguments;
|
Arguments* args = new Arguments;
|
||||||
@@ -2388,7 +2388,7 @@ Expression *TypeAArray::dotExp(Scope *sc, Expression *e, Identifier *ident)
|
|||||||
Expression *ec;
|
Expression *ec;
|
||||||
Expressions *arguments;
|
Expressions *arguments;
|
||||||
|
|
||||||
//LLVMDC: Build arguments.
|
//LDC: Build arguments.
|
||||||
static FuncDeclaration *aaValues_fd = NULL;
|
static FuncDeclaration *aaValues_fd = NULL;
|
||||||
if(!aaValues_fd) {
|
if(!aaValues_fd) {
|
||||||
Arguments* args = new Arguments;
|
Arguments* args = new Arguments;
|
||||||
@@ -2413,7 +2413,7 @@ Expression *TypeAArray::dotExp(Scope *sc, Expression *e, Identifier *ident)
|
|||||||
Expression *ec;
|
Expression *ec;
|
||||||
Expressions *arguments;
|
Expressions *arguments;
|
||||||
|
|
||||||
//LLVMDC: Build arguments.
|
//LDC: Build arguments.
|
||||||
static FuncDeclaration *aaRehash_fd = NULL;
|
static FuncDeclaration *aaRehash_fd = NULL;
|
||||||
if(!aaRehash_fd) {
|
if(!aaRehash_fd) {
|
||||||
Arguments* args = new Arguments;
|
Arguments* args = new Arguments;
|
||||||
@@ -4465,7 +4465,7 @@ L1:
|
|||||||
// *(&e + offset)
|
// *(&e + offset)
|
||||||
accessCheck(e->loc, sc, e, d);
|
accessCheck(e->loc, sc, e, d);
|
||||||
|
|
||||||
// LLVMDC we don't want dot exprs turned into pointer arithmetic. it complicates things for no apparent gain
|
// LDC we don't want dot exprs turned into pointer arithmetic. it complicates things for no apparent gain
|
||||||
#ifndef IN_LLVM
|
#ifndef IN_LLVM
|
||||||
b = new AddrExp(e->loc, e);
|
b = new AddrExp(e->loc, e);
|
||||||
b->type = e->type->pointerTo();
|
b->type = e->type->pointerTo();
|
||||||
@@ -4730,7 +4730,7 @@ L1:
|
|||||||
e = new PtrExp(e->loc, e, t);
|
e = new PtrExp(e->loc, e, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // !LLVMDC
|
#endif // !LDC
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-6
@@ -1598,7 +1598,7 @@ Statement *ForeachStatement::semantic(Scope *sc)
|
|||||||
/* Call:
|
/* Call:
|
||||||
* _aaApply(aggr, keysize, flde)
|
* _aaApply(aggr, keysize, flde)
|
||||||
*/
|
*/
|
||||||
//LLVMDC: Build arguments.
|
//LDC: Build arguments.
|
||||||
static FuncDeclaration *aaApply2_fd = NULL;
|
static FuncDeclaration *aaApply2_fd = NULL;
|
||||||
if(!aaApply2_fd) {
|
if(!aaApply2_fd) {
|
||||||
Arguments* args = new Arguments;
|
Arguments* args = new Arguments;
|
||||||
@@ -1667,7 +1667,7 @@ Statement *ForeachStatement::semantic(Scope *sc)
|
|||||||
const char *r = (op == TOKforeach_reverse) ? "R" : "";
|
const char *r = (op == TOKforeach_reverse) ? "R" : "";
|
||||||
int j = sprintf(fdname, "_aApply%s%.*s%d", r, 2, fntab[flag], dim);
|
int j = sprintf(fdname, "_aApply%s%.*s%d", r, 2, fntab[flag], dim);
|
||||||
assert(j < sizeof(fdname));
|
assert(j < sizeof(fdname));
|
||||||
//LLVMDC: Build arguments.
|
//LDC: Build arguments.
|
||||||
Arguments* args = new Arguments;
|
Arguments* args = new Arguments;
|
||||||
args->push(new Argument(STCin, Type::topaque->arrayOf(), NULL, NULL));
|
args->push(new Argument(STCin, Type::topaque->arrayOf(), NULL, NULL));
|
||||||
if (dim == 2) {
|
if (dim == 2) {
|
||||||
@@ -2243,7 +2243,7 @@ SwitchStatement::SwitchStatement(Loc loc, Expression *c, Statement *b)
|
|||||||
sdefault = NULL;
|
sdefault = NULL;
|
||||||
cases = NULL;
|
cases = NULL;
|
||||||
hasNoDefault = 0;
|
hasNoDefault = 0;
|
||||||
// LLVMDC
|
// LDC
|
||||||
enclosinghandler = NULL;
|
enclosinghandler = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3200,7 +3200,7 @@ SynchronizedStatement::SynchronizedStatement(Loc loc, Expression *exp, Statement
|
|||||||
this->body = body;
|
this->body = body;
|
||||||
this->esync = NULL;
|
this->esync = NULL;
|
||||||
this->enclosinghandler = NULL;
|
this->enclosinghandler = NULL;
|
||||||
// LLVMDC
|
// LDC
|
||||||
this->llsync = NULL;
|
this->llsync = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3211,7 +3211,7 @@ SynchronizedStatement::SynchronizedStatement(Loc loc, elem *esync, Statement *bo
|
|||||||
this->body = body;
|
this->body = body;
|
||||||
this->esync = esync;
|
this->esync = esync;
|
||||||
this->enclosinghandler = NULL;
|
this->enclosinghandler = NULL;
|
||||||
// LLVMDC
|
// LDC
|
||||||
this->llsync = NULL;
|
this->llsync = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3961,7 +3961,7 @@ Statement *LabelStatement::semantic(Scope *sc)
|
|||||||
statement = statement->semantic(sc);
|
statement = statement->semantic(sc);
|
||||||
sc->pop();
|
sc->pop();
|
||||||
|
|
||||||
// LLVMDC put in labmap
|
// LDC put in labmap
|
||||||
fd->labmap[ident->toChars()] = this;
|
fd->labmap[ident->toChars()] = this;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
+7
-7
@@ -94,7 +94,7 @@ enum BE
|
|||||||
BEany = (BEfallthru | BEthrow | BEreturn | BEgoto | BEhalt),
|
BEany = (BEfallthru | BEthrow | BEreturn | BEgoto | BEhalt),
|
||||||
};
|
};
|
||||||
|
|
||||||
// LLVMDC this is used for tracking try-finally, synchronized and volatile scopes
|
// LDC this is used for tracking try-finally, synchronized and volatile scopes
|
||||||
// definitions in gen/llvmhelpers.cpp
|
// definitions in gen/llvmhelpers.cpp
|
||||||
struct EnclosingHandler : Object
|
struct EnclosingHandler : Object
|
||||||
{
|
{
|
||||||
@@ -544,7 +544,7 @@ struct CaseStatement : Statement
|
|||||||
|
|
||||||
CaseStatement* isCaseStatement() { return this; }
|
CaseStatement* isCaseStatement() { return this; }
|
||||||
|
|
||||||
// LLVMDC
|
// LDC
|
||||||
llvm::BasicBlock* bodyBB;
|
llvm::BasicBlock* bodyBB;
|
||||||
llvm::ConstantInt* llvmIdx;
|
llvm::ConstantInt* llvmIdx;
|
||||||
};
|
};
|
||||||
@@ -570,7 +570,7 @@ struct DefaultStatement : Statement
|
|||||||
|
|
||||||
void toIR(IRState *irs);
|
void toIR(IRState *irs);
|
||||||
|
|
||||||
// LLVMDC
|
// LDC
|
||||||
llvm::BasicBlock* bodyBB;
|
llvm::BasicBlock* bodyBB;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -655,7 +655,7 @@ struct BreakStatement : Statement
|
|||||||
|
|
||||||
void toIR(IRState *irs);
|
void toIR(IRState *irs);
|
||||||
|
|
||||||
// LLVMDC: only set if ident is set: label statement to jump to
|
// LDC: only set if ident is set: label statement to jump to
|
||||||
LabelStatement *target;
|
LabelStatement *target;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -674,7 +674,7 @@ struct ContinueStatement : Statement
|
|||||||
|
|
||||||
void toIR(IRState *irs);
|
void toIR(IRState *irs);
|
||||||
|
|
||||||
// LLVMDC: only set if ident is set: label statement to jump to
|
// LDC: only set if ident is set: label statement to jump to
|
||||||
LabelStatement *target;
|
LabelStatement *target;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -871,7 +871,7 @@ struct LabelStatement : Statement
|
|||||||
|
|
||||||
void toIR(IRState *irs);
|
void toIR(IRState *irs);
|
||||||
|
|
||||||
// LLVMDC
|
// LDC
|
||||||
bool asmLabel; // for labels inside inline assembler
|
bool asmLabel; // for labels inside inline assembler
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -903,7 +903,7 @@ struct AsmStatement : Statement
|
|||||||
|
|
||||||
void toIR(IRState *irs);
|
void toIR(IRState *irs);
|
||||||
|
|
||||||
// LLVMDC
|
// LDC
|
||||||
// non-zero if this is a branch, contains the target labels identifier
|
// non-zero if this is a branch, contains the target labels identifier
|
||||||
Identifier* isBranchToLabel;
|
Identifier* isBranchToLabel;
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -304,7 +304,7 @@ Dsymbol *TemplateDeclaration::syntaxCopy(Dsymbol *)
|
|||||||
d = Dsymbol::arraySyntaxCopy(members);
|
d = Dsymbol::arraySyntaxCopy(members);
|
||||||
td = new TemplateDeclaration(loc, ident, p, d);
|
td = new TemplateDeclaration(loc, ident, p, d);
|
||||||
|
|
||||||
// LLVMDC
|
// LDC
|
||||||
td->intrinsicName = intrinsicName;
|
td->intrinsicName = intrinsicName;
|
||||||
|
|
||||||
return td;
|
return td;
|
||||||
|
|||||||
+2
-2
@@ -86,7 +86,7 @@ struct TemplateDeclaration : ScopeDsymbol
|
|||||||
TemplateTupleParameter *isVariadic();
|
TemplateTupleParameter *isVariadic();
|
||||||
int isOverloadable();
|
int isOverloadable();
|
||||||
|
|
||||||
// LLVMDC
|
// LDC
|
||||||
std::string intrinsicName;
|
std::string intrinsicName;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -315,7 +315,7 @@ struct TemplateInstance : ScopeDsymbol
|
|||||||
TemplateInstance *isTemplateInstance() { return this; }
|
TemplateInstance *isTemplateInstance() { return this; }
|
||||||
AliasDeclaration *isAliasDeclaration();
|
AliasDeclaration *isAliasDeclaration();
|
||||||
|
|
||||||
// LLVMDC
|
// LDC
|
||||||
TemplateInstance *tinst; // enclosing template instance
|
TemplateInstance *tinst; // enclosing template instance
|
||||||
void printInstantiationTrace();
|
void printInstantiationTrace();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#ifndef LLVMDC_GEN_AA_H
|
#ifndef LDC_GEN_AA_H
|
||||||
#define LLVMDC_GEN_AA_H
|
#define LDC_GEN_AA_H
|
||||||
|
|
||||||
DValue* DtoAAIndex(Loc& loc, Type* type, DValue* aa, DValue* key, bool lvalue);
|
DValue* DtoAAIndex(Loc& loc, Type* type, DValue* aa, DValue* key, bool lvalue);
|
||||||
DValue* DtoAAIn(Loc& loc, Type* type, DValue* aa, DValue* key);
|
DValue* DtoAAIn(Loc& loc, Type* type, DValue* aa, DValue* key);
|
||||||
void DtoAARemove(Loc& loc, DValue* aa, DValue* key);
|
void DtoAARemove(Loc& loc, DValue* aa, DValue* key);
|
||||||
|
|
||||||
#endif // LLVMDC_GEN_AA_H
|
#endif // LDC_GEN_AA_H
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
#ifndef LLVMDC_GEN_CLASSES_H
|
#ifndef LDC_GEN_CLASSES_H
|
||||||
#define LLVMDC_GEN_CLASSES_H
|
#define LDC_GEN_CLASSES_H
|
||||||
|
|
||||||
#include "gen/structs.h"
|
#include "gen/structs.h"
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
#ifndef LLVMDC_GEN_COMPLEX_H
|
#ifndef LDC_GEN_COMPLEX_H
|
||||||
#define LLVMDC_GEN_COMPLEX_H
|
#define LDC_GEN_COMPLEX_H
|
||||||
|
|
||||||
const llvm::StructType* DtoComplexType(Type* t);
|
const llvm::StructType* DtoComplexType(Type* t);
|
||||||
const LLType* DtoComplexBaseType(Type* t);
|
const LLType* DtoComplexBaseType(Type* t);
|
||||||
@@ -26,4 +26,4 @@ LLValue* DtoComplexEquals(Loc& loc, TOK op, DValue* lhs, DValue* rhs);
|
|||||||
|
|
||||||
DValue* DtoCastComplex(Loc& loc, DValue* val, Type* to);
|
DValue* DtoCastComplex(Loc& loc, DValue* val, Type* to);
|
||||||
|
|
||||||
#endif // LLVMDC_GEN_COMPLEX_H
|
#endif // LDC_GEN_COMPLEX_H
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
#ifndef LLVMDC_GEN_DVALUE_H
|
#ifndef LDC_GEN_DVALUE_H
|
||||||
#define LLVMDC_GEN_DVALUE_H
|
#define LDC_GEN_DVALUE_H
|
||||||
|
|
||||||
/*
|
/*
|
||||||
These classes are used for generating the IR. They encapsulate D values and
|
These classes are used for generating the IR. They encapsulate D values and
|
||||||
@@ -168,4 +168,4 @@ struct DLRValue : DValue
|
|||||||
virtual DLRValue* isLRValue() { return this; }
|
virtual DLRValue* isLRValue() { return this; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LLVMDC_GEN_DVALUE_H
|
#endif // LDC_GEN_DVALUE_H
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
#ifndef LLVMDC_GEN_FUNCTIONS_H
|
#ifndef LDC_GEN_FUNCTIONS_H
|
||||||
#define LLVMDC_GEN_FUNCTIONS_H
|
#define LDC_GEN_FUNCTIONS_H
|
||||||
|
|
||||||
const llvm::FunctionType* DtoFunctionType(Type* t, const LLType* thistype, const LLType* nesttype, bool ismain = false);
|
const llvm::FunctionType* DtoFunctionType(Type* t, const LLType* thistype, const LLType* nesttype, bool ismain = false);
|
||||||
const llvm::FunctionType* DtoFunctionType(FuncDeclaration* fdecl);
|
const llvm::FunctionType* DtoFunctionType(FuncDeclaration* fdecl);
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
#ifndef LLVMDC_GEN_IRSTATE_H
|
#ifndef LDC_GEN_IRSTATE_H
|
||||||
#define LLVMDC_GEN_IRSTATE_H
|
#define LDC_GEN_IRSTATE_H
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <list>
|
#include <list>
|
||||||
@@ -234,4 +234,4 @@ CallOrInvoke* IRState::CreateCallOrInvoke(LLValue* Callee, InputIterator ArgBegi
|
|||||||
return new CallOrInvoke_Call(ir->CreateCall(Callee, ArgBegin, ArgEnd, Name));
|
return new CallOrInvoke_Call(ir->CreateCall(Callee, ArgBegin, ArgEnd, Name));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // LLVMDC_GEN_IRSTATE_H
|
#endif // LDC_GEN_IRSTATE_H
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
#ifndef LLVMDC_GEN_LINKER_H
|
#ifndef LDC_GEN_LINKER_H
|
||||||
#define LLVMDC_GEN_LINKER_H
|
#define LDC_GEN_LINKER_H
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@@ -33,4 +33,4 @@ void deleteExecutable();
|
|||||||
*/
|
*/
|
||||||
int runExectuable();
|
int runExectuable();
|
||||||
|
|
||||||
#endif // LLVMDC_GEN_LINKER_H
|
#endif // LDC_GEN_LINKER_H
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
#ifndef LLVMDC_GEN_LLVMHELPERS_H
|
#ifndef LDC_GEN_LLVMHELPERS_H
|
||||||
#define LLVMDC_GEN_LLVMHELPERS_H
|
#define LDC_GEN_LLVMHELPERS_H
|
||||||
|
|
||||||
#include "gen/llvm.h"
|
#include "gen/llvm.h"
|
||||||
#include "statement.h"
|
#include "statement.h"
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
#ifndef LLVMDC_GEN_TODEBUG_H
|
#ifndef LDC_GEN_TODEBUG_H
|
||||||
#define LLVMDC_GEN_TODEBUG_H
|
#define LDC_GEN_TODEBUG_H
|
||||||
|
|
||||||
void RegisterDwarfSymbols(llvm::Module* mod);
|
void RegisterDwarfSymbols(llvm::Module* mod);
|
||||||
|
|
||||||
@@ -37,6 +37,6 @@ void DtoDwarfLocalVariable(LLValue* ll, VarDeclaration* vd);
|
|||||||
*/
|
*/
|
||||||
LLGlobalVariable* DtoDwarfGlobalVariable(LLGlobalVariable* ll, VarDeclaration* vd);
|
LLGlobalVariable* DtoDwarfGlobalVariable(LLGlobalVariable* ll, VarDeclaration* vd);
|
||||||
|
|
||||||
#endif // LLVMDC_GEN_TODEBUG_H
|
#endif // LDC_GEN_TODEBUG_H
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
#ifndef LLVMDC_GEN_TOLLVM_H
|
#ifndef LDC_GEN_TOLLVM_H
|
||||||
#define LLVMDC_GEN_TOLLVM_H
|
#define LDC_GEN_TOLLVM_H
|
||||||
|
|
||||||
#include "gen/llvm.h"
|
#include "gen/llvm.h"
|
||||||
#include "lexer.h"
|
#include "lexer.h"
|
||||||
@@ -144,4 +144,4 @@ void DtoMemoryBarrier(bool ll, bool ls, bool sl, bool ss, bool device=false);
|
|||||||
|
|
||||||
#include "enums.h"
|
#include "enums.h"
|
||||||
|
|
||||||
#endif // LLVMDC_GEN_TOLLVM_H
|
#endif // LDC_GEN_TOLLVM_H
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
#ifndef LLVMDC_GEN_TYPEINF_H
|
#ifndef LDC_GEN_TYPEINF_H
|
||||||
#define LLVMDC_GEN_TYPEINF_H
|
#define LDC_GEN_TYPEINF_H
|
||||||
|
|
||||||
void DtoResolveTypeInfo(TypeInfoDeclaration* tid);
|
void DtoResolveTypeInfo(TypeInfoDeclaration* tid);
|
||||||
void DtoDeclareTypeInfo(TypeInfoDeclaration* tid);
|
void DtoDeclareTypeInfo(TypeInfoDeclaration* tid);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// this head contains stuff used by all the IR
|
// this head contains stuff used by all the IR
|
||||||
|
|
||||||
#ifndef LLVMDC_IR_IR_H
|
#ifndef LDC_IR_IR_H
|
||||||
#define LLVMDC_IR_IR_H
|
#define LDC_IR_IR_H
|
||||||
|
|
||||||
#include "ir/irforw.h"
|
#include "ir/irforw.h"
|
||||||
#include "root.h"
|
#include "root.h"
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
#ifndef LLVMDC_IR_IRFORW_H
|
#ifndef LDC_IR_IRFORW_H
|
||||||
#define LLVMDC_IR_IRFORW_H
|
#define LDC_IR_IRFORW_H
|
||||||
|
|
||||||
// dmd forward declarations
|
// dmd forward declarations
|
||||||
struct Module;
|
struct Module;
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
#ifndef LLVMDC_IR_IRFUNCTION_H
|
#ifndef LDC_IR_IRFUNCTION_H
|
||||||
#define LLVMDC_IR_IRFUNCTION_H
|
#define LDC_IR_IRFUNCTION_H
|
||||||
|
|
||||||
#include "ir/ir.h"
|
#include "ir/ir.h"
|
||||||
#include "ir/irlandingpad.h"
|
#include "ir/irlandingpad.h"
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
#ifndef LLVMDC_IR_IRLANDINGPADINFO_H
|
#ifndef LDC_IR_IRLANDINGPADINFO_H
|
||||||
#define LLVMDC_IR_IRLANDINGPADINFO_H
|
#define LDC_IR_IRLANDINGPADINFO_H
|
||||||
|
|
||||||
#include "ir/ir.h"
|
#include "ir/ir.h"
|
||||||
#include "statement.h"
|
#include "statement.h"
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
#ifndef LLVMDC_IR_IRMODULE_H
|
#ifndef LDC_IR_IRMODULE_H
|
||||||
#define LLVMDC_IR_IRMODULE_H
|
#define LDC_IR_IRMODULE_H
|
||||||
|
|
||||||
#include "ir/ir.h"
|
#include "ir/ir.h"
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
#ifndef LLVMDC_IR_IRSTRUCT_H
|
#ifndef LDC_IR_IRSTRUCT_H
|
||||||
#define LLVMDC_IR_IRSTRUCT_H
|
#define LDC_IR_IRSTRUCT_H
|
||||||
|
|
||||||
#include "ir/ir.h"
|
#include "ir/ir.h"
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
#ifndef LLVMDC_IR_IRSYMBOL_H
|
#ifndef LDC_IR_IRSYMBOL_H
|
||||||
#define LLVMDC_IR_IRSYMBOL_H
|
#define LDC_IR_IRSYMBOL_H
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
#ifndef LLVMDC_IR_IRTYPE_H
|
#ifndef LDC_IR_IRTYPE_H
|
||||||
#define LLVMDC_IR_IRTYPE_H
|
#define LDC_IR_IRTYPE_H
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
#ifndef LLVMDC_IR_IRVAR_H
|
#ifndef LDC_IR_IRVAR_H
|
||||||
#define LLVMDC_IR_IRVAR_H
|
#define LDC_IR_IRVAR_H
|
||||||
|
|
||||||
#include "ir/ir.h"
|
#include "ir/ir.h"
|
||||||
#include "llvm/Type.h"
|
#include "llvm/Type.h"
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Modified for LLVMDC by Tomas Lindquist Olsen.
|
* Modified for LDC by Tomas Lindquist Olsen.
|
||||||
* The DMD implementation wont quite work due to the differences in how
|
* The DMD implementation wont quite work due to the differences in how
|
||||||
* structs are handled.
|
* structs are handled.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This copy is modified to work with LLVMDC
|
* This copy is modified to work with LDC
|
||||||
* by Tomas Lindquist Olsen, September 2007
|
* by Tomas Lindquist Olsen, September 2007
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2004-2006 by Digital Mars, www.digitalmars.com
|
* Copyright (C) 2004-2006 by Digital Mars, www.digitalmars.com
|
||||||
* Written by Walter Bright
|
* Written by Walter Bright
|
||||||
* Modified for LLVMDC by Tomas Lindquist Olsen
|
* Modified for LDC by Tomas Lindquist Olsen
|
||||||
*
|
*
|
||||||
* This software is provided 'as-is', without any express or implied
|
* This software is provided 'as-is', without any express or implied
|
||||||
* warranty. In no event will the authors be held liable for any damages
|
* warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
/* NOTE: This file has been patched from the original DMD distribution to
|
/* NOTE: This file has been patched from the original DMD distribution to
|
||||||
work with the GDC compiler.
|
work with the GDC compiler.
|
||||||
NOTE: This file has been patched from the original GDC distribution to
|
NOTE: This file has been patched from the original GDC distribution to
|
||||||
work with the LLVMDC compiler.
|
work with the LDC compiler.
|
||||||
|
|
||||||
Modified by David Friedman, May 2006
|
Modified by David Friedman, May 2006
|
||||||
Modified by Tomas Lindquist Olsen, August 2007
|
Modified by Tomas Lindquist Olsen, August 2007
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Modified for LLVMDC
|
// Modified for LDC
|
||||||
|
|
||||||
module std.moduleinit;
|
module std.moduleinit;
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
/* This is for use with variable argument lists with extern(D) linkage. */
|
/* This is for use with variable argument lists with extern(D) linkage. */
|
||||||
|
|
||||||
/* Modified for LLVMDC (LLVM D Compiler) by Tomas Lindquist Olsen, 2007 */
|
/* Modified for LDC (LLVM D Compiler) by Tomas Lindquist Olsen, 2007 */
|
||||||
|
|
||||||
module std.stdarg;
|
module std.stdarg;
|
||||||
|
|
||||||
|
|||||||
@@ -119,7 +119,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
NOTE: This file has been patched from the original DMD distribution to
|
NOTE: This file has been patched from the original DMD distribution to
|
||||||
work with the LLVMDC compiler.
|
work with the LDC compiler.
|
||||||
|
|
||||||
Modified by Tomas Lindquist Olsen, August 2007
|
Modified by Tomas Lindquist Olsen, August 2007
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Modified by Sean Kelly <sean@f4.ca> for use with Tango.
|
* Modified by Sean Kelly <sean@f4.ca> for use with Tango.
|
||||||
* Modified by Tomas Lindquist Olsen <tomas@famolsen.dk> for use with LLVMDC.
|
* Modified by Tomas Lindquist Olsen <tomas@famolsen.dk> for use with LDC.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private
|
private
|
||||||
@@ -90,7 +90,7 @@ struct BB
|
|||||||
* it is completely opaque.
|
* it is completely opaque.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// LLVMDC doesn't pass structs in registers so no need to wrap it ...
|
// LDC doesn't pass structs in registers so no need to wrap it ...
|
||||||
alias BB* AA;
|
alias BB* AA;
|
||||||
|
|
||||||
/**********************************
|
/**********************************
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Modified by Sean Kelly <sean@f4.ca> for use with Tango.
|
* Modified by Sean Kelly <sean@f4.ca> for use with Tango.
|
||||||
* Modified by Tomas Lindquist Olsen <tomas@famolsen.dk> for use with LLVMDC.
|
* Modified by Tomas Lindquist Olsen <tomas@famolsen.dk> for use with LDC.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module object;
|
module object;
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ private
|
|||||||
import tango.stdc.posix.dlfcn;
|
import tango.stdc.posix.dlfcn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
version(LLVMDC)
|
version(LDC)
|
||||||
{
|
{
|
||||||
pragma(intrinsic, "llvm.frameaddress")
|
pragma(intrinsic, "llvm.frameaddress")
|
||||||
{
|
{
|
||||||
@@ -122,7 +122,7 @@ extern (C) void* rt_stackBottom()
|
|||||||
*/
|
*/
|
||||||
extern (C) void* rt_stackTop()
|
extern (C) void* rt_stackTop()
|
||||||
{
|
{
|
||||||
version(LLVMDC)
|
version(LDC)
|
||||||
{
|
{
|
||||||
return llvm_frameaddress();
|
return llvm_frameaddress();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ import tango.io.Console;
|
|||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
Cout("Hi, says LLVMDC + Tango").newline;
|
Cout("Hi, says LDC + Tango").newline;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user