mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 23:50:43 +03:00
[svn r143] Fixed: a few bugs in debug information, still only line info, but should be correct files now :)
Fixed: tango.io.Console seems to be working now.
This commit is contained in:
parent
7825be29ee
commit
94c47aa1fa
33 changed files with 194 additions and 108 deletions
|
@ -1099,6 +1099,7 @@ int VarDeclaration::hasPointers()
|
||||||
Expression *VarDeclaration::callAutoDtor()
|
Expression *VarDeclaration::callAutoDtor()
|
||||||
{ Expression *e = NULL;
|
{ Expression *e = NULL;
|
||||||
|
|
||||||
|
//printf("VarDeclaration::callAutoDtor() %s\n", toChars());
|
||||||
if (storage_class & (STCauto | STCscope) && !noauto)
|
if (storage_class & (STCauto | STCscope) && !noauto)
|
||||||
{
|
{
|
||||||
for (ClassDeclaration *cd = type->isClassHandle();
|
for (ClassDeclaration *cd = type->isClassHandle();
|
||||||
|
@ -1109,6 +1110,8 @@ Expression *VarDeclaration::callAutoDtor()
|
||||||
* classes to determine if there's no way the monitor
|
* classes to determine if there's no way the monitor
|
||||||
* could be set.
|
* could be set.
|
||||||
*/
|
*/
|
||||||
|
if (cd->isInterfaceDeclaration())
|
||||||
|
error("interface %s cannot be scope", cd->toChars());
|
||||||
if (1 || onstack || cd->dtors.dim) // if any destructors
|
if (1 || onstack || cd->dtors.dim) // if any destructors
|
||||||
{
|
{
|
||||||
// delete this;
|
// delete this;
|
||||||
|
|
|
@ -518,7 +518,7 @@ void functionArguments(Loc loc, Scope *sc, TypeFunction *tf, Expressions *argume
|
||||||
{
|
{
|
||||||
// BUG: should check that argument to ref is type 'invariant'
|
// BUG: should check that argument to ref is type 'invariant'
|
||||||
// BUG: assignments to ref should also be type 'invariant'
|
// BUG: assignments to ref should also be type 'invariant'
|
||||||
arg = arg->modifiableLvalue(sc, NULL);
|
arg = arg->modifiableLvalue(sc, arg);
|
||||||
|
|
||||||
//if (arg->op == TOKslice)
|
//if (arg->op == TOKslice)
|
||||||
//arg->error("cannot modify slice %s", arg->toChars());
|
//arg->error("cannot modify slice %s", arg->toChars());
|
||||||
|
@ -4357,7 +4357,7 @@ Expression *BinExp::commonSemanticAssign(Scope *sc)
|
||||||
if (e)
|
if (e)
|
||||||
return e;
|
return e;
|
||||||
|
|
||||||
e1 = e1->modifiableLvalue(sc, NULL);
|
e1 = e1->modifiableLvalue(sc, e1);
|
||||||
e1->checkScalar();
|
e1->checkScalar();
|
||||||
type = e1->type;
|
type = e1->type;
|
||||||
if (type->toBasetype()->ty == Tbool)
|
if (type->toBasetype()->ty == Tbool)
|
||||||
|
@ -4388,7 +4388,7 @@ Expression *BinExp::commonSemanticAssignIntegral(Scope *sc)
|
||||||
if (e)
|
if (e)
|
||||||
return e;
|
return e;
|
||||||
|
|
||||||
e1 = e1->modifiableLvalue(sc, NULL);
|
e1 = e1->modifiableLvalue(sc, e1);
|
||||||
e1->checkScalar();
|
e1->checkScalar();
|
||||||
type = e1->type;
|
type = e1->type;
|
||||||
if (type->toBasetype()->ty == Tbool)
|
if (type->toBasetype()->ty == Tbool)
|
||||||
|
@ -6874,7 +6874,7 @@ Expression *PostExp::semantic(Scope *sc)
|
||||||
return e;
|
return e;
|
||||||
|
|
||||||
e = this;
|
e = this;
|
||||||
e1 = e1->modifiableLvalue(sc, NULL);
|
e1 = e1->modifiableLvalue(sc, e1);
|
||||||
e1->checkScalar();
|
e1->checkScalar();
|
||||||
e1->checkNoBool();
|
e1->checkNoBool();
|
||||||
if (e1->type->ty == Tpointer)
|
if (e1->type->ty == Tpointer)
|
||||||
|
@ -7060,7 +7060,7 @@ Expression *AssignExp::semantic(Scope *sc)
|
||||||
// e1 is not an lvalue, but we let code generator handle it
|
// e1 is not an lvalue, but we let code generator handle it
|
||||||
ArrayLengthExp *ale = (ArrayLengthExp *)e1;
|
ArrayLengthExp *ale = (ArrayLengthExp *)e1;
|
||||||
|
|
||||||
ale->e1 = ale->e1->modifiableLvalue(sc, NULL);
|
ale->e1 = ale->e1->modifiableLvalue(sc, e1);
|
||||||
}
|
}
|
||||||
else if (e1->op == TOKslice)
|
else if (e1->op == TOKslice)
|
||||||
;
|
;
|
||||||
|
@ -7122,7 +7122,7 @@ Expression *AddAssignExp::semantic(Scope *sc)
|
||||||
if (e)
|
if (e)
|
||||||
return e;
|
return e;
|
||||||
|
|
||||||
e1 = e1->modifiableLvalue(sc, NULL);
|
e1 = e1->modifiableLvalue(sc, e1);
|
||||||
|
|
||||||
Type *tb1 = e1->type->toBasetype();
|
Type *tb1 = e1->type->toBasetype();
|
||||||
Type *tb2 = e2->type->toBasetype();
|
Type *tb2 = e2->type->toBasetype();
|
||||||
|
@ -7222,7 +7222,7 @@ Expression *MinAssignExp::semantic(Scope *sc)
|
||||||
if (e)
|
if (e)
|
||||||
return e;
|
return e;
|
||||||
|
|
||||||
e1 = e1->modifiableLvalue(sc, NULL);
|
e1 = e1->modifiableLvalue(sc, e1);
|
||||||
e1->checkScalar();
|
e1->checkScalar();
|
||||||
e1->checkNoBool();
|
e1->checkNoBool();
|
||||||
if (e1->type->ty == Tpointer && e2->type->isintegral())
|
if (e1->type->ty == Tpointer && e2->type->isintegral())
|
||||||
|
@ -7267,7 +7267,7 @@ Expression *CatAssignExp::semantic(Scope *sc)
|
||||||
error("cannot append to static array %s", se->e1->type->toChars());
|
error("cannot append to static array %s", se->e1->type->toChars());
|
||||||
}
|
}
|
||||||
|
|
||||||
e1 = e1->modifiableLvalue(sc, NULL);
|
e1 = e1->modifiableLvalue(sc, e1);
|
||||||
|
|
||||||
Type *tb1 = e1->type->toBasetype();
|
Type *tb1 = e1->type->toBasetype();
|
||||||
Type *tb2 = e2->type->toBasetype();
|
Type *tb2 = e2->type->toBasetype();
|
||||||
|
@ -7316,7 +7316,7 @@ Expression *MulAssignExp::semantic(Scope *sc)
|
||||||
if (e)
|
if (e)
|
||||||
return e;
|
return e;
|
||||||
|
|
||||||
e1 = e1->modifiableLvalue(sc, NULL);
|
e1 = e1->modifiableLvalue(sc, e1);
|
||||||
e1->checkScalar();
|
e1->checkScalar();
|
||||||
e1->checkNoBool();
|
e1->checkNoBool();
|
||||||
type = e1->type;
|
type = e1->type;
|
||||||
|
@ -7372,7 +7372,7 @@ Expression *DivAssignExp::semantic(Scope *sc)
|
||||||
if (e)
|
if (e)
|
||||||
return e;
|
return e;
|
||||||
|
|
||||||
e1 = e1->modifiableLvalue(sc, NULL);
|
e1 = e1->modifiableLvalue(sc, e1);
|
||||||
e1->checkScalar();
|
e1->checkScalar();
|
||||||
e1->checkNoBool();
|
e1->checkNoBool();
|
||||||
type = e1->type;
|
type = e1->type;
|
||||||
|
@ -7443,7 +7443,7 @@ Expression *ShlAssignExp::semantic(Scope *sc)
|
||||||
if (e)
|
if (e)
|
||||||
return e;
|
return e;
|
||||||
|
|
||||||
e1 = e1->modifiableLvalue(sc, NULL);
|
e1 = e1->modifiableLvalue(sc, e1);
|
||||||
e1->checkScalar();
|
e1->checkScalar();
|
||||||
e1->checkNoBool();
|
e1->checkNoBool();
|
||||||
type = e1->type;
|
type = e1->type;
|
||||||
|
@ -7472,7 +7472,7 @@ Expression *ShrAssignExp::semantic(Scope *sc)
|
||||||
if (e)
|
if (e)
|
||||||
return e;
|
return e;
|
||||||
|
|
||||||
e1 = e1->modifiableLvalue(sc, NULL);
|
e1 = e1->modifiableLvalue(sc, e1);
|
||||||
e1->checkScalar();
|
e1->checkScalar();
|
||||||
e1->checkNoBool();
|
e1->checkNoBool();
|
||||||
type = e1->type;
|
type = e1->type;
|
||||||
|
@ -7501,7 +7501,7 @@ Expression *UshrAssignExp::semantic(Scope *sc)
|
||||||
if (e)
|
if (e)
|
||||||
return e;
|
return e;
|
||||||
|
|
||||||
e1 = e1->modifiableLvalue(sc, NULL);
|
e1 = e1->modifiableLvalue(sc, e1);
|
||||||
e1->checkScalar();
|
e1->checkScalar();
|
||||||
e1->checkNoBool();
|
e1->checkNoBool();
|
||||||
type = e1->type;
|
type = e1->type;
|
||||||
|
|
|
@ -2162,7 +2162,7 @@ done:
|
||||||
break;
|
break;
|
||||||
if (d >= r)
|
if (d >= r)
|
||||||
break;
|
break;
|
||||||
if (n * r + d < n)
|
if (n && n * r + d <= n)
|
||||||
{
|
{
|
||||||
error ("integer overflow");
|
error ("integer overflow");
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -141,8 +141,10 @@ char *FuncDeclaration::mangle()
|
||||||
if (isMain())
|
if (isMain())
|
||||||
return "_Dmain";
|
return "_Dmain";
|
||||||
|
|
||||||
|
if (isWinMain() || isDllMain())
|
||||||
|
return ident->toChars();
|
||||||
|
|
||||||
assert(this);
|
assert(this);
|
||||||
|
|
||||||
return Declaration::mangle();
|
return Declaration::mangle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Compiler implementation of the D programming language
|
// Compiler implementation of the D programming language
|
||||||
// Copyright (c) 1999-2007 by Digital Mars
|
// Copyright (c) 1999-2008 by Digital Mars
|
||||||
// All Rights Reserved
|
// All Rights Reserved
|
||||||
// written by Walter Bright
|
// written by Walter Bright
|
||||||
// http://www.digitalmars.com
|
// http://www.digitalmars.com
|
||||||
|
@ -68,10 +68,10 @@ Global::Global()
|
||||||
#error "fix this"
|
#error "fix this"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
copyright = "Copyright (c) 1999-2007 by Digital Mars and Tomas Lindquist Olsen";
|
copyright = "Copyright (c) 1999-2008 by Digital Mars and Tomas Lindquist Olsen";
|
||||||
written = "written by Walter Bright and Tomas Lindquist Olsen";
|
written = "written by Walter Bright and Tomas Lindquist Olsen";
|
||||||
llvmdc_version = "0.1";
|
llvmdc_version = "0.1";
|
||||||
version = "v1.025";
|
version = "v1.026";
|
||||||
global.structalign = 8;
|
global.structalign = 8;
|
||||||
|
|
||||||
memset(¶ms, 0, sizeof(Param));
|
memset(¶ms, 0, sizeof(Param));
|
||||||
|
@ -823,7 +823,6 @@ int main(int argc, char *argv[])
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !IN_LLVM
|
|
||||||
#if TARGET_LINUX
|
#if TARGET_LINUX
|
||||||
if (strcmp(ext, "a") == 0)
|
if (strcmp(ext, "a") == 0)
|
||||||
#else
|
#else
|
||||||
|
@ -833,7 +832,6 @@ int main(int argc, char *argv[])
|
||||||
global.params.libfiles->push(files.data[i]);
|
global.params.libfiles->push(files.data[i]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (strcmp(ext, global.ddoc_ext) == 0)
|
if (strcmp(ext, global.ddoc_ext) == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -162,7 +162,7 @@ Module::Module(char *filename, Identifier *ident, int doDocComment, int doHdrGen
|
||||||
symfile = new File(symfilename);
|
symfile = new File(symfilename);
|
||||||
|
|
||||||
// LLVMDC
|
// LLVMDC
|
||||||
llvmCompileUnit = 0;
|
irModule = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::setDocfile()
|
void Module::setDocfile()
|
||||||
|
|
|
@ -29,7 +29,7 @@ struct VarDeclaration;
|
||||||
#if IN_LLVM
|
#if IN_LLVM
|
||||||
struct DValue;
|
struct DValue;
|
||||||
typedef DValue elem;
|
typedef DValue elem;
|
||||||
namespace llvm { class GlobalVariable; }
|
struct IrModule;
|
||||||
#else
|
#else
|
||||||
#ifdef IN_GCC
|
#ifdef IN_GCC
|
||||||
union tree_node; typedef union tree_node elem;
|
union tree_node; typedef union tree_node elem;
|
||||||
|
@ -169,7 +169,7 @@ struct Module : Package
|
||||||
void genmoduleinfo();
|
void genmoduleinfo();
|
||||||
|
|
||||||
// LLVMDC
|
// LLVMDC
|
||||||
llvm::GlobalVariable* llvmCompileUnit;
|
IrModule* irModule;
|
||||||
|
|
||||||
Module *isModule() { return this; }
|
Module *isModule() { return this; }
|
||||||
};
|
};
|
||||||
|
|
33
dmd/mtype.c
33
dmd/mtype.c
|
@ -3973,6 +3973,15 @@ Expression *TypeTypedef::dotExp(Scope *sc, Expression *e, Identifier *ident)
|
||||||
return sym->basetype->dotExp(sc, e, ident);
|
return sym->basetype->dotExp(sc, e, ident);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Expression *TypeTypedef::getProperty(Loc loc, Identifier *ident)
|
||||||
|
{
|
||||||
|
if (ident == Id::init)
|
||||||
|
{
|
||||||
|
return Type::getProperty(loc, ident);
|
||||||
|
}
|
||||||
|
return sym->basetype->getProperty(loc, ident);
|
||||||
|
}
|
||||||
|
|
||||||
int TypeTypedef::isbit()
|
int TypeTypedef::isbit()
|
||||||
{
|
{
|
||||||
return sym->basetype->isbit();
|
return sym->basetype->isbit();
|
||||||
|
@ -4276,6 +4285,18 @@ L1:
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TemplateInstance *ti = s->isTemplateInstance();
|
||||||
|
if (ti)
|
||||||
|
{ if (!ti->semanticdone)
|
||||||
|
ti->semantic(sc);
|
||||||
|
s = ti->inst->toAlias();
|
||||||
|
if (!s->isTemplateInstance())
|
||||||
|
goto L1;
|
||||||
|
Expression *de = new DotExp(e->loc, e, new ScopeExp(e->loc, ti));
|
||||||
|
de->type = e->type;
|
||||||
|
return de;
|
||||||
|
}
|
||||||
|
|
||||||
d = s->isDeclaration();
|
d = s->isDeclaration();
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (!d)
|
if (!d)
|
||||||
|
@ -4646,6 +4667,18 @@ L1:
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TemplateInstance *ti = s->isTemplateInstance();
|
||||||
|
if (ti)
|
||||||
|
{ if (!ti->semanticdone)
|
||||||
|
ti->semantic(sc);
|
||||||
|
s = ti->inst->toAlias();
|
||||||
|
if (!s->isTemplateInstance())
|
||||||
|
goto L1;
|
||||||
|
Expression *de = new DotExp(e->loc, e, new ScopeExp(e->loc, ti));
|
||||||
|
de->type = e->type;
|
||||||
|
return de;
|
||||||
|
}
|
||||||
|
|
||||||
d = s->isDeclaration();
|
d = s->isDeclaration();
|
||||||
if (!d)
|
if (!d)
|
||||||
{
|
{
|
||||||
|
|
|
@ -587,6 +587,7 @@ struct TypeTypedef : Type
|
||||||
void toTypeInfoBuffer(OutBuffer *buf);
|
void toTypeInfoBuffer(OutBuffer *buf);
|
||||||
void toCBuffer2(OutBuffer *buf, Identifier *ident, HdrGenState *hgs);
|
void toCBuffer2(OutBuffer *buf, Identifier *ident, HdrGenState *hgs);
|
||||||
Expression *dotExp(Scope *sc, Expression *e, Identifier *ident);
|
Expression *dotExp(Scope *sc, Expression *e, Identifier *ident);
|
||||||
|
Expression *getProperty(Loc loc, Identifier *ident);
|
||||||
int isbit();
|
int isbit();
|
||||||
int isintegral();
|
int isintegral();
|
||||||
int isfloating();
|
int isfloating();
|
||||||
|
|
|
@ -1219,13 +1219,12 @@ Lerr:
|
||||||
|
|
||||||
TemplateParameters *Parser::parseTemplateParameterList()
|
TemplateParameters *Parser::parseTemplateParameterList()
|
||||||
{
|
{
|
||||||
TemplateParameters *tpl;
|
TemplateParameters *tpl = new TemplateParameters();
|
||||||
|
|
||||||
if (token.value != TOKlparen)
|
if (token.value != TOKlparen)
|
||||||
{ error("parenthesized TemplateParameterList expected following TemplateIdentifier");
|
{ error("parenthesized TemplateParameterList expected following TemplateIdentifier");
|
||||||
goto Lerr;
|
goto Lerr;
|
||||||
}
|
}
|
||||||
tpl = new TemplateParameters();
|
|
||||||
nextToken();
|
nextToken();
|
||||||
|
|
||||||
// Get array of TemplateParameters
|
// Get array of TemplateParameters
|
||||||
|
@ -1309,7 +1308,7 @@ TemplateParameters *Parser::parseTemplateParameterList()
|
||||||
if (!tp_ident)
|
if (!tp_ident)
|
||||||
{
|
{
|
||||||
error("no identifier for template value parameter");
|
error("no identifier for template value parameter");
|
||||||
goto Lerr;
|
tp_ident = new Identifier("error", TOKidentifier);
|
||||||
}
|
}
|
||||||
if (token.value == TOKcolon) // : CondExpression
|
if (token.value == TOKcolon) // : CondExpression
|
||||||
{
|
{
|
||||||
|
@ -1330,10 +1329,8 @@ TemplateParameters *Parser::parseTemplateParameterList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
check(TOKrparen);
|
check(TOKrparen);
|
||||||
return tpl;
|
|
||||||
|
|
||||||
Lerr:
|
Lerr:
|
||||||
return NULL;
|
return tpl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************
|
/******************************************
|
||||||
|
|
|
@ -1982,6 +1982,7 @@ Statement *SwitchStatement::semantic(Scope *sc)
|
||||||
{ condition = condition->integralPromotions(sc);
|
{ condition = condition->integralPromotions(sc);
|
||||||
condition->checkIntegral();
|
condition->checkIntegral();
|
||||||
}
|
}
|
||||||
|
condition = condition->optimize(WANTvalue);
|
||||||
|
|
||||||
sc = sc->push();
|
sc = sc->push();
|
||||||
sc->sbreak = this;
|
sc->sbreak = this;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
// Compiler implementation of the D programming language
|
// Compiler implementation of the D programming language
|
||||||
// Copyright (c) 1999-2007 by Digital Mars
|
// Copyright (c) 1999-2008 by Digital Mars
|
||||||
// All Rights Reserved
|
// All Rights Reserved
|
||||||
// written by Walter Bright
|
// written by Walter Bright
|
||||||
// http://www.digitalmars.com
|
// http://www.digitalmars.com
|
||||||
|
@ -1540,6 +1540,9 @@ MATCH TypeInstance::deduceType(Scope *sc,
|
||||||
else if (tempinst->tempdecl != tp->tempinst->tempdecl)
|
else if (tempinst->tempdecl != tp->tempinst->tempdecl)
|
||||||
goto Lnomatch;
|
goto Lnomatch;
|
||||||
|
|
||||||
|
if (tempinst->tiargs->dim != tp->tempinst->tiargs->dim)
|
||||||
|
goto Lnomatch;
|
||||||
|
|
||||||
for (int i = 0; i < tempinst->tiargs->dim; i++)
|
for (int i = 0; i < tempinst->tiargs->dim; i++)
|
||||||
{
|
{
|
||||||
//printf("test: [%d]\n", i);
|
//printf("test: [%d]\n", i);
|
||||||
|
@ -3008,6 +3011,8 @@ void TemplateInstance::semanticTiargs(Loc loc, Scope *sc, Objects *tiargs)
|
||||||
ea = ea->semantic(sc);
|
ea = ea->semantic(sc);
|
||||||
ea = ea->optimize(WANTvalue | WANTinterpret);
|
ea = ea->optimize(WANTvalue | WANTinterpret);
|
||||||
tiargs->data[j] = ea;
|
tiargs->data[j] = ea;
|
||||||
|
if (ea->op == TOKtype)
|
||||||
|
tiargs->data[j] = ea->type;
|
||||||
}
|
}
|
||||||
else if (sa)
|
else if (sa)
|
||||||
{
|
{
|
||||||
|
@ -3292,6 +3297,9 @@ int TemplateInstance::isNested(Objects *args)
|
||||||
Lsa:
|
Lsa:
|
||||||
Declaration *d = sa->isDeclaration();
|
Declaration *d = sa->isDeclaration();
|
||||||
if (d && !d->isDataseg() &&
|
if (d && !d->isDataseg() &&
|
||||||
|
#if V2
|
||||||
|
!(d->storage_class & STCmanifest) &&
|
||||||
|
#endif
|
||||||
(!d->isFuncDeclaration() || d->isFuncDeclaration()->isNested()) &&
|
(!d->isFuncDeclaration() || d->isFuncDeclaration()->isNested()) &&
|
||||||
!isTemplateMixin())
|
!isTemplateMixin())
|
||||||
{
|
{
|
||||||
|
|
|
@ -459,10 +459,7 @@ void DtoDefineFunc(FuncDeclaration* fd)
|
||||||
// debug info
|
// debug info
|
||||||
if (global.params.symdebug) {
|
if (global.params.symdebug) {
|
||||||
Module* mo = fd->getModule();
|
Module* mo = fd->getModule();
|
||||||
if (!mo->llvmCompileUnit) {
|
fd->irFunc->dwarfSubProg = DtoDwarfSubProgram(fd, DtoDwarfCompileUnit(mo));
|
||||||
mo->llvmCompileUnit = DtoDwarfCompileUnit(mo,false);
|
|
||||||
}
|
|
||||||
fd->irFunc->dwarfSubProg = DtoDwarfSubProgram(fd, mo->llvmCompileUnit);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Type* t = DtoDType(fd->type);
|
Type* t = DtoDType(fd->type);
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
#include "gen/tollvm.h"
|
#include "gen/tollvm.h"
|
||||||
#include "gen/logger.h"
|
#include "gen/logger.h"
|
||||||
|
|
||||||
|
#include "ir/irmodule.h"
|
||||||
|
|
||||||
using namespace llvm::dwarf;
|
using namespace llvm::dwarf;
|
||||||
|
|
||||||
static const llvm::PointerType* ptrTy(const llvm::Type* t)
|
static const llvm::PointerType* ptrTy(const llvm::Type* t)
|
||||||
|
@ -110,27 +112,40 @@ const llvm::StructType* GetDwarfSubProgramType() {
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
llvm::GlobalVariable* DtoDwarfCompileUnit(Module* m, bool define)
|
llvm::GlobalVariable* DtoDwarfCompileUnit(Module* m)
|
||||||
{
|
{
|
||||||
llvm::Constant* c = NULL;
|
if (!m->irModule)
|
||||||
if (1 || define) {
|
m->irModule = new IrModule(m);
|
||||||
std::vector<llvm::Constant*> vals;
|
else if (m->irModule->dwarfCompileUnit)
|
||||||
vals.push_back(llvm::ConstantExpr::getAdd(
|
{
|
||||||
DtoConstUint(DW_TAG_compile_unit),
|
if (m->irModule->dwarfCompileUnit->getParent() == gIR->module)
|
||||||
DtoConstUint(llvm::LLVMDebugVersion)));
|
return m->irModule->dwarfCompileUnit;
|
||||||
vals.push_back(dbgToArrTy(GetDwarfAnchor(DW_TAG_compile_unit)));
|
|
||||||
|
|
||||||
vals.push_back(DtoConstUint(DW_LANG_C));// _D)); // doesn't seem to work
|
|
||||||
vals.push_back(DtoConstStringPtr(m->srcfile->name->toChars(), "llvm.metadata"));
|
|
||||||
std::string srcpath(FileName::path(m->srcfile->name->toChars()));
|
|
||||||
//srcpath.append("/");
|
|
||||||
vals.push_back(DtoConstStringPtr(srcpath.c_str(), "llvm.metadata"));
|
|
||||||
vals.push_back(DtoConstStringPtr("LLVMDC (http://www.dsource.org/projects/llvmdc)", "llvm.metadata"));
|
|
||||||
|
|
||||||
c = llvm::ConstantStruct::get(GetDwarfCompileUnitType(), vals);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// create a valid compile unit constant for the current module
|
||||||
|
|
||||||
|
llvm::Constant* c = NULL;
|
||||||
|
|
||||||
|
std::vector<llvm::Constant*> vals;
|
||||||
|
vals.push_back(llvm::ConstantExpr::getAdd(
|
||||||
|
DtoConstUint(DW_TAG_compile_unit),
|
||||||
|
DtoConstUint(llvm::LLVMDebugVersion)));
|
||||||
|
vals.push_back(dbgToArrTy(GetDwarfAnchor(DW_TAG_compile_unit)));
|
||||||
|
|
||||||
|
vals.push_back(DtoConstUint(DW_LANG_C));// _D)); // doesn't seem to work
|
||||||
|
vals.push_back(DtoConstStringPtr(m->srcfile->name->toChars(), "llvm.metadata"));
|
||||||
|
std::string srcpath(FileName::path(m->srcfile->name->toChars()));
|
||||||
|
if (srcpath.empty())
|
||||||
|
srcpath = ".";
|
||||||
|
vals.push_back(DtoConstStringPtr(srcpath.c_str(), "llvm.metadata"));
|
||||||
|
vals.push_back(DtoConstStringPtr("LLVMDC (http://www.dsource.org/projects/llvmdc)", "llvm.metadata"));
|
||||||
|
|
||||||
|
c = llvm::ConstantStruct::get(GetDwarfCompileUnitType(), vals);
|
||||||
|
|
||||||
llvm::GlobalVariable* gv = new llvm::GlobalVariable(GetDwarfCompileUnitType(), true, llvm::GlobalValue::InternalLinkage, c, "llvm.dbg.compile_unit", gIR->module);
|
llvm::GlobalVariable* gv = new llvm::GlobalVariable(GetDwarfCompileUnitType(), true, llvm::GlobalValue::InternalLinkage, c, "llvm.dbg.compile_unit", gIR->module);
|
||||||
gv->setSection("llvm.metadata");
|
gv->setSection("llvm.metadata");
|
||||||
|
|
||||||
|
m->irModule->dwarfCompileUnit = gv;
|
||||||
return gv;
|
return gv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,7 +196,7 @@ void DtoDwarfStopPoint(unsigned ln)
|
||||||
std::vector<llvm::Value*> args;
|
std::vector<llvm::Value*> args;
|
||||||
args.push_back(DtoConstUint(ln));
|
args.push_back(DtoConstUint(ln));
|
||||||
args.push_back(DtoConstUint(0));
|
args.push_back(DtoConstUint(0));
|
||||||
assert(gIR->dmodule->llvmCompileUnit);
|
FuncDeclaration* fd = gIR->func()->decl;
|
||||||
args.push_back(dbgToArrTy(gIR->dmodule->llvmCompileUnit));
|
args.push_back(dbgToArrTy(DtoDwarfCompileUnit(fd->getModule())));
|
||||||
gIR->ir->CreateCall(gIR->module->getFunction("llvm.dbg.stoppoint"), args.begin(), args.end());
|
gIR->ir->CreateCall(gIR->module->getFunction("llvm.dbg.stoppoint"), args.begin(), args.end());
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ const llvm::StructType* GetDwarfAnchorType();
|
||||||
const llvm::StructType* GetDwarfCompileUnitType();
|
const llvm::StructType* GetDwarfCompileUnitType();
|
||||||
const llvm::StructType* GetDwarfSubProgramType();
|
const llvm::StructType* GetDwarfSubProgramType();
|
||||||
|
|
||||||
llvm::GlobalVariable* DtoDwarfCompileUnit(Module* m, bool define);
|
llvm::GlobalVariable* DtoDwarfCompileUnit(Module* m);
|
||||||
llvm::GlobalVariable* DtoDwarfSubProgram(FuncDeclaration* fd, llvm::GlobalVariable* compileUnit);
|
llvm::GlobalVariable* DtoDwarfSubProgram(FuncDeclaration* fd, llvm::GlobalVariable* compileUnit);
|
||||||
|
|
||||||
void DtoDwarfFuncStart(FuncDeclaration* fd);
|
void DtoDwarfFuncStart(FuncDeclaration* fd);
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
#include "gen/runtime.h"
|
#include "gen/runtime.h"
|
||||||
|
|
||||||
#include "ir/irvar.h"
|
#include "ir/irvar.h"
|
||||||
|
#include "ir/irmodule.h"
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -59,10 +60,15 @@ void Module::genobjfile()
|
||||||
deleteObjFile();
|
deleteObjFile();
|
||||||
|
|
||||||
// create a new ir state
|
// create a new ir state
|
||||||
|
// TODO look at making the instance static and moving most functionality into IrModule where it belongs
|
||||||
IRState ir;
|
IRState ir;
|
||||||
gIR = &ir;
|
gIR = &ir;
|
||||||
ir.dmodule = this;
|
ir.dmodule = this;
|
||||||
|
|
||||||
|
// module ir state
|
||||||
|
// might already exist via import, just overwrite...
|
||||||
|
irModule = new IrModule(this);
|
||||||
|
|
||||||
// name the module
|
// name the module
|
||||||
std::string mname(toChars());
|
std::string mname(toChars());
|
||||||
if (md != 0)
|
if (md != 0)
|
||||||
|
@ -88,7 +94,7 @@ void Module::genobjfile()
|
||||||
// debug info
|
// debug info
|
||||||
if (global.params.symdebug) {
|
if (global.params.symdebug) {
|
||||||
RegisterDwarfSymbols(ir.module);
|
RegisterDwarfSymbols(ir.module);
|
||||||
ir.dmodule->llvmCompileUnit = DtoDwarfCompileUnit(this,true);
|
DtoDwarfCompileUnit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// start out by providing opaque for the built-in class types
|
// start out by providing opaque for the built-in class types
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
IrModule::IrModule(Module* module)
|
IrModule::IrModule(Module* module)
|
||||||
{
|
{
|
||||||
M = module;
|
M = module;
|
||||||
|
dwarfCompileUnit = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
IrModule::~IrModule()
|
IrModule::~IrModule()
|
||||||
|
|
|
@ -11,6 +11,8 @@ struct IrModule : IrBase
|
||||||
virtual ~IrModule();
|
virtual ~IrModule();
|
||||||
|
|
||||||
Module* M;
|
Module* M;
|
||||||
|
|
||||||
|
llvm::GlobalVariable* dwarfCompileUnit;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -250,6 +250,16 @@ lphobos/typeinfos1.d
|
||||||
lphobos/typeinfos2.d
|
lphobos/typeinfos2.d
|
||||||
premake.lua
|
premake.lua
|
||||||
runalltests.d
|
runalltests.d
|
||||||
|
suite
|
||||||
|
suite/dwarfdebug
|
||||||
|
suite/dwarfdebug/dwarf1
|
||||||
|
suite/dwarfdebug/dwarf1/app.d
|
||||||
|
suite/dwarfdebug/dwarf1/build.sh
|
||||||
|
suite/dwarfdebug/dwarf1/lib.d
|
||||||
|
suite/dwarfdebug/dwarf2
|
||||||
|
suite/dwarfdebug/dwarf2/app.d
|
||||||
|
suite/dwarfdebug/dwarf2/build.sh
|
||||||
|
suite/dwarfdebug/dwarf2/lib.d
|
||||||
tango
|
tango
|
||||||
tango/lib
|
tango/lib
|
||||||
tango/lib/common
|
tango/lib/common
|
||||||
|
@ -759,6 +769,7 @@ tangotests/q.d
|
||||||
tangotests/r.d
|
tangotests/r.d
|
||||||
tangotests/s.d
|
tangotests/s.d
|
||||||
tangotests/t.d
|
tangotests/t.d
|
||||||
|
tangotests/u.d
|
||||||
test
|
test
|
||||||
test/a.d
|
test/a.d
|
||||||
test/aa1.d
|
test/aa1.d
|
||||||
|
|
12
suite/dwarfdebug/dwarf1/app.d
Normal file
12
suite/dwarfdebug/dwarf1/app.d
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
module app;
|
||||||
|
import lib;
|
||||||
|
|
||||||
|
void func()
|
||||||
|
{
|
||||||
|
lib_func();
|
||||||
|
}
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
func();
|
||||||
|
}
|
3
suite/dwarfdebug/dwarf1/build.sh
Executable file
3
suite/dwarfdebug/dwarf1/build.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
llvmdc lib.d -c -g -dis
|
||||||
|
llvmdc app.d lib.bc -g -dis -ofapp
|
7
suite/dwarfdebug/dwarf1/lib.d
Normal file
7
suite/dwarfdebug/dwarf1/lib.d
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
module lib;
|
||||||
|
|
||||||
|
void lib_func()
|
||||||
|
{
|
||||||
|
int* p;
|
||||||
|
*p = 666;
|
||||||
|
}
|
14
suite/dwarfdebug/dwarf2/app.d
Normal file
14
suite/dwarfdebug/dwarf2/app.d
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
module app;
|
||||||
|
import lib;
|
||||||
|
|
||||||
|
void func()
|
||||||
|
{
|
||||||
|
int* ip;
|
||||||
|
int i = lib_templ_func(ip);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(char[][] args)
|
||||||
|
{
|
||||||
|
func();
|
||||||
|
return 0;
|
||||||
|
}
|
3
suite/dwarfdebug/dwarf2/build.sh
Executable file
3
suite/dwarfdebug/dwarf2/build.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
llvmdc lib.d -c -g -dis
|
||||||
|
llvmdc app.d lib.bc -g -dis -ofapp
|
6
suite/dwarfdebug/dwarf2/lib.d
Normal file
6
suite/dwarfdebug/dwarf2/lib.d
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
module lib;
|
||||||
|
|
||||||
|
T lib_templ_func(T)(T* a)
|
||||||
|
{
|
||||||
|
return *a;
|
||||||
|
}
|
|
@ -22,14 +22,14 @@ MD=mkdir -p
|
||||||
ADD_CFLAGS=
|
ADD_CFLAGS=
|
||||||
ADD_DFLAGS=
|
ADD_DFLAGS=
|
||||||
|
|
||||||
CFLAGS=-O $(ADD_CFLAGS)
|
#CFLAGS=-O $(ADD_CFLAGS)
|
||||||
#CFLAGS=-g $(ADD_CFLAGS)
|
CFLAGS=-g $(ADD_CFLAGS)
|
||||||
|
|
||||||
DFLAGS=-release -O -inline -w -nofloat $(ADD_DFLAGS)
|
#DFLAGS=-release -O -inline -w $(ADD_DFLAGS)
|
||||||
#DFLAGS=-g -w -nofloat $(ADD_DFLAGS)
|
DFLAGS=-g -w $(ADD_DFLAGS)
|
||||||
|
|
||||||
TFLAGS=-O -inline -w -nofloat $(ADD_DFLAGS)
|
#TFLAGS=-O -inline -w $(ADD_DFLAGS)
|
||||||
#TFLAGS=-g -w -nofloat $(ADD_DFLAGS)
|
TFLAGS=-g -w $(ADD_DFLAGS)
|
||||||
|
|
||||||
DOCFLAGS=-version=DDoc
|
DOCFLAGS=-version=DDoc
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
extern (C):
|
extern (C):
|
||||||
|
|
||||||
debug = PRINTF;
|
//debug = PRINTF;
|
||||||
debug(PRINTF) int printf(char*, ...);
|
debug(PRINTF) int printf(char*, ...);
|
||||||
|
|
||||||
/******************************************
|
/******************************************
|
||||||
|
|
|
@ -20,14 +20,14 @@ CP=cp -f
|
||||||
RM=rm -f
|
RM=rm -f
|
||||||
MD=mkdir -p
|
MD=mkdir -p
|
||||||
|
|
||||||
CFLAGS=-O3 $(ADD_CFLAGS)
|
#CFLAGS=-O3 $(ADD_CFLAGS)
|
||||||
#CFLAGS=-g $(ADD_CFLAGS)
|
CFLAGS=-g $(ADD_CFLAGS)
|
||||||
|
|
||||||
DFLAGS=-release -O3 -inline -w $(ADD_DFLAGS)
|
#DFLAGS=-release -O3 -inline -w $(ADD_DFLAGS)
|
||||||
#DFLAGS=-g -w $(ADD_DFLAGS)
|
DFLAGS=-g -w $(ADD_DFLAGS)
|
||||||
|
|
||||||
TFLAGS=-O3 -inline -w $(ADD_DFLAGS)
|
#TFLAGS=-O3 -inline -w $(ADD_DFLAGS)
|
||||||
#TFLAGS=-g -w $(ADD_DFLAGS)
|
TFLAGS=-g -w $(ADD_DFLAGS)
|
||||||
|
|
||||||
DOCFLAGS=-version=DDoc
|
DOCFLAGS=-version=DDoc
|
||||||
|
|
||||||
|
|
|
@ -20,16 +20,16 @@ MD=mkdir -p
|
||||||
ADD_CFLAGS=
|
ADD_CFLAGS=
|
||||||
ADD_DFLAGS=
|
ADD_DFLAGS=
|
||||||
|
|
||||||
CFLAGS=-O $(ADD_CFLAGS)
|
#CFLAGS=-O $(ADD_CFLAGS)
|
||||||
#CFLAGS=-g $(ADD_CFLAGS)
|
CFLAGS=-g $(ADD_CFLAGS)
|
||||||
|
|
||||||
### warnings disabled because gcx has issues ###
|
### warnings disabled because gcx has issues ###
|
||||||
|
|
||||||
DFLAGS=-release -O -inline $(ADD_DFLAGS)
|
#DFLAGS=-release -O -inline $(ADD_DFLAGS)
|
||||||
#DFLAGS=-g $(ADD_DFLAGS)
|
DFLAGS=-g $(ADD_DFLAGS)
|
||||||
|
|
||||||
TFLAGS=-O -inline $(ADD_DFLAGS)
|
#TFLAGS=-O -inline $(ADD_DFLAGS)
|
||||||
#TFLAGS=-g $(ADD_DFLAGS)
|
TFLAGS=-g $(ADD_DFLAGS)
|
||||||
|
|
||||||
DOCFLAGS=-version=DDoc
|
DOCFLAGS=-version=DDoc
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@ public import tango.io.model.IBuffer,
|
||||||
extern (C)
|
extern (C)
|
||||||
{
|
{
|
||||||
protected void * memcpy (void *dst, void *src, uint);
|
protected void * memcpy (void *dst, void *src, uint);
|
||||||
private int printf(char*, ...);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
@ -164,18 +163,10 @@ class Buffer : IBuffer
|
||||||
|
|
||||||
this (IConduit conduit)
|
this (IConduit conduit)
|
||||||
{
|
{
|
||||||
printf("Buffer.this(%p)\n", conduit);
|
|
||||||
printf("assert (conduit !is null);\n");
|
|
||||||
assert (conduit !is null);
|
|
||||||
printf("assert (conduit);\n", conduit);
|
|
||||||
assert (conduit);
|
assert (conduit);
|
||||||
|
|
||||||
printf("this (conduit.bufferSize(%p));\n", conduit);
|
|
||||||
printf("cast(Object)conduit = %p\n", cast(Object)conduit);
|
|
||||||
this (conduit.bufferSize);
|
this (conduit.bufferSize);
|
||||||
setConduit (conduit);
|
setConduit (conduit);
|
||||||
|
|
||||||
assert(this !is null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -230,7 +221,6 @@ class Buffer : IBuffer
|
||||||
|
|
||||||
this (uint capacity = 0)
|
this (uint capacity = 0)
|
||||||
{
|
{
|
||||||
printf("Buffer.this(%p, %u)\n", this, capacity);
|
|
||||||
setContent (new ubyte[capacity], 0);
|
setContent (new ubyte[capacity], 0);
|
||||||
assert(this !is null);
|
assert(this !is null);
|
||||||
}
|
}
|
||||||
|
@ -551,7 +541,6 @@ class Buffer : IBuffer
|
||||||
|
|
||||||
IBuffer append (void* src, uint length)
|
IBuffer append (void* src, uint length)
|
||||||
{
|
{
|
||||||
printf("Buffer.append(%p, %u)\n", src, length);
|
|
||||||
if (length > writable)
|
if (length > writable)
|
||||||
// can we write externally?
|
// can we write externally?
|
||||||
if (sink)
|
if (sink)
|
||||||
|
@ -571,9 +560,7 @@ class Buffer : IBuffer
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
error (overflow);
|
error (overflow);
|
||||||
printf(" copying\n");
|
|
||||||
copy (src, length);
|
copy (src, length);
|
||||||
printf("returning\n");
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1097,7 +1084,6 @@ class Buffer : IBuffer
|
||||||
|
|
||||||
protected void copy (void *src, uint size)
|
protected void copy (void *src, uint size)
|
||||||
{
|
{
|
||||||
printf("Buffer.copy(%p, %u)\n", src, size);
|
|
||||||
// avoid "out of bounds" test on zero size
|
// avoid "out of bounds" test on zero size
|
||||||
if (size)
|
if (size)
|
||||||
{
|
{
|
||||||
|
@ -1105,7 +1091,6 @@ class Buffer : IBuffer
|
||||||
memcpy (&data[extent], src, size);
|
memcpy (&data[extent], src, size);
|
||||||
extent += size;
|
extent += size;
|
||||||
}
|
}
|
||||||
printf(" copy done\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
|
@ -23,7 +23,6 @@ private import tango.io.Buffer,
|
||||||
version (Posix)
|
version (Posix)
|
||||||
private import tango.stdc.posix.unistd; // needed for isatty()
|
private import tango.stdc.posix.unistd; // needed for isatty()
|
||||||
|
|
||||||
private extern(C) int printf(char*, ...);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
|
||||||
|
@ -70,7 +69,6 @@ struct Console
|
||||||
|
|
||||||
private this (Conduit conduit, bool redirected)
|
private this (Conduit conduit, bool redirected)
|
||||||
{
|
{
|
||||||
printf("Console.Input.this(%p, %d)\n", conduit, redirected);
|
|
||||||
assert (conduit);
|
assert (conduit);
|
||||||
redirect = redirected;
|
redirect = redirected;
|
||||||
buffer = new Buffer (conduit);
|
buffer = new Buffer (conduit);
|
||||||
|
@ -599,7 +597,6 @@ struct Console
|
||||||
|
|
||||||
private this (Handle handle)
|
private this (Handle handle)
|
||||||
{
|
{
|
||||||
printf("Console.Conduit.this(%d)\n", handle);
|
|
||||||
reopen (handle);
|
reopen (handle);
|
||||||
redirected = (isatty(handle) is 0);
|
redirected = (isatty(handle) is 0);
|
||||||
}
|
}
|
||||||
|
@ -627,18 +624,12 @@ static Console.Output Cout, /// the standard output stream
|
||||||
|
|
||||||
static this ()
|
static this ()
|
||||||
{
|
{
|
||||||
printf("STATIC INIT FOR CONSOLE\n");
|
|
||||||
printf("Cin conduit\n");
|
|
||||||
auto conduit = new Console.Conduit (0);
|
auto conduit = new Console.Conduit (0);
|
||||||
assert(conduit);
|
|
||||||
printf("Cin input\n");
|
|
||||||
Cin = new Console.Input (conduit, conduit.redirected);
|
Cin = new Console.Input (conduit, conduit.redirected);
|
||||||
|
|
||||||
printf("Cout\n");
|
|
||||||
conduit = new Console.Conduit (1);
|
conduit = new Console.Conduit (1);
|
||||||
Cout = new Console.Output (conduit, conduit.redirected);
|
Cout = new Console.Output (conduit, conduit.redirected);
|
||||||
|
|
||||||
printf("Cerr\n");
|
|
||||||
conduit = new Console.Conduit (2);
|
conduit = new Console.Conduit (2);
|
||||||
Cerr = new Console.Output (conduit, conduit.redirected);
|
Cerr = new Console.Output (conduit, conduit.redirected);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,6 @@ public import tango.io.Conduit;
|
||||||
|
|
||||||
private import tango.core.Exception;
|
private import tango.core.Exception;
|
||||||
|
|
||||||
private extern(C) int printf(char*, ...);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
|
||||||
Implements a means of reading and writing a file device. Conduits
|
Implements a means of reading and writing a file device. Conduits
|
||||||
|
|
|
@ -2,13 +2,5 @@ import tango.io.Console;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
printf("enter\n");
|
|
||||||
assert(Cout !is null);
|
|
||||||
printf("newline\n");
|
|
||||||
Cout.newline;
|
|
||||||
printf("hi message\n");
|
|
||||||
Cout("Hi, says LLVMDC + Tango").newline;
|
Cout("Hi, says LLVMDC + Tango").newline;
|
||||||
printf("exit\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern(C) int printf(char*,...);
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue