Skip to content

Commit

Permalink
Merge pull request #1408 from yebblies/removedotnet
Browse files Browse the repository at this point in the history
Remove TARGET_NET from dmd
  • Loading branch information
Don Clugston committed Jan 15, 2013
2 parents e3576bf + 23431f5 commit d6ee65e
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 87 deletions.
39 changes: 0 additions & 39 deletions src/attrib.c
Expand Up @@ -27,9 +27,6 @@
#include "module.h"
#include "parse.h"
#include "template.h"
#if TARGET_NET
#include "frontend.net/pragma.h"
#endif

extern bool obj_includelib(const char *name);
void obj_startaddress(Symbol *s);
Expand Down Expand Up @@ -945,37 +942,6 @@ Dsymbol *PragmaDeclaration::syntaxCopy(Dsymbol *s)

void PragmaDeclaration::setScope(Scope *sc)
{
#if TARGET_NET
if (ident == Lexer::idPool("assembly"))
{
if (!args || args->dim != 1)
{
error("pragma has invalid number of arguments");
}
else
{
Expression *e = (*args)[0];
e = e->semantic(sc);
e = resolveProperties(sc, e);
e = e->ctfeInterpret();
(*args)[0] = e;
StringExp* se = e->toString();
if (!se)
{
error("string expected, not '%s'", e->toChars());
}
PragmaScope* pragma = new PragmaScope(this, sc->parent, se);

assert(sc);
pragma->setScope(sc);

//add to module members
assert(sc->module);
assert(sc->module->members);
sc->module->members->push(pragma);
}
}
#endif // TARGET_NET
}

void PragmaDeclaration::semantic(Scope *sc)
Expand Down Expand Up @@ -1095,11 +1061,6 @@ void PragmaDeclaration::semantic(Scope *sc)
goto Lnodecl;
}
#endif
#if TARGET_NET
else if (ident == Lexer::idPool("assembly"))
{
}
#endif // TARGET_NET
else if (global.params.ignoreUnsupportedPragmas)
{
if (global.params.verbose)
Expand Down
1 change: 0 additions & 1 deletion src/declaration.h
Expand Up @@ -634,7 +634,6 @@ struct FuncDeclaration : Declaration
void semantic2(Scope *sc);
void semantic3(Scope *sc);
// called from semantic3
void varArgs(Scope *sc, TypeFunction*, VarDeclaration *&, VarDeclaration *&);
VarDeclaration *declareThis(Scope *sc, AggregateDeclaration *ad);
int equals(Object *o);

Expand Down
10 changes: 0 additions & 10 deletions src/dsymbol.c
Expand Up @@ -204,16 +204,6 @@ const char *Dsymbol::toPrettyChars()
if (q == s)
break;
q--;
#if TARGET_NET
if (AggregateDeclaration* ad = p->isAggregateDeclaration())
{
if (ad->isNested() && p->parent && p->parent->isAggregateDeclaration())
{
*q = '/';
continue;
}
}
#endif
*q = '.';
}
return s;
Expand Down
6 changes: 0 additions & 6 deletions src/dsymbol.h
Expand Up @@ -72,9 +72,6 @@ struct DeleteDeclaration;
struct HdrGenState;
struct OverloadSet;
struct AA;
#if TARGET_NET
struct PragmaScope;
#endif
#ifdef IN_GCC
union tree_node;
typedef union tree_node TYPE;
Expand Down Expand Up @@ -257,9 +254,6 @@ struct Dsymbol : Object
virtual SymbolDeclaration *isSymbolDeclaration() { return NULL; }
virtual AttribDeclaration *isAttribDeclaration() { return NULL; }
virtual OverloadSet *isOverloadSet() { return NULL; }
#if TARGET_NET
virtual PragmaScope* isPragmaScope() { return NULL; }
#endif
};

// Dsymbol that generates a scope
Expand Down
4 changes: 0 additions & 4 deletions src/func.c
Expand Up @@ -922,9 +922,6 @@ void FuncDeclaration::semantic3(Scope *sc)
// Declare hidden variable _arguments[] and _argptr
if (f->varargs == 1)
{
#if TARGET_NET
varArgs(sc2, f, argptr, _arguments);
#else
Type *t;

#ifndef IN_GCC
Expand Down Expand Up @@ -974,7 +971,6 @@ void FuncDeclaration::semantic3(Scope *sc)
sc2->insert(argptr);
argptr->parent = this;
}
#endif
}

#if 0
Expand Down
7 changes: 0 additions & 7 deletions src/import.c
Expand Up @@ -93,22 +93,16 @@ void Import::load(Scope *sc)

