Skip to content

Commit

Permalink
Removed _DH preprocessor flag.
Browse files Browse the repository at this point in the history
It was once used to enable .di generation, but as DMD doesn't even compile without it anymore, there is little point in leaving it in.
  • Loading branch information
dnadlinger committed Jun 13, 2011
1 parent d5fbd53 commit c759840
Show file tree
Hide file tree
Showing 26 changed files with 29 additions and 89 deletions.
2 changes: 0 additions & 2 deletions src/attrib.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ struct LabelDsymbol;
struct Initializer;
struct Module;
struct Condition;
#ifdef _DH
struct HdrGenState;
#endif

/**************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion src/backend/strtold.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ long double strtold(const char *p,char **endp)
L1:
if (endp)
{
*endp = (void *) p;
*endp = (char *) p;
}
L3:
#if _WIN32
Expand Down
2 changes: 0 additions & 2 deletions src/cond.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@
#include "module.h"
#include "template.h"
#include "lexer.h"
#ifdef _DH
#include "mtype.h"
#include "scope.h"
#endif

int findCondition(Array *ids, Identifier *ident)
{
Expand Down
4 changes: 0 additions & 4 deletions src/cond.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@ struct Module;
struct Scope;
struct ScopeDsymbol;
struct DebugCondition;
#ifdef _DH
#include "lexer.h" // dmdhg
#endif
enum TOK;
#ifdef _DH
struct HdrGenState;
#endif

int findCondition(Array *ids, Identifier *ident);

Expand Down
22 changes: 7 additions & 15 deletions src/declaration.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,8 @@ TypedefDeclaration::TypedefDeclaration(Loc loc, Identifier *id, Type *basetype,
this->type = new TypeTypedef(this);
this->basetype = basetype->toBasetype();
this->init = init;
#ifdef _DH
this->htype = NULL;
this->hbasetype = NULL;
#endif
this->loc = loc;
this->sinit = NULL;
}
Expand All @@ -273,7 +271,7 @@ Dsymbol *TypedefDeclaration::syntaxCopy(Dsymbol *s)
assert(!s);
TypedefDeclaration *st;
st = new TypedefDeclaration(loc, ident, basetype, init);
#ifdef _DH

// Syntax copy for header file
if (!htype) // Don't overwrite original
{ if (type) // Make copy for both old and new instances
Expand All @@ -291,7 +289,7 @@ Dsymbol *TypedefDeclaration::syntaxCopy(Dsymbol *s)
}
else
st->hbasetype = hbasetype->syntaxCopy();
#endif

return st;
}

Expand Down Expand Up @@ -368,10 +366,8 @@ AliasDeclaration::AliasDeclaration(Loc loc, Identifier *id, Type *type)
this->loc = loc;
this->type = type;
this->aliassym = NULL;
#ifdef _DH
this->htype = NULL;
this->haliassym = NULL;
#endif
this->overnext = NULL;
this->inSemantic = 0;
assert(type);
Expand All @@ -385,10 +381,8 @@ AliasDeclaration::AliasDeclaration(Loc loc, Identifier *id, Dsymbol *s)
this->loc = loc;
this->type = NULL;
this->aliassym = s;
#ifdef _DH
this->htype = NULL;
this->haliassym = NULL;
#endif
this->overnext = NULL;
this->inSemantic = 0;
assert(s);
Expand All @@ -403,7 +397,7 @@ Dsymbol *AliasDeclaration::syntaxCopy(Dsymbol *s)
sa = new AliasDeclaration(loc, ident, type->syntaxCopy());
else
sa = new AliasDeclaration(loc, ident, aliassym->syntaxCopy(NULL));
#ifdef _DH

// Syntax copy for header file
if (!htype) // Don't overwrite original
{ if (type) // Make copy for both old and new instances
Expand All @@ -421,7 +415,7 @@ Dsymbol *AliasDeclaration::syntaxCopy(Dsymbol *s)
}
else
sa->haliassym = haliassym->syntaxCopy(s);
#endif

return sa;
}

Expand Down Expand Up @@ -606,7 +600,7 @@ Dsymbol *AliasDeclaration::toAlias()
void AliasDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
{
buf->writestring("alias ");
#if 0 && _DH
#if 0
if (hgs->hdrgen)
{
if (haliassym)
Expand Down Expand Up @@ -649,10 +643,8 @@ VarDeclaration::VarDeclaration(Loc loc, Type *type, Identifier *id, Initializer
assert(type || init);
this->type = type;
this->init = init;
#ifdef _DH
this->htype = NULL;
this->hinit = NULL;
#endif
this->loc = loc;
offset = 0;
noscope = 0;
Expand Down Expand Up @@ -693,7 +685,7 @@ Dsymbol *VarDeclaration::syntaxCopy(Dsymbol *s)
sv = new VarDeclaration(loc, type ? type->syntaxCopy() : NULL, ident, init);
sv->storage_class = storage_class;
}
#ifdef _DH

// Syntax copy for header file
if (!htype) // Don't overwrite original
{ if (type) // Make copy for both old and new instances
Expand All @@ -711,7 +703,7 @@ Dsymbol *VarDeclaration::syntaxCopy(Dsymbol *s)
}
else
sv->hinit = hinit->syntaxCopy();
#endif

return sv;
}

Expand Down
8 changes: 0 additions & 8 deletions src/declaration.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,8 @@ struct TypedefDeclaration : Declaration
const char *kind();
Type *getType();
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
#ifdef _DH
Type *htype;
Type *hbasetype;
#endif

void toDocBuffer(OutBuffer *buf);

Expand Down Expand Up @@ -224,10 +222,8 @@ struct AliasDeclaration : Declaration
Type *getType();
Dsymbol *toAlias();
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
#ifdef _DH
Type *htype;
Dsymbol *haliassym;
#endif

void toDocBuffer(OutBuffer *buf);

Expand Down Expand Up @@ -277,10 +273,8 @@ struct VarDeclaration : Declaration
void semantic2(Scope *sc);
const char *kind();
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
#ifdef _DH
Type *htype;
Initializer *hinit;
#endif
AggregateDeclaration *isThis();
int needThis();
int isImportedSymbol();
Expand Down Expand Up @@ -857,9 +851,7 @@ struct DeleteDeclaration : FuncDeclaration
int isVirtual();
int addPreInvariant();
int addPostInvariant();
#ifdef _DH
DeleteDeclaration *isDeleteDeclaration() { return this; }
#endif
};

#endif /* DMD_DECLARATION_H */
4 changes: 0 additions & 4 deletions src/dsymbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,8 @@ struct Dsymbol : Object
Dsymbol *search_correct(Identifier *id);
Dsymbol *searchX(Loc loc, Scope *sc, Identifier *id);
virtual int overloadInsert(Dsymbol *s);
#ifdef _DH
char *toHChars();
virtual void toHBuffer(OutBuffer *buf, HdrGenState *hgs);
#endif
virtual void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
virtual void toDocBuffer(OutBuffer *buf);
virtual void toJsonBuffer(OutBuffer *buf);
Expand Down Expand Up @@ -236,9 +234,7 @@ struct Dsymbol : Object
virtual ArrayScopeSymbol *isArrayScopeSymbol() { return NULL; }
virtual Import *isImport() { return NULL; }
virtual EnumDeclaration *isEnumDeclaration() { return NULL; }
#ifdef _DH
virtual DeleteDeclaration *isDeleteDeclaration() { return NULL; }
#endif
virtual SymbolDeclaration *isSymbolDeclaration() { return NULL; }
virtual AttribDeclaration *isAttribDeclaration() { return NULL; }
virtual OverloadSet *isOverloadSet() { return NULL; }
Expand Down
2 changes: 0 additions & 2 deletions src/enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
struct Identifier;
struct Type;
struct Expression;
#ifdef _DH
struct HdrGenState;
#endif


