[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:
Tomas Lindquist Olsen 2008-01-22 00:01:16 +01:00
parent 7825be29ee
commit 94c47aa1fa
33 changed files with 194 additions and 108 deletions

View file

@ -1099,6 +1099,7 @@ int VarDeclaration::hasPointers()
Expression *VarDeclaration::callAutoDtor()
{ Expression *e = NULL;
//printf("VarDeclaration::callAutoDtor() %s\n", toChars());
if (storage_class & (STCauto | STCscope) && !noauto)
{
for (ClassDeclaration *cd = type->isClassHandle();
@ -1109,6 +1110,8 @@ Expression *VarDeclaration::callAutoDtor()
* classes to determine if there's no way the monitor
* could be set.
*/
if (cd->isInterfaceDeclaration())
error("interface %s cannot be scope", cd->toChars());
if (1 || onstack || cd->dtors.dim) // if any destructors
{
// delete this;

View file

@ -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: assignments to ref should also be type 'invariant'
arg = arg->modifiableLvalue(sc, NULL);
arg = arg->modifiableLvalue(sc, arg);
//if (arg->op == TOKslice)
//arg->error("cannot modify slice %s", arg->toChars());
@ -4357,7 +4357,7 @@ Expression *BinExp::commonSemanticAssign(Scope *sc)
if (e)
return e;
e1 = e1->modifiableLvalue(sc, NULL);
e1 = e1->modifiableLvalue(sc, e1);
e1->checkScalar();
type = e1->type;
if (type->toBasetype()->ty == Tbool)
@ -4388,7 +4388,7 @@ Expression *BinExp::commonSemanticAssignIntegral(Scope *sc)
if (e)
return e;
e1 = e1->modifiableLvalue(sc, NULL);
e1 = e1->modifiableLvalue(sc, e1);
e1->checkScalar();
type = e1->type;
if (type->toBasetype()->ty == Tbool)
@ -6874,7 +6874,7 @@ Expression *PostExp::semantic(Scope *sc)
return e;
e = this;
e1 = e1->modifiableLvalue(sc, NULL);
e1 = e1->modifiableLvalue(sc, e1);
e1->checkScalar();
e1->checkNoBool();
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
ArrayLengthExp *ale = (ArrayLengthExp *)e1;
ale->e1 = ale->e1->modifiableLvalue(sc, NULL);
ale->e1 = ale->e1->modifiableLvalue(sc, e1);
}
else if (e1->op == TOKslice)
;
@ -7122,7 +7122,7 @@ Expression *AddAssignExp::semantic(Scope *sc)
if (e)
return e;
e1 = e1->modifiableLvalue(sc, NULL);
e1 = e1->modifiableLvalue(sc, e1);
Type *tb1 = e1->type->toBasetype();
Type *tb2 = e2->type->toBasetype();
@ -7222,7 +7222,7 @@ Expression *MinAssignExp::semantic(Scope *sc)
if (e)
return e;
e1 = e1->modifiableLvalue(sc, NULL);
e1 = e1->modifiableLvalue(sc, e1);
e1->checkScalar();
e1->checkNoBool();
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());
}
e1 = e1->modifiableLvalue(sc, NULL);
e1 = e1->modifiableLvalue(sc, e1);
Type *tb1 = e1->type->toBasetype();
Type *tb2 = e2->type->toBasetype();
@ -7316,7 +7316,7 @@ Expression *MulAssignExp::semantic(Scope *sc)
if (e)
return e;
e1 = e1->modifiableLvalue(sc, NULL);
e1 = e1->modifiableLvalue(sc, e1);
e1->checkScalar();
e1->checkNoBool();
type = e1->type;
@ -7372,7 +7372,7 @@ Expression *DivAssignExp::semantic(Scope *sc)
if (e)
return e;
e1 = e1->modifiableLvalue(sc, NULL);
e1 = e1->modifiableLvalue(sc, e1);
e1->checkScalar();
e1->checkNoBool();
type = e1->type;
@ -7443,7 +7443,7 @@ Expression *ShlAssignExp::semantic(Scope *sc)
if (e)
return e;
e1 = e1->modifiableLvalue(sc, NULL);
e1 = e1->modifiableLvalue(sc, e1);
e1->checkScalar();
e1->checkNoBool();
type = e1->type;
@ -7472,7 +7472,7 @@ Expression *ShrAssignExp::semantic(Scope *sc)
if (e)
return e;
e1 = e1->modifiableLvalue(sc, NULL);
e1 = e1->modifiableLvalue(sc, e1);
e1->checkScalar();
e1->checkNoBool();
type = e1->type;
@ -7501,7 +7501,7 @@ Expression *UshrAssignExp::semantic(Scope *sc)
if (e)
return e;
e1 = e1->modifiableLvalue(sc, NULL);
e1 = e1->modifiableLvalue(sc, e1);
e1->checkScalar();
e1->checkNoBool();
type = e1->type;

View file

@ -2162,7 +2162,7 @@ done:
break;
if (d >= r)
break;
if (n * r + d < n)
if (n && n * r + d <= n)
{
error ("integer overflow");
break;

View file

@ -141,8 +141,10 @@ char *FuncDeclaration::mangle()
if (isMain())
return "_Dmain";
if (isWinMain() || isDllMain())
return ident->toChars();
assert(this);
return Declaration::mangle();
}

View file

@ -1,5 +1,5 @@
// Compiler implementation of the D programming language
// Copyright (c) 1999-2007 by Digital Mars
// Copyright (c) 1999-2008 by Digital Mars
// All Rights Reserved
// written by Walter Bright
// http://www.digitalmars.com
@ -68,10 +68,10 @@ Global::Global()
#error "fix this"
#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";
llvmdc_version = "0.1";
version = "v1.025";
version = "v1.026";
global.structalign = 8;
memset(&params, 0, sizeof(Param));
@ -823,7 +823,6 @@ int main(int argc, char *argv[])
continue;
}
#if !IN_LLVM
#if TARGET_LINUX
if (strcmp(ext, "a") == 0)
#else
@ -833,7 +832,6 @@ int main(int argc, char *argv[])
global.params.libfiles->push(files.data[i]);
continue;
}
#endif
if (strcmp(ext, global.ddoc_ext) == 0)
{

View file

@ -162,7 +162,7 @@ Module::Module(char *filename, Identifier *ident, int doDocComment, int doHdrGen
symfile = new File(symfilename);
// LLVMDC
llvmCompileUnit = 0;
irModule = NULL;
}
void Module::setDocfile()

View file

@ -29,7 +29,7 @@ struct VarDeclaration;
#if IN_LLVM
struct DValue;
typedef DValue elem;
namespace llvm { class GlobalVariable; }
struct IrModule;
#else
#ifdef IN_GCC
union tree_node; typedef union tree_node elem;
@ -169,7 +169,7 @@ struct Module : Package
void genmoduleinfo();
// LLVMDC
llvm::GlobalVariable* llvmCompileUnit;
IrModule* irModule;
Module *isModule() { return this; }
};