// See if existing module
DsymbolTable *dst = Package::resolve(packages, NULL, &pkg);
#if TARGET_NET //dot net needs modules and packages with same name
#else
if (pkg && pkg->isModule())
{
::error(loc, "can only import from a module, not from a member of module %s. Did you mean `import %s : %s`?",
pkg->toChars(), pkg->toPrettyChars(), id->toChars());
mod = pkg->isModule(); // Error recovery - treat as import of that module
return;
}
#endif
Dsymbol *s = dst->lookup(id);
if (s)
{
#if TARGET_NET
mod = (Module *)s;
#else
if (s->isModule())
mod = (Module *)s;
else
Expand All @@ -124,7 +118,6 @@ void Import::load(Scope *sc)
id->toChars());
}
}
#endif
}

if (!mod)
Expand Down
13 changes: 1 addition & 12 deletions src/mars.c
Expand Up @@ -67,7 +67,6 @@ Global::Global()
obj_ext = "obj";
#elif TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_SOLARIS
obj_ext = "o";
#elif TARGET_NET
#else
#error "fix this"
#endif
Expand All @@ -76,7 +75,6 @@ Global::Global()
lib_ext = "lib";
#elif TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_SOLARIS
lib_ext = "a";
#elif TARGET_NET
#else
#error "fix this"
#endif
Expand All @@ -92,11 +90,7 @@ Global::Global()
#endif

copyright = "Copyright (c) 1999-2012 by Digital Mars";
written = "written by Walter Bright"
#if TARGET_NET
"\nMSIL back-end (alpha release) by Cristian L. Vlasceanu and associates.";
#endif
;
written = "written by Walter Bright";
version = "v"
#include "verstr.h"
;
Expand Down Expand Up @@ -464,7 +458,6 @@ int tryMain(size_t argc, char *argv[])
global.params.defaultlibname = "phobos";
#elif TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_SOLARIS
global.params.defaultlibname = "phobos2";
#elif TARGET_NET
#else
#error "fix this"
#endif
Expand All @@ -475,10 +468,6 @@ int tryMain(size_t argc, char *argv[])
#if TARGET_WINDOS
VersionCondition::addPredefinedGlobalIdent("Windows");
global.params.isWindows = 1;
#if TARGET_NET
// TARGET_NET macro is NOT mutually-exclusive with TARGET_WINDOS
VersionCondition::addPredefinedGlobalIdent("D_NET");
#endif
#elif TARGET_LINUX
VersionCondition::addPredefinedGlobalIdent("Posix");
VersionCondition::addPredefinedGlobalIdent("linux");
Expand Down
1 change: 0 additions & 1 deletion src/mars.h
Expand Up @@ -51,7 +51,6 @@ the target object file format:
TARGET_FREEBSD Covers 32 and 64 bit FreeBSD
TARGET_OPENBSD Covers 32 and 64 bit OpenBSD
TARGET_SOLARIS Covers 32 and 64 bit Solaris
TARGET_NET Covers .Net
It is expected that the compiler for each platform will be able
to generate 32 and 64 bit code from the same compiler binary.
Expand Down
3 changes: 0 additions & 3 deletions src/module.c
Expand Up @@ -1160,15 +1160,12 @@ DsymbolTable *Package::resolve(Identifiers *packages, Dsymbol **pparent, Package
dst = ((Package *)p)->symtab;
if (ppkg && !*ppkg)
*ppkg = (Package *)p;
#if TARGET_NET
#else
if (p->isModule())
{ // Return the module so that a nice error message can be generated
if (ppkg)
*ppkg = (Package *)p;
break;
}
#endif
}
if (pparent)
{
Expand Down
4 changes: 0 additions & 4 deletions src/typinf.c
Expand Up @@ -27,7 +27,6 @@
#include "import.h"
#include "aggregate.h"

#ifndef TARGET_NET
#include "rmem.h"
#include "cc.h"
#include "global.h"
Expand All @@ -38,7 +37,6 @@
#include "cgcv.h"
#include "outbuf.h"
#include "irstate.h"
#endif

extern Symbol *static_sym();

Expand Down Expand Up @@ -241,7 +239,6 @@ TypeInfoDeclaration *TypeTuple::getTypeInfoDeclaration()
return new TypeInfoTupleDeclaration(this);
}

#ifndef TARGET_NET
/****************************************************
*/

Expand Down Expand Up @@ -862,7 +859,6 @@ void TypeInfoDeclaration::toObjFile(int multiobj)
}

#endif
#endif // TARGET_NET

/* ========================================================================= */

Expand Down

0 comments on commit d6ee65e

Please sign in to comment.