struct EnumDeclaration : ScopeDsymbol
Expand Down
2 changes: 0 additions & 2 deletions src/expression.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,7 @@ struct ComplexExp : Expression
int isBool(int result);
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
void toMangleBuffer(OutBuffer *buf);
#ifdef _DH
OutBuffer hexp;
#endif
elem *toElem(IRState *irs);
dt_t **toDt(dt_t **pdt);
};
Expand Down
8 changes: 4 additions & 4 deletions src/freebsd.mak
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ WARNINGS=-Wno-deprecated -Wstrict-aliasing
#GFLAGS = $(WARNINGS) -D__near= -D__pascal= -fno-exceptions -g -DDEBUG=1 -DUNITTEST $(COV)
GFLAGS = $(WARNINGS) -D__near= -D__pascal= -fno-exceptions -O2

CFLAGS = $(GFLAGS) -I$(ROOT) -D__I86__=1 -DMARS=1 -DTARGET_FREEBSD=1 -D_DH
MFLAGS = $(GFLAGS) -I$C -I$(TK) -D__I86__=1 -DMARS=1 -DTARGET_FREEBSD=1 -D_DH
CFLAGS = $(GFLAGS) -I$(ROOT) -D__I86__=1 -DMARS=1 -DTARGET_FREEBSD=1
MFLAGS = $(GFLAGS) -I$C -I$(TK) -D__I86__=1 -DMARS=1 -DTARGET_FREEBSD=1

CH= $C/cc.h $C/global.h $C/parser.h $C/oper.h $C/code.h $C/type.h \
$C/dt.h $C/cgcv.h $C/el.h $C/iasm.h
Expand Down Expand Up @@ -174,7 +174,7 @@ builtin.o: builtin.c
$(CC) -c $(CFLAGS) $<

cast.o: cast.c
$(CC) -c $(CFLAGS) $<
$(CC) -c $(CFLAGS) $<

cg.o: fltables.c $C/cg.c
$(CC) -c $(MFLAGS) -I. $C/cg.c
Expand Down Expand Up @@ -400,7 +400,7 @@ mars.o: mars.c

rmem.o: $(ROOT)/rmem.c
$(CC) -c $(GFLAGS) -I$(ROOT) $(ROOT)/rmem.c