View file

@ -3973,6 +3973,15 @@ Expression *TypeTypedef::dotExp(Scope *sc, Expression *e, Identifier *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()
{
return sym->basetype->isbit();
@ -4276,6 +4285,18 @@ L1:
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();
#ifdef DEBUG
if (!d)
@ -4646,6 +4667,18 @@ L1:
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();
if (!d)
{

View file

@ -587,6 +587,7 @@ struct TypeTypedef : Type
void toTypeInfoBuffer(OutBuffer *buf);
void toCBuffer2(OutBuffer *buf, Identifier *ident, HdrGenState *hgs);
Expression *dotExp(Scope *sc, Expression *e, Identifier *ident);
Expression *getProperty(Loc loc, Identifier *ident);
int isbit();
int isintegral();
int isfloating();

View file

@ -1219,13 +1219,12 @@ Lerr:
TemplateParameters *Parser::parseTemplateParameterList()
{
TemplateParameters *tpl;
TemplateParameters *tpl = new TemplateParameters();
if (token.value != TOKlparen)
{ error("parenthesized TemplateParameterList expected following TemplateIdentifier");
goto Lerr;
}
tpl = new TemplateParameters();
nextToken();
// Get array of TemplateParameters
@ -1309,7 +1308,7 @@ TemplateParameters *Parser::parseTemplateParameterList()
if (!tp_ident)
{
error("no identifier for template value parameter");
goto Lerr;
tp_ident = new Identifier("error", TOKidentifier);
}
if (token.value == TOKcolon) // : CondExpression
{
@ -1330,10 +1329,8 @@ TemplateParameters *Parser::parseTemplateParameterList()
}
}
check(TOKrparen);
return tpl;
Lerr:
return NULL;
return tpl;
}
/******************************************

View file

@ -1982,6 +1982,7 @@ Statement *SwitchStatement::semantic(Scope *sc)
{ condition = condition->integralPromotions(sc);
condition->checkIntegral();
}
condition = condition->optimize(WANTvalue);
sc = sc->push();
sc->sbreak = this;

View file

@ -1,6 +1,6 @@
// Compiler implementation of the D programming language
// Copyright (c) 1999-2007 by Digital Mars
// Copyright (c) 1999-2008 by Digital Mars
// All Rights Reserved
// written by Walter Bright
// http://www.digitalmars.com
@ -1540,6 +1540,9 @@ MATCH TypeInstance::deduceType(Scope *sc,
else if (tempinst->tempdecl != tp->tempinst->tempdecl)
goto Lnomatch;
if (tempinst->tiargs->dim != tp->tempinst->tiargs->dim)
goto Lnomatch;
for (int i = 0; i < tempinst->tiargs->dim; 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->optimize(WANTvalue | WANTinterpret);
tiargs->data[j] = ea;
if (ea->op == TOKtype)
tiargs->data[j] = ea->type;
}
else if (sa)
{
@ -3292,6 +3297,9 @@ int TemplateInstance::isNested(Objects *args)
Lsa:
Declaration *d = sa->isDeclaration();
if (d && !d->isDataseg() &&
#if V2
!(d->storage_class & STCmanifest) &&
#endif
(!d->isFuncDeclaration() || d->isFuncDeclaration()->isNested()) &&
!isTemplateMixin())
{

View file

@ -459,10 +459,7 @@ void DtoDefineFunc(FuncDeclaration* fd)
// debug info
if (global.params.symdebug) {
Module* mo = fd->getModule();
if (!mo->llvmCompileUnit) {
mo->llvmCompileUnit = DtoDwarfCompileUnit(mo,false);
}
fd->irFunc->dwarfSubProg = DtoDwarfSubProgram(fd, mo->llvmCompileUnit);
fd->irFunc->dwarfSubProg = DtoDwarfSubProgram(fd, DtoDwarfCompileUnit(mo));
}
Type* t = DtoDType(fd->type);

View file

@ -11,6 +11,8 @@
#include "gen/tollvm.h"
#include "gen/logger.h"
#include "ir/irmodule.h"
using namespace llvm::dwarf;
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 (1 || define) {
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()));
//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);
if (!m->irModule)
m->irModule = new IrModule(m);
else if (m->irModule->dwarfCompileUnit)
{
if (m->irModule->dwarfCompileUnit->getParent() == gIR->module)
return m->irModule->dwarfCompileUnit;
}
// 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);
gv->setSection("llvm.metadata");
m->irModule->dwarfCompileUnit = gv;
return gv;
}
@ -181,7 +196,7 @@ void DtoDwarfStopPoint(unsigned ln)
std::vector<llvm::Value*> args;
args.push_back(DtoConstUint(ln));
args.push_back(DtoConstUint(0));
assert(gIR->dmodule->llvmCompileUnit);
args.push_back(dbgToArrTy(gIR->dmodule->llvmCompileUnit));
FuncDeclaration* fd = gIR->func()->decl;
args.push_back(dbgToArrTy(DtoDwarfCompileUnit(fd->getModule())));
gIR->ir->CreateCall(gIR->module->getFunction("llvm.dbg.stoppoint"), args.begin(), args.end());
}

View file

@ -7,7 +7,7 @@ const llvm::StructType* GetDwarfAnchorType();
const llvm::StructType* GetDwarfCompileUnitType();
const llvm::StructType* GetDwarfSubProgramType();
llvm::GlobalVariable* DtoDwarfCompileUnit(Module* m, bool define);
llvm::GlobalVariable* DtoDwarfCompileUnit(Module* m);
llvm::GlobalVariable* DtoDwarfSubProgram(FuncDeclaration* fd, llvm::GlobalVariable* compileUnit);
void DtoDwarfFuncStart(FuncDeclaration* fd);

View file

@ -42,6 +42,7 @@
#include "gen/runtime.h"
#include "ir/irvar.h"
#include "ir/irmodule.h"
//////////////////////////////////////////////////////////////////////////////////////////
@ -59,10 +60,15 @@ void Module::genobjfile()
deleteObjFile();
// create a new ir state
// TODO look at making the instance static and moving most functionality into IrModule where it belongs
IRState ir;
gIR = &ir;
ir.dmodule = this;
// module ir state
// might already exist via import, just overwrite...
irModule = new IrModule(this);
// name the module
std::string mname(toChars());
if (md != 0)
@ -88,7 +94,7 @@ void Module::genobjfile()
// debug info
if (global.params.symdebug) {
RegisterDwarfSymbols(ir.module);
ir.dmodule->llvmCompileUnit = DtoDwarfCompileUnit(this,true);
DtoDwarfCompileUnit(this);
}
// start out by providing opaque for the built-in class types

View file

@ -3,6 +3,7 @@
IrModule::IrModule(Module* module)
{
M = module;
dwarfCompileUnit = NULL;
}
IrModule::~IrModule()

View file

@ -11,6 +11,8 @@ struct IrModule : IrBase
virtual ~IrModule();
Module* M;
llvm::GlobalVariable* dwarfCompileUnit;
};
#endif

View file

@ -250,6 +250,16 @@ lphobos/typeinfos1.d
lphobos/typeinfos2.d
premake.lua
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/lib
tango/lib/common
@ -759,6 +769,7 @@ tangotests/q.d
tangotests/r.d
tangotests/s.d
tangotests/t.d
tangotests/u.d
test
test/a.d
test/aa1.d

View file

@ -0,0 +1,12 @@
module app;
import lib;
void func()
{
lib_func();
}
void main()
{
func();
}

View file

@ -0,0 +1,3 @@
#!/bin/bash
llvmdc lib.d -c -g -dis
llvmdc app.d lib.bc -g -dis -ofapp

View file

@ -0,0 +1,7 @@
module lib;
void lib_func()
{
int* p;
*p = 666;
}

View 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;
}

View file

@ -0,0 +1,3 @@
#!/bin/bash
llvmdc lib.d -c -g -dis
llvmdc app.d lib.bc -g -dis -ofapp

View file

@ -0,0 +1,6 @@
module lib;
T lib_templ_func(T)(T* a)
{
return *a;
}

View file

@ -22,14 +22,14 @@ MD=mkdir -p
ADD_CFLAGS=
ADD_DFLAGS=
CFLAGS=-O $(ADD_CFLAGS)
#CFLAGS=-g $(ADD_CFLAGS)
#CFLAGS=-O $(ADD_CFLAGS)
CFLAGS=-g $(ADD_CFLAGS)
DFLAGS=-release -O -inline -w -nofloat $(ADD_DFLAGS)
#DFLAGS=-g -w -nofloat $(ADD_DFLAGS)
#DFLAGS=-release -O -inline -w $(ADD_DFLAGS)
DFLAGS=-g -w $(ADD_DFLAGS)
TFLAGS=-O -inline -w -nofloat $(ADD_DFLAGS)
#TFLAGS=-g -w -nofloat $(ADD_DFLAGS)
#TFLAGS=-O -inline -w $(ADD_DFLAGS)
TFLAGS=-g -w $(ADD_DFLAGS)
DOCFLAGS=-version=DDoc

View file

@ -27,7 +27,7 @@
extern (C):
debug = PRINTF;
//debug = PRINTF;
debug(PRINTF) int printf(char*, ...);
/******************************************

View file

@ -20,14 +20,14 @@ CP=cp -f
RM=rm -f
MD=mkdir -p
CFLAGS=-O3 $(ADD_CFLAGS)
#CFLAGS=-g $(ADD_CFLAGS)
#CFLAGS=-O3 $(ADD_CFLAGS)
CFLAGS=-g $(ADD_CFLAGS)
DFLAGS=-release -O3 -inline -w $(ADD_DFLAGS)
#DFLAGS=-g -w $(ADD_DFLAGS)
#DFLAGS=-release -O3 -inline -w $(ADD_DFLAGS)
DFLAGS=-g -w $(ADD_DFLAGS)
TFLAGS=-O3 -inline -w $(ADD_DFLAGS)
#TFLAGS=-g -w $(ADD_DFLAGS)
#TFLAGS=-O3 -inline -w $(ADD_DFLAGS)
TFLAGS=-g -w $(ADD_DFLAGS)
DOCFLAGS=-version=DDoc

View file

@ -20,16 +20,16 @@ MD=mkdir -p
ADD_CFLAGS=
ADD_DFLAGS=
CFLAGS=-O $(ADD_CFLAGS)
#CFLAGS=-g $(ADD_CFLAGS)
#CFLAGS=-O $(ADD_CFLAGS)
CFLAGS=-g $(ADD_CFLAGS)
### warnings disabled because gcx has issues ###
DFLAGS=-release -O -inline $(ADD_DFLAGS)
#DFLAGS=-g $(ADD_DFLAGS)
#DFLAGS=-release -O -inline $(ADD_DFLAGS)
DFLAGS=-g $(ADD_DFLAGS)
TFLAGS=-O -inline $(ADD_DFLAGS)
#TFLAGS=-g $(ADD_DFLAGS)
#TFLAGS=-O -inline $(ADD_DFLAGS)
TFLAGS=-g $(ADD_DFLAGS)
DOCFLAGS=-version=DDoc

View file

@ -25,7 +25,6 @@ public import tango.io.model.IBuffer,
extern (C)
{
protected void * memcpy (void *dst, void *src, uint);
private int printf(char*, ...);
}
/*******************************************************************************
@ -164,18 +163,10 @@ class Buffer : IBuffer
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);
printf("this (conduit.bufferSize(%p));\n", conduit);
printf("cast(Object)conduit = %p\n", cast(Object)conduit);
this (conduit.bufferSize);
setConduit (conduit);
assert(this !is null);
}
/***********************************************************************
@ -230,7 +221,6 @@ class Buffer : IBuffer
this (uint capacity = 0)
{
printf("Buffer.this(%p, %u)\n", this, capacity);
setContent (new ubyte[capacity], 0);
assert(this !is null);
}
@ -551,7 +541,6 @@ class Buffer : IBuffer
IBuffer append (void* src, uint length)
{
printf("Buffer.append(%p, %u)\n", src, length);
if (length > writable)
// can we write externally?
if (sink)
@ -571,9 +560,7 @@ class Buffer : IBuffer
}
else
error (overflow);
printf(" copying\n");
copy (src, length);
printf("returning\n");
return this;
}
@ -1097,7 +1084,6 @@ class Buffer : IBuffer
protected void copy (void *src, uint size)
{
printf("Buffer.copy(%p, %u)\n", src, size);
// avoid "out of bounds" test on zero size
if (size)
{
@ -1105,7 +1091,6 @@ class Buffer : IBuffer
memcpy (&data[extent], src, size);
extent += size;
}
printf(" copy done\n");
}
/***********************************************************************

View file

@ -23,7 +23,6 @@ private import tango.io.Buffer,
version (Posix)
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)
{
printf("Console.Input.this(%p, %d)\n", conduit, redirected);
assert (conduit);
redirect = redirected;
buffer = new Buffer (conduit);
@ -599,7 +597,6 @@ struct Console
private this (Handle handle)
{
printf("Console.Conduit.this(%d)\n", handle);
reopen (handle);
redirected = (isatty(handle) is 0);
}
@ -627,18 +624,12 @@ static Console.Output Cout, /// the standard output stream
static this ()
{
printf("STATIC INIT FOR CONSOLE\n");
printf("Cin conduit\n");
auto conduit = new Console.Conduit (0);
assert(conduit);
printf("Cin input\n");
Cin = new Console.Input (conduit, conduit.redirected);
printf("Cout\n");
conduit = new Console.Conduit (1);
Cout = new Console.Output (conduit, conduit.redirected);
printf("Cerr\n");
conduit = new Console.Conduit (2);
Cerr = new Console.Output (conduit, conduit.redirected);
}

View file

@ -18,8 +18,6 @@ public import tango.io.Conduit;
private import tango.core.Exception;
private extern(C) int printf(char*, ...);
/*******************************************************************************
Implements a means of reading and writing a file device. Conduits

View file

@ -2,13 +2,5 @@ import tango.io.Console;
void main()
{
printf("enter\n");
assert(Cout !is null);
printf("newline\n");
Cout.newline;
printf("hi message\n");
Cout("Hi, says LLVMDC + Tango").newline;
printf("exit\n");
}
extern(C) int printf(char*,...);