mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Some missed LLVMDC -> LDC.
This commit is contained in:
6
LICENSE
6
LICENSE
@@ -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 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" --
|
||||
Copyright (c) 2007-2008 LLVMDC Team.
|
||||
Copyright (c) 2007-2008 LDC Team.
|
||||
All rights reserved.
|
||||
|
||||
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
|
||||
list of conditions and the following disclaimer in the documentation and/or
|
||||
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
|
||||
prior written permission.
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ int atoi(char[] s) {
|
||||
return !neg ? i : -i;
|
||||
}
|
||||
|
||||
version(LLVMDC)
|
||||
version(LDC)
|
||||
{
|
||||
pragma(intrinsic, "llvm.sqrt.f64")
|
||||
double sqrt(double val);
|
||||
|
||||
@@ -308,7 +308,7 @@ Expression *BinExp::arrayOp(Scope *sc)
|
||||
else
|
||||
{ /* In library, refer to it.
|
||||
*/
|
||||
// LLVMDC FIXME
|
||||
// LDC FIXME
|
||||
fd = FuncDeclaration::genCfunc(NULL, type, name);
|
||||
}
|
||||
sv->ptrvalue = fd; // cache symbol in hash table
|
||||
|
||||
@@ -1183,7 +1183,7 @@ Expression *BinExp::scaleFactor(Scope *sc)
|
||||
stride = t1b->nextOf()->size(loc);
|
||||
if (!t->equals(t2b))
|
||||
e2 = e2->castTo(sc, t);
|
||||
// LLVMDC: llvm uses typesafe pointer arithmetic
|
||||
// LDC: llvm uses typesafe pointer arithmetic
|
||||
#if !IN_LLVM
|
||||
if (t1b->next->isbit())
|
||||
// BUG: should add runtime check for misaligned offsets
|
||||
|
||||
@@ -127,7 +127,7 @@ void VersionCondition::checkPredefined(Loc loc, char *ident)
|
||||
{
|
||||
static char* reserved[] =
|
||||
{
|
||||
"DigitalMars", "LLVM", "LLVMDC", "LLVM64",
|
||||
"DigitalMars", "LLVM", "LDC", "LLVM64",
|
||||
"X86", "X86_64", "PPC", "PPC64",
|
||||
"Windows", "Win32", "Win64",
|
||||
"linux", "darwin", "Posix",
|
||||
|
||||
@@ -267,7 +267,7 @@ Expression *getRightThis(Loc loc, Scope *sc, AggregateDeclaration *ad,
|
||||
//printf("rewriting e1 to %s's this\n", f->toChars());
|
||||
n++;
|
||||
|
||||
// LLVMDC seems dmd misses it sometimes here :/
|
||||
// LDC seems dmd misses it sometimes here :/
|
||||
f->vthis->nestedref = 1;
|
||||
|
||||
e1 = new VarExp(loc, f->vthis);
|
||||
@@ -3756,7 +3756,7 @@ Expression *VarExp::semantic(Scope *sc)
|
||||
#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
|
||||
accessCheck(loc, sc, NULL, var);
|
||||
|
||||
@@ -5555,7 +5555,7 @@ Expression *DelegateExp::semantic(Scope *sc)
|
||||
if (!type)
|
||||
{
|
||||
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 = type->semantic(loc, sc);
|
||||
AggregateDeclaration *ad = func->toParent()->isAggregateDeclaration();
|
||||
@@ -6223,7 +6223,7 @@ Expression *AddrExp::semantic(Scope *sc)
|
||||
FuncDeclaration *f = dve->var->isFuncDeclaration();
|
||||
VarDeclaration *v = dve->var->isVarDeclaration();
|
||||
|
||||
// LLVMDC
|
||||
// LDC
|
||||
if (f && f->isIntrinsic())
|
||||
{
|
||||
error("cannot take the address of intrinsic function %s", e1->toChars());
|
||||
@@ -7843,7 +7843,7 @@ Expression *ShlAssignExp::semantic(Scope *sc)
|
||||
e1->checkIntegral();
|
||||
e2 = e2->checkIntegral();
|
||||
//e2 = e2->castTo(sc, Type::tshiftcnt);
|
||||
e2 = e2->castTo(sc, e1->type); // LLVMDC
|
||||
e2 = e2->castTo(sc, e1->type); // LDC
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -7872,7 +7872,7 @@ Expression *ShrAssignExp::semantic(Scope *sc)
|
||||
e1->checkIntegral();
|
||||
e2 = e2->checkIntegral();
|
||||
//e2 = e2->castTo(sc, Type::tshiftcnt);
|
||||
e2 = e2->castTo(sc, e1->type); // LLVMDC
|
||||
e2 = e2->castTo(sc, e1->type); // LDC
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -7901,7 +7901,7 @@ Expression *UshrAssignExp::semantic(Scope *sc)
|
||||
e1->checkIntegral();
|
||||
e2 = e2->checkIntegral();
|
||||
//e2 = e2->castTo(sc, Type::tshiftcnt);
|
||||
e2 = e2->castTo(sc, e1->type); // LLVMDC
|
||||
e2 = e2->castTo(sc, e1->type); // LDC
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -8389,7 +8389,7 @@ Expression *ShlExp::semantic(Scope *sc)
|
||||
e2 = e2->checkIntegral();
|
||||
e1 = e1->integralPromotions(sc);
|
||||
//e2 = e2->castTo(sc, Type::tshiftcnt);
|
||||
e2 = e2->castTo(sc, e1->type); // LLVMDC
|
||||
e2 = e2->castTo(sc, e1->type); // LDC
|
||||
type = e1->type;
|
||||
}
|
||||
return this;
|
||||
@@ -8414,7 +8414,7 @@ Expression *ShrExp::semantic(Scope *sc)
|
||||
e2 = e2->checkIntegral();
|
||||
e1 = e1->integralPromotions(sc);
|
||||
//e2 = e2->castTo(sc, Type::tshiftcnt);
|
||||
e2 = e2->castTo(sc, e1->type); // LLVMDC
|
||||
e2 = e2->castTo(sc, e1->type); // LDC
|
||||
type = e1->type;
|
||||
}
|
||||
return this;
|
||||
@@ -8439,7 +8439,7 @@ Expression *UshrExp::semantic(Scope *sc)
|
||||
e2 = e2->checkIntegral();
|
||||
e1 = e1->integralPromotions(sc);
|
||||
//e2 = e2->castTo(sc, Type::tshiftcnt);
|
||||
e2 = e2->castTo(sc, e1->type); // LLVMDC
|
||||
e2 = e2->castTo(sc, e1->type); // LDC
|
||||
type = e1->type;
|
||||
}
|
||||
return this;
|
||||
@@ -9092,7 +9092,7 @@ void CondExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
|
||||
|
||||
#if IN_LLVM
|
||||
|
||||
// Strictly LLVMDC specific stuff
|
||||
// Strictly LDC specific stuff
|
||||
|
||||
GEPExp::GEPExp(Loc loc, Expression* e, Identifier* id, unsigned idx)
|
||||
: UnaExp(loc, TOKgep, sizeof(GEPExp), e)
|
||||
|
||||
@@ -158,7 +158,7 @@ struct Expression : Object
|
||||
// Back end
|
||||
virtual elem *toElem(IRState *irs);
|
||||
virtual dt_t **toDt(dt_t **pdt);
|
||||
// LLVMDC
|
||||
// LDC
|
||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||
};
|
||||
|
||||
@@ -185,7 +185,7 @@ struct IntegerExp : Expression
|
||||
Expression *toLvalue(Scope *sc, Expression *e);
|
||||
elem *toElem(IRState *irs);
|
||||
dt_t **toDt(dt_t **pdt);
|
||||
// LLVMDC
|
||||
// LDC
|
||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||
};
|
||||
|
||||
@@ -210,7 +210,7 @@ struct RealExp : Expression
|
||||
void toMangleBuffer(OutBuffer *buf);
|
||||
elem *toElem(IRState *irs);
|
||||
dt_t **toDt(dt_t **pdt);
|
||||
// LLVMDC
|
||||
// LDC
|
||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||
};
|
||||
|
||||
@@ -238,7 +238,7 @@ struct ComplexExp : Expression
|
||||
#endif
|
||||
elem *toElem(IRState *irs);
|
||||
dt_t **toDt(dt_t **pdt);
|
||||
// LLVMDC
|
||||
// LDC
|
||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||
};
|
||||
|
||||
@@ -317,7 +317,7 @@ struct NullExp : Expression
|
||||
Expression *interpret(InterState *istate);
|
||||
elem *toElem(IRState *irs);
|
||||
dt_t **toDt(dt_t **pdt);
|
||||
// LLVMDC
|
||||
// LDC
|
||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||
};
|
||||
|
||||
@@ -347,7 +347,7 @@ struct StringExp : Expression
|
||||
void toMangleBuffer(OutBuffer *buf);
|
||||
elem *toElem(IRState *irs);
|
||||
dt_t **toDt(dt_t **pdt);
|
||||
// LLVMDC
|
||||
// LDC
|
||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||
};
|
||||
|
||||
@@ -400,7 +400,7 @@ struct ArrayLiteralExp : Expression
|
||||
int inlineCost(InlineCostState *ics);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
Expression *inlineScan(InlineScanState *iss);
|
||||
// LLVMDC
|
||||
// LDC
|
||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||
};
|
||||
|
||||
@@ -427,7 +427,7 @@ struct AssocArrayLiteralExp : Expression
|
||||
int inlineCost(InlineCostState *ics);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
Expression *inlineScan(InlineScanState *iss);
|
||||
// LLVMDC
|
||||
// LDC
|
||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||
};
|
||||
|
||||
@@ -460,7 +460,7 @@ struct StructLiteralExp : Expression
|
||||
int inlineCost(InlineCostState *ics);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
Expression *inlineScan(InlineScanState *iss);
|
||||
// LLVMDC
|
||||
// LDC
|
||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||
};
|
||||
|
||||
@@ -594,7 +594,7 @@ struct VarExp : Expression
|
||||
int inlineCost(InlineCostState *ics);
|
||||
Expression *doInline(InlineDoState *ids);
|
||||
//Expression *inlineScan(InlineScanState *iss);
|
||||
// LLVMDC
|
||||
// LDC
|
||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||
};
|
||||
|
||||
@@ -826,7 +826,7 @@ struct DotVarExp : UnaExp
|
||||
void dump(int indent);
|
||||
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
|
||||
Expression *optimize(int result);
|
||||
Expression *interpret(InterState *istate);
|
||||
@@ -901,7 +901,7 @@ struct AddrExp : UnaExp
|
||||
MATCH implicitConvTo(Type *t);
|
||||
Expression *castTo(Scope *sc, Type *t);
|
||||
Expression *optimize(int result);
|
||||
// LLVMDC
|
||||
// LDC
|
||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||
};
|
||||
|
||||
@@ -1004,7 +1004,7 @@ struct CastExp : UnaExp
|
||||
// For operator overloading
|
||||
Identifier *opId();
|
||||
|
||||
// LLVMDC
|
||||
// LDC
|
||||
virtual llvm::Constant *toConstElem(IRState *irs);
|
||||
};
|
||||
|
||||
@@ -1501,7 +1501,7 @@ struct LineInitExp : DefaultInitExp
|
||||
|
||||
#if IN_LLVM
|
||||
|
||||
// this stuff is strictly LLVMDC
|
||||
// this stuff is strictly LDC
|
||||
|
||||
struct GEPExp : UnaExp
|
||||
{
|
||||
|
||||
@@ -94,7 +94,7 @@ Dsymbol *FuncDeclaration::syntaxCopy(Dsymbol *s)
|
||||
f->fbody = fbody ? fbody->syntaxCopy() : NULL;
|
||||
assert(!fthrows); // deprecated
|
||||
|
||||
// LLVMDC
|
||||
// LDC
|
||||
f->intrinsicName = intrinsicName;
|
||||
|
||||
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)
|
||||
|
||||
@@ -702,7 +702,7 @@ void Lexer::scan(Token *t)
|
||||
}
|
||||
else if (id == Id::VENDOR)
|
||||
{
|
||||
t->ustring = (unsigned char *)"LLVMDC";
|
||||
t->ustring = (unsigned char *)"LDC";
|
||||
goto Lstring;
|
||||
}
|
||||
else if (id == Id::TIMESTAMP)
|
||||
|
||||
@@ -161,7 +161,7 @@ enum TOK
|
||||
TOKshared,
|
||||
#endif
|
||||
|
||||
// LLVMDC specific
|
||||
// LDC specific
|
||||
#if IN_LLVM
|
||||
TOKgep,
|
||||
#endif
|
||||
|
||||
@@ -122,7 +122,7 @@ Module::Module(char *filename, Identifier *ident, int doDocComment, int doHdrGen
|
||||
}
|
||||
srcfile = new File(srcfilename);
|
||||
|
||||
// LLVMDC
|
||||
// LDC
|
||||
llvmForceLogging = false;
|
||||
this->doDocComment = doDocComment;
|
||||
this->doHdrGen = doHdrGen;
|
||||
|
||||
@@ -169,7 +169,7 @@ struct Module : Package
|
||||
Symbol *toSymbol();
|
||||
void genmoduleinfo();
|
||||
|
||||
// LLVMDC
|
||||
// LDC
|
||||
void buildTargetFiles();
|
||||
File* buildFilePath(char* forcename, char* path, char* ext);
|
||||
Module *isModule() { return this; }
|
||||
|
||||
34
dmd/mtype.c
34
dmd/mtype.c
@@ -103,7 +103,7 @@ ClassDeclaration *Type::typeinfofunction;
|
||||
ClassDeclaration *Type::typeinfodelegate;
|
||||
ClassDeclaration *Type::typeinfotypelist;
|
||||
|
||||
// LLVMDC
|
||||
// LDC
|
||||
Type* Type::topaque;
|
||||
|
||||
Type *Type::tvoidptr;
|
||||
@@ -210,7 +210,7 @@ void Type::init()
|
||||
mangleChar[Ttuple] = 'B';
|
||||
mangleChar[Tslice] = '@';
|
||||
|
||||
// LLVMDC
|
||||
// LDC
|
||||
mangleChar[Topaque] = 'O';
|
||||
|
||||
for (i = 0; i < TMAX; i++)
|
||||
@@ -234,7 +234,7 @@ void Type::init()
|
||||
|
||||
tvoidptr = tvoid->pointerTo();
|
||||
|
||||
// LLVMDC
|
||||
// LDC
|
||||
topaque = new TypeOpaque();
|
||||
|
||||
// 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);
|
||||
buf.writeByte(0);
|
||||
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
|
||||
// if (global.params.isWindows)
|
||||
// name++; // C mangling will add it back in
|
||||
@@ -1002,7 +1002,7 @@ unsigned TypeBasic::alignsize()
|
||||
|
||||
switch (ty)
|
||||
{
|
||||
//LLVMDC: llvm aligns 12 byte reals to 4 byte
|
||||
//LDC: llvm aligns 12 byte reals to 4 byte
|
||||
case Tfloat80:
|
||||
case Timaginary80:
|
||||
case Tcomplex80:
|
||||
@@ -1010,7 +1010,7 @@ unsigned TypeBasic::alignsize()
|
||||
sz = 4;
|
||||
break;
|
||||
|
||||
//LLVMDC: llvm aligns these to 4 byte boundaries
|
||||
//LDC: llvm aligns these to 4 byte boundaries
|
||||
case Tint64:
|
||||
case Tuns64:
|
||||
case Tfloat64:
|
||||
@@ -1554,7 +1554,7 @@ Expression *TypeArray::dotExp(Scope *sc, Expression *e, Identifier *ident)
|
||||
Expression *ec;
|
||||
Expressions *arguments;
|
||||
|
||||
//LLVMDC: Build arguments.
|
||||
//LDC: Build arguments.
|
||||
static FuncDeclaration *adReverseChar_fd = NULL;
|
||||
if(!adReverseChar_fd) {
|
||||
Arguments* args = new Arguments;
|
||||
@@ -1585,7 +1585,7 @@ Expression *TypeArray::dotExp(Scope *sc, Expression *e, Identifier *ident)
|
||||
Expression *ec;
|
||||
Expressions *arguments;
|
||||
|
||||
//LLVMDC: Build arguments.
|
||||
//LDC: Build arguments.
|
||||
static FuncDeclaration *adSortChar_fd = NULL;
|
||||
if(!adSortChar_fd) {
|
||||
Arguments* args = new Arguments;
|
||||
@@ -1620,7 +1620,7 @@ Expression *TypeArray::dotExp(Scope *sc, Expression *e, Identifier *ident)
|
||||
|
||||
assert(size);
|
||||
dup = (ident == Id::dup);
|
||||
//LLVMDC: Build arguments.
|
||||
//LDC: Build arguments.
|
||||
static FuncDeclaration *adDup_fd = NULL;
|
||||
if(!adDup_fd) {
|
||||
Arguments* args = new Arguments;
|
||||
@@ -1656,7 +1656,7 @@ Expression *TypeArray::dotExp(Scope *sc, Expression *e, Identifier *ident)
|
||||
Expressions *arguments;
|
||||
bool isBit = (n->ty == Tbit);
|
||||
|
||||
//LLVMDC: Build arguments.
|
||||
//LDC: Build arguments.
|
||||
static FuncDeclaration *adSort_fd = NULL;
|
||||
if(!adSort_fd) {
|
||||
Arguments* args = new Arguments;
|
||||
@@ -1680,7 +1680,7 @@ Expression *TypeArray::dotExp(Scope *sc, Expression *e, Identifier *ident)
|
||||
arguments = new Expressions();
|
||||
arguments->push(e);
|
||||
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...
|
||||
e = new CallExp(e->loc, ec, arguments);
|
||||
e->type = next->arrayOf();
|
||||
@@ -2346,7 +2346,7 @@ Expression *TypeAArray::dotExp(Scope *sc, Expression *e, Identifier *ident)
|
||||
Expression *ec;
|
||||
Expressions *arguments;
|
||||
|
||||
//LLVMDC: Build arguments.
|
||||
//LDC: Build arguments.
|
||||
static FuncDeclaration *aaLen_fd = NULL;
|
||||
if(!aaLen_fd) {
|
||||
Arguments* args = new Arguments;
|
||||
@@ -2367,7 +2367,7 @@ Expression *TypeAArray::dotExp(Scope *sc, Expression *e, Identifier *ident)
|
||||
int size = key->size(e->loc);
|
||||
|
||||
assert(size);
|
||||
//LLVMDC: Build arguments.
|
||||
//LDC: Build arguments.
|
||||
static FuncDeclaration *aaKeys_fd = NULL;
|
||||
if(!aaKeys_fd) {
|
||||
Arguments* args = new Arguments;
|
||||
@@ -2388,7 +2388,7 @@ Expression *TypeAArray::dotExp(Scope *sc, Expression *e, Identifier *ident)
|
||||
Expression *ec;
|
||||
Expressions *arguments;
|
||||
|
||||
//LLVMDC: Build arguments.
|
||||
//LDC: Build arguments.
|
||||
static FuncDeclaration *aaValues_fd = NULL;
|
||||
if(!aaValues_fd) {
|
||||
Arguments* args = new Arguments;
|
||||
@@ -2413,7 +2413,7 @@ Expression *TypeAArray::dotExp(Scope *sc, Expression *e, Identifier *ident)
|
||||
Expression *ec;
|
||||
Expressions *arguments;
|
||||
|
||||
//LLVMDC: Build arguments.
|
||||
//LDC: Build arguments.
|
||||
static FuncDeclaration *aaRehash_fd = NULL;
|
||||
if(!aaRehash_fd) {
|
||||
Arguments* args = new Arguments;
|
||||
@@ -4465,7 +4465,7 @@ L1:
|
||||
// *(&e + offset)
|
||||
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
|
||||
b = new AddrExp(e->loc, e);
|
||||
b->type = e->type->pointerTo();
|
||||
@@ -4730,7 +4730,7 @@ L1:
|
||||
e = new PtrExp(e->loc, e, t);
|
||||
}
|
||||
|
||||
#endif // !LLVMDC
|
||||
#endif // !LDC
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
@@ -1598,7 +1598,7 @@ Statement *ForeachStatement::semantic(Scope *sc)
|
||||
/* Call:
|
||||
* _aaApply(aggr, keysize, flde)
|
||||
*/
|
||||
//LLVMDC: Build arguments.
|
||||
//LDC: Build arguments.
|
||||
static FuncDeclaration *aaApply2_fd = NULL;
|
||||
if(!aaApply2_fd) {
|
||||
Arguments* args = new Arguments;
|
||||
@@ -1667,7 +1667,7 @@ Statement *ForeachStatement::semantic(Scope *sc)
|
||||
const char *r = (op == TOKforeach_reverse) ? "R" : "";
|
||||
int j = sprintf(fdname, "_aApply%s%.*s%d", r, 2, fntab[flag], dim);
|
||||
assert(j < sizeof(fdname));
|
||||
//LLVMDC: Build arguments.
|
||||
//LDC: Build arguments.
|
||||
Arguments* args = new Arguments;
|
||||
args->push(new Argument(STCin, Type::topaque->arrayOf(), NULL, NULL));
|
||||
if (dim == 2) {
|
||||
@@ -2243,7 +2243,7 @@ SwitchStatement::SwitchStatement(Loc loc, Expression *c, Statement *b)
|
||||
sdefault = NULL;
|
||||
cases = NULL;
|
||||
hasNoDefault = 0;
|
||||
// LLVMDC
|
||||
// LDC
|
||||
enclosinghandler = NULL;
|
||||
}
|
||||
|
||||
@@ -3200,7 +3200,7 @@ SynchronizedStatement::SynchronizedStatement(Loc loc, Expression *exp, Statement
|
||||
this->body = body;
|
||||
this->esync = NULL;
|
||||
this->enclosinghandler = NULL;
|
||||
// LLVMDC
|
||||
// LDC
|
||||
this->llsync = NULL;
|
||||
}
|
||||
|
||||
@@ -3211,7 +3211,7 @@ SynchronizedStatement::SynchronizedStatement(Loc loc, elem *esync, Statement *bo
|
||||
this->body = body;
|
||||
this->esync = esync;
|
||||
this->enclosinghandler = NULL;
|
||||
// LLVMDC
|
||||
// LDC
|
||||
this->llsync = NULL;
|
||||
}
|
||||
|
||||
@@ -3961,7 +3961,7 @@ Statement *LabelStatement::semantic(Scope *sc)
|
||||
statement = statement->semantic(sc);
|
||||
sc->pop();
|
||||
|
||||
// LLVMDC put in labmap
|
||||
// LDC put in labmap
|
||||
fd->labmap[ident->toChars()] = this;
|
||||
|
||||
return this;
|
||||
|
||||
@@ -94,7 +94,7 @@ enum BE
|
||||
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
|
||||
struct EnclosingHandler : Object
|
||||
{
|
||||
@@ -544,7 +544,7 @@ struct CaseStatement : Statement
|
||||
|
||||
CaseStatement* isCaseStatement() { return this; }
|
||||
|
||||
// LLVMDC
|
||||
// LDC
|
||||
llvm::BasicBlock* bodyBB;
|
||||
llvm::ConstantInt* llvmIdx;
|
||||
};
|
||||
@@ -570,7 +570,7 @@ struct DefaultStatement : Statement
|
||||
|
||||
void toIR(IRState *irs);
|
||||
|
||||
// LLVMDC
|
||||
// LDC
|
||||
llvm::BasicBlock* bodyBB;
|
||||
};
|
||||
|
||||
@@ -655,7 +655,7 @@ struct BreakStatement : Statement
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
@@ -674,7 +674,7 @@ struct ContinueStatement : Statement
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
@@ -871,7 +871,7 @@ struct LabelStatement : Statement
|
||||
|
||||
void toIR(IRState *irs);
|
||||
|
||||
// LLVMDC
|
||||
// LDC
|
||||
bool asmLabel; // for labels inside inline assembler
|
||||
};
|
||||
|
||||
@@ -903,7 +903,7 @@ struct AsmStatement : Statement
|
||||
|
||||
void toIR(IRState *irs);
|
||||
|
||||
// LLVMDC
|
||||
// LDC
|
||||
// non-zero if this is a branch, contains the target labels identifier
|
||||
Identifier* isBranchToLabel;
|
||||
};
|
||||
|
||||
@@ -304,7 +304,7 @@ Dsymbol *TemplateDeclaration::syntaxCopy(Dsymbol *)
|
||||
d = Dsymbol::arraySyntaxCopy(members);
|
||||
td = new TemplateDeclaration(loc, ident, p, d);
|
||||
|
||||
// LLVMDC
|
||||
// LDC
|
||||
td->intrinsicName = intrinsicName;
|
||||
|
||||
return td;
|
||||
|
||||
@@ -86,7 +86,7 @@ struct TemplateDeclaration : ScopeDsymbol
|
||||
TemplateTupleParameter *isVariadic();
|
||||
int isOverloadable();
|
||||
|
||||
// LLVMDC
|
||||
// LDC
|
||||
std::string intrinsicName;
|
||||
};
|
||||
|
||||
@@ -315,7 +315,7 @@ struct TemplateInstance : ScopeDsymbol
|
||||
TemplateInstance *isTemplateInstance() { return this; }
|
||||
AliasDeclaration *isAliasDeclaration();
|
||||
|
||||
// LLVMDC
|
||||
// LDC
|
||||
TemplateInstance *tinst; // enclosing template instance
|
||||
void printInstantiationTrace();
|
||||
};
|
||||
|
||||
6
gen/aa.h
6
gen/aa.h
@@ -1,8 +1,8 @@
|
||||
#ifndef LLVMDC_GEN_AA_H
|
||||
#define LLVMDC_GEN_AA_H
|
||||
#ifndef LDC_GEN_AA_H
|
||||
#define LDC_GEN_AA_H
|
||||
|
||||
DValue* DtoAAIndex(Loc& loc, Type* type, DValue* aa, DValue* key, bool lvalue);
|
||||
DValue* DtoAAIn(Loc& loc, Type* type, DValue* aa, DValue* key);
|
||||
void DtoAARemove(Loc& loc, DValue* aa, DValue* key);
|
||||
|
||||
#endif // LLVMDC_GEN_AA_H
|
||||
#endif // LDC_GEN_AA_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LLVMDC_GEN_CLASSES_H
|
||||
#define LLVMDC_GEN_CLASSES_H
|
||||
#ifndef LDC_GEN_CLASSES_H
|
||||
#define LDC_GEN_CLASSES_H
|
||||
|
||||
#include "gen/structs.h"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LLVMDC_GEN_COMPLEX_H
|
||||
#define LLVMDC_GEN_COMPLEX_H
|
||||
#ifndef LDC_GEN_COMPLEX_H
|
||||
#define LDC_GEN_COMPLEX_H
|
||||
|
||||
const llvm::StructType* DtoComplexType(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);
|
||||
|
||||
#endif // LLVMDC_GEN_COMPLEX_H
|
||||
#endif // LDC_GEN_COMPLEX_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LLVMDC_GEN_DVALUE_H
|
||||
#define LLVMDC_GEN_DVALUE_H
|
||||
#ifndef LDC_GEN_DVALUE_H
|
||||
#define LDC_GEN_DVALUE_H
|
||||
|
||||
/*
|
||||
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; }
|
||||
};
|
||||
|
||||
#endif // LLVMDC_GEN_DVALUE_H
|
||||
#endif // LDC_GEN_DVALUE_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LLVMDC_GEN_FUNCTIONS_H
|
||||
#define LLVMDC_GEN_FUNCTIONS_H
|
||||
#ifndef LDC_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(FuncDeclaration* fdecl);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LLVMDC_GEN_IRSTATE_H
|
||||
#define LLVMDC_GEN_IRSTATE_H
|
||||
#ifndef LDC_GEN_IRSTATE_H
|
||||
#define LDC_GEN_IRSTATE_H
|
||||
|
||||
#include <vector>
|
||||
#include <list>
|
||||
@@ -234,4 +234,4 @@ CallOrInvoke* IRState::CreateCallOrInvoke(LLValue* Callee, InputIterator ArgBegi
|
||||
return new CallOrInvoke_Call(ir->CreateCall(Callee, ArgBegin, ArgEnd, Name));
|
||||
}
|
||||
|
||||
#endif // LLVMDC_GEN_IRSTATE_H
|
||||
#endif // LDC_GEN_IRSTATE_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LLVMDC_GEN_LINKER_H
|
||||
#define LLVMDC_GEN_LINKER_H
|
||||
#ifndef LDC_GEN_LINKER_H
|
||||
#define LDC_GEN_LINKER_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -33,4 +33,4 @@ void deleteExecutable();
|
||||
*/
|
||||
int runExectuable();
|
||||
|
||||
#endif // LLVMDC_GEN_LINKER_H
|
||||
#endif // LDC_GEN_LINKER_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LLVMDC_GEN_LLVMHELPERS_H
|
||||
#define LLVMDC_GEN_LLVMHELPERS_H
|
||||
#ifndef LDC_GEN_LLVMHELPERS_H
|
||||
#define LDC_GEN_LLVMHELPERS_H
|
||||
|
||||
#include "gen/llvm.h"
|
||||
#include "statement.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LLVMDC_GEN_TODEBUG_H
|
||||
#define LLVMDC_GEN_TODEBUG_H
|
||||
#ifndef LDC_GEN_TODEBUG_H
|
||||
#define LDC_GEN_TODEBUG_H
|
||||
|
||||
void RegisterDwarfSymbols(llvm::Module* mod);
|
||||
|
||||
@@ -37,6 +37,6 @@ void DtoDwarfLocalVariable(LLValue* ll, VarDeclaration* vd);
|
||||
*/
|
||||
LLGlobalVariable* DtoDwarfGlobalVariable(LLGlobalVariable* ll, VarDeclaration* vd);
|
||||
|
||||
#endif // LLVMDC_GEN_TODEBUG_H
|
||||
#endif // LDC_GEN_TODEBUG_H
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LLVMDC_GEN_TOLLVM_H
|
||||
#define LLVMDC_GEN_TOLLVM_H
|
||||
#ifndef LDC_GEN_TOLLVM_H
|
||||
#define LDC_GEN_TOLLVM_H
|
||||
|
||||
#include "gen/llvm.h"
|
||||
#include "lexer.h"
|
||||
@@ -144,4 +144,4 @@ void DtoMemoryBarrier(bool ll, bool ls, bool sl, bool ss, bool device=false);
|
||||
|
||||
#include "enums.h"
|
||||
|
||||
#endif // LLVMDC_GEN_TOLLVM_H
|
||||
#endif // LDC_GEN_TOLLVM_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LLVMDC_GEN_TYPEINF_H
|
||||
#define LLVMDC_GEN_TYPEINF_H
|
||||
#ifndef LDC_GEN_TYPEINF_H
|
||||
#define LDC_GEN_TYPEINF_H
|
||||
|
||||
void DtoResolveTypeInfo(TypeInfoDeclaration* tid);
|
||||
void DtoDeclareTypeInfo(TypeInfoDeclaration* tid);
|
||||
|
||||
4
ir/ir.h
4
ir/ir.h
@@ -1,7 +1,7 @@
|
||||
// this head contains stuff used by all the IR
|
||||
|
||||
#ifndef LLVMDC_IR_IR_H
|
||||
#define LLVMDC_IR_IR_H
|
||||
#ifndef LDC_IR_IR_H
|
||||
#define LDC_IR_IR_H
|
||||
|
||||
#include "ir/irforw.h"
|
||||
#include "root.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LLVMDC_IR_IRFORW_H
|
||||
#define LLVMDC_IR_IRFORW_H
|
||||
#ifndef LDC_IR_IRFORW_H
|
||||
#define LDC_IR_IRFORW_H
|
||||
|
||||
// dmd forward declarations
|
||||
struct Module;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LLVMDC_IR_IRFUNCTION_H
|
||||
#define LLVMDC_IR_IRFUNCTION_H
|
||||
#ifndef LDC_IR_IRFUNCTION_H
|
||||
#define LDC_IR_IRFUNCTION_H
|
||||
|
||||
#include "ir/ir.h"
|
||||
#include "ir/irlandingpad.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LLVMDC_IR_IRLANDINGPADINFO_H
|
||||
#define LLVMDC_IR_IRLANDINGPADINFO_H
|
||||
#ifndef LDC_IR_IRLANDINGPADINFO_H
|
||||
#define LDC_IR_IRLANDINGPADINFO_H
|
||||
|
||||
#include "ir/ir.h"
|
||||
#include "statement.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LLVMDC_IR_IRMODULE_H
|
||||
#define LLVMDC_IR_IRMODULE_H
|
||||
#ifndef LDC_IR_IRMODULE_H
|
||||
#define LDC_IR_IRMODULE_H
|
||||
|
||||
#include "ir/ir.h"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LLVMDC_IR_IRSTRUCT_H
|
||||
#define LLVMDC_IR_IRSTRUCT_H
|
||||
#ifndef LDC_IR_IRSTRUCT_H
|
||||
#define LDC_IR_IRSTRUCT_H
|
||||
|
||||
#include "ir/ir.h"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LLVMDC_IR_IRSYMBOL_H
|
||||
#define LLVMDC_IR_IRSYMBOL_H
|
||||
#ifndef LDC_IR_IRSYMBOL_H
|
||||
#define LDC_IR_IRSYMBOL_H
|
||||
|
||||
#include <set>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LLVMDC_IR_IRTYPE_H
|
||||
#define LLVMDC_IR_IRTYPE_H
|
||||
#ifndef LDC_IR_IRTYPE_H
|
||||
#define LDC_IR_IRTYPE_H
|
||||
|
||||
#include <set>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LLVMDC_IR_IRVAR_H
|
||||
#define LLVMDC_IR_IRVAR_H
|
||||
#ifndef LDC_IR_IRVAR_H
|
||||
#define LDC_IR_IRVAR_H
|
||||
|
||||
#include "ir/ir.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
|
||||
* 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
|
||||
*/
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2006 by Digital Mars, www.digitalmars.com
|
||||
* 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
|
||||
* 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
|
||||
work with the GDC compiler.
|
||||
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 Tomas Lindquist Olsen, August 2007
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Modified for LLVMDC
|
||||
// Modified for LDC
|
||||
|
||||
module std.moduleinit;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
/* 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;
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
|
||||
/*
|
||||
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
|
||||
*/
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
/*
|
||||
* 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
|
||||
@@ -90,7 +90,7 @@ struct BB
|
||||
* 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;
|
||||
|
||||
/**********************************
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
/*
|
||||
* 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;
|
||||
|
||||
@@ -60,7 +60,7 @@ private
|
||||
import tango.stdc.posix.dlfcn;
|
||||
}
|
||||
}
|
||||
version(LLVMDC)
|
||||
version(LDC)
|
||||
{
|
||||
pragma(intrinsic, "llvm.frameaddress")
|
||||
{
|
||||
@@ -122,7 +122,7 @@ extern (C) void* rt_stackBottom()
|
||||
*/
|
||||
extern (C) void* rt_stackTop()
|
||||
{
|
||||
version(LLVMDC)
|
||||
version(LDC)
|
||||
{
|
||||
return llvm_frameaddress();
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ import tango.io.Console;
|
||||
|
||||
void main()
|
||||
{
|
||||
Cout("Hi, says LLVMDC + Tango").newline;
|
||||
Cout("Hi, says LDC + Tango").newline;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user