module.o: $(TOTALH) $C/html.h module.c
$(CC) -c $(CFLAGS) -I$C module.c

Expand Down
5 changes: 0 additions & 5 deletions src/func.c
Original file line number Diff line number Diff line change
Expand Up @@ -1463,15 +1463,10 @@ void FuncDeclaration::semantic3(Scope *sc)

// Merge contracts together with body into one compound statement

#ifdef _DH
if (frequire && global.params.useIn)
{ frequire->incontract = 1;
a->push(frequire);
}
#else
if (frequire && global.params.useIn)
a->push(frequire);
#endif

// Precondition invariant
if (addPreInvariant())
Expand Down
4 changes: 0 additions & 4 deletions src/hdrgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

// Routines to emit header files

#ifdef _DH

#define PRETTY_PRINT
#define TEST_EMIT_ALL 0 // For Testing

Expand Down Expand Up @@ -100,5 +98,3 @@ void Dsymbol::toHBuffer(OutBuffer *buf, HdrGenState *hgs)


/*************************************/

#endif // #ifdef _DH
2 changes: 0 additions & 2 deletions src/iasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@
#include "iasm.h"
#include "cpp.h"

#undef _DH

// I32 isn't set correctly yet because this is the front end, and I32
// is a backend flag
#undef I16
Expand Down
2 changes: 0 additions & 2 deletions src/identifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ struct Identifier : Object
int compare(Object *o);
void print();
char *toChars();
#ifdef _DH
char *toHChars();
#endif
const char *toHChars2();
int dyncast();

Expand Down
2 changes: 0 additions & 2 deletions src/import.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ struct OutBuffer;
struct Module;
struct Package;
struct AliasDeclaration;
#ifdef _DH
struct HdrGenState;
#endif

struct Import : Dsymbol
{
Expand Down
3 changes: 1 addition & 2 deletions src/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ struct VoidInitializer;
struct StructInitializer;
struct ArrayInitializer;
struct ExpInitializer;
#ifdef _DH
struct HdrGenState;
#endif


struct Initializer : Object
{
Expand Down
8 changes: 4 additions & 4 deletions src/linux.mak
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ WARNINGS=-Wno-deprecated -Wstrict-aliasing
#GFLAGS = $(WARNINGS) -D__near= -D__pascal= -fno-exceptions -g -DDEBUG=1 -DUNITTEST $(COV)
GFLAGS = $(WARNINGS) -D__near= -D__pascal= -fno-exceptions -O2

CFLAGS = $(GFLAGS) -I$(ROOT) -D__I86__=1 -DMARS=1 -DTARGET_LINUX=1 -D_DH
MFLAGS = $(GFLAGS) -I$C -I$(TK) -D__I86__=1 -DMARS=1 -DTARGET_LINUX=1 -D_DH
CFLAGS = $(GFLAGS) -I$(ROOT) -D__I86__=1 -DMARS=1 -DTARGET_LINUX=1
MFLAGS = $(GFLAGS) -I$C -I$(TK) -D__I86__=1 -DMARS=1 -DTARGET_LINUX=1
LDFLAGS = -lm -lstdc++ -lpthread

CH= $C/cc.h $C/global.h $C/parser.h $C/oper.h $C/code.h $C/type.h \
Expand Down Expand Up @@ -175,7 +175,7 @@ builtin.o: builtin.c
$(CC) -c $(CFLAGS) $<

cast.o: cast.c
$(CC) -c $(CFLAGS) $<
$(CC) -c $(CFLAGS) $<

cg.o: fltables.c $C/cg.c
$(CC) -c $(MFLAGS) -I. $C/cg.c
Expand Down Expand Up @@ -401,7 +401,7 @@ mars.o: mars.c

rmem.o: $(ROOT)/rmem.c
$(CC) -c $(GFLAGS) -I$(ROOT) $(ROOT)/rmem.c

module.o: $(TOTALH) $C/html.h module.c
$(CC) -c $(CFLAGS) -I$C module.c

Expand Down
4 changes: 0 additions & 4 deletions src/mars.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,6 @@ int main(int argc, char *argv[])
goto Lerror;
}
}
#ifdef _DH
else if (p[1] == 'H')
{ global.params.doHdrGeneration = 1;
switch (p[2])
Expand All @@ -570,7 +569,6 @@ int main(int argc, char *argv[])
goto Lerror;
}
}
#endif
else if (p[1] == 'X')
{ global.params.doXGeneration = 1;
switch (p[2])
Expand Down Expand Up @@ -1154,7 +1152,6 @@ int main(int argc, char *argv[])
}
if (global.errors)
fatal();
#ifdef _DH
if (global.params.doHdrGeneration)
{
/* Generate 'header' import files.
Expand All @@ -1172,7 +1169,6 @@ int main(int argc, char *argv[])
}
if (global.errors)
fatal();
#endif

// load all unconditional imports for better symbol resolving
for (i = 0; i < modules.dim; i++)
Expand Down
Loading

0 comments on commit c759840

Please sign in to comment.