From 153febd093889343cfe677ab9603562c54ddc072 Mon Sep 17 00:00:00 2001 From: Alexey Prokhin Date: Sun, 28 Jul 2013 22:28:43 +0400 Subject: [PATCH] Remove minor differences with upstream --- dmd2/apply.c | 2 +- dmd2/clone.c | 2 +- dmd2/declaration.h | 2 +- dmd2/dsymbol.h | 2 +- dmd2/init.c | 2 +- dmd2/module.c | 12 ++++++------ dmd2/module.h | 11 +++++++---- dmd2/mtype.h | 3 +++ dmd2/statement.h | 11 +++++------ dmd2/target.h | 2 +- dmd2/template.c | 4 +++- 11 files changed, 30 insertions(+), 23 deletions(-) diff --git a/dmd2/apply.c b/dmd2/apply.c index 320b24a8..47f8844b 100644 --- a/dmd2/apply.c +++ b/dmd2/apply.c @@ -129,7 +129,7 @@ int StructLiteralExp::apply(fp_t fp, void *param) stageflags |= stageApply; int ret = condApply(elements, fp, param) || (*fp)(this, param); - stageflags = old; + stageflags = old; return ret; } diff --git a/dmd2/clone.c b/dmd2/clone.c index 03ea82c2..c465a553 100644 --- a/dmd2/clone.c +++ b/dmd2/clone.c @@ -164,7 +164,7 @@ Lneed: * Note that s will be constructed onto the stack, and probably * copy-constructed in caller site. * - * If S has copy copy construction and/or destructor, + * If S has copy copy construction and/or destructor, * the body will make bit-wise object swap: * S __tmp = this; // bit copy * this = s; // bit copy diff --git a/dmd2/declaration.h b/dmd2/declaration.h index 27211c5a..a9bbc1ad 100644 --- a/dmd2/declaration.h +++ b/dmd2/declaration.h @@ -145,7 +145,7 @@ struct Declaration : Dsymbol enum PROT protection; enum LINK linkage; int inuse; // used to detect cycles - const char *mangleOverride; // overridden symbol with pragma(mangle, "...") + const char *mangleOverride; // overridden symbol with pragma(mangle, "...") enum Semantic sem; Declaration(Identifier *id); diff --git a/dmd2/dsymbol.h b/dmd2/dsymbol.h index 54b56669..585aae33 100644 --- a/dmd2/dsymbol.h +++ b/dmd2/dsymbol.h @@ -163,7 +163,7 @@ struct Dsymbol : Object void deprecation(Loc loc, const char *format, ...); void deprecation(const char *format, ...); void checkDeprecated(Loc loc, Scope *sc); - Module *getModule(); // module where declared + Module *getModule(); Module *getAccessModule(); Dsymbol *pastMixin(); Dsymbol *toParent(); diff --git a/dmd2/init.c b/dmd2/init.c index d59a66ff..0bbe76aa 100644 --- a/dmd2/init.c +++ b/dmd2/init.c @@ -907,7 +907,7 @@ bool hasNonConstPointers(Expression *e) int old = se->stageflags; se->stageflags |= stageSearchPointers; bool ret = arrayHasNonConstPointers(se->elements); - se->stageflags = old; + se->stageflags = old; return ret; } else diff --git a/dmd2/module.c b/dmd2/module.c index 56411c5a..ec4ca973 100644 --- a/dmd2/module.c +++ b/dmd2/module.c @@ -741,7 +741,7 @@ void Module::importAll(Scope *prevsc) sc->pop(); // 2 pops because Scope::createGlobal() created 2 } -void Module::semantic(Scope* unused_sc) +void Module::semantic() { if (semanticstarted) return; @@ -811,7 +811,7 @@ void Module::semantic(Scope* unused_sc) //printf("-Module::semantic(this = %p, '%s'): parent = %p\n", this, toChars(), parent); } -void Module::semantic2(Scope* unused_sc) +void Module::semantic2() { if (deferred.dim) { @@ -851,7 +851,7 @@ void Module::semantic2(Scope* unused_sc) //printf("-Module::semantic2('%s'): parent = %p\n", toChars(), parent); } -void Module::semantic3(Scope* unused_sc) +void Module::semantic3() { //printf("Module::semantic3('%s'): parent = %p\n", toChars(), parent); if (semanticstarted >= 3) @@ -904,8 +904,7 @@ void Module::inlineScan() /**************************************************** */ -// is this used anywhere? -/* +#if IN_DMD void Module::gensymfile() { OutBuffer buf; @@ -927,7 +926,8 @@ void Module::gensymfile() buf.data = NULL; symfile->writev(); -}*/ +} +#endif /********************************** * Determine if we need to generate an instance of ModuleInfo diff --git a/dmd2/module.h b/dmd2/module.h index 648e527e..c2365545 100644 --- a/dmd2/module.h +++ b/dmd2/module.h @@ -143,12 +143,15 @@ struct Module : Package void parse(); // syntactic parse #endif void importAll(Scope *sc); - void semantic(Scope* unused_sc = NULL); // semantic analysis - void semantic2(Scope* unused_sc = NULL); // pass 2 semantic analysis - void semantic3(Scope* unused_sc = NULL); // pass 3 semantic analysis + void semantic(); // semantic analysis + void semantic2(); // pass 2 semantic analysis + void semantic3(); // pass 3 semantic analysis void inlineScan(); // scan for functions to inline void genhdrfile(); // generate D import file -// void gensymfile(); +#if IN_DMD + void genobjfile(int multiobj); + void gensymfile(); +#endif void gendocfile(); int needModuleInfo(); Dsymbol *search(Loc loc, Identifier *ident, int flags); diff --git a/dmd2/mtype.h b/dmd2/mtype.h index 3c34827b..d8354585 100644 --- a/dmd2/mtype.h +++ b/dmd2/mtype.h @@ -52,6 +52,9 @@ struct Parameter; #ifdef IN_GCC union tree_node; typedef union tree_node TYPE; typedef TYPE type; +#elif IN_LLVM +#else +typedef struct TYPE type; #endif #if IN_DMD diff --git a/dmd2/statement.h b/dmd2/statement.h index 6a2edf4c..3636ec79 100644 --- a/dmd2/statement.h +++ b/dmd2/statement.h @@ -75,17 +75,16 @@ typedef bool (*sapply_fp_t)(Statement *, void *); // Back end struct IRState; struct Blockx; -#if IN_LLVM -class DValue; -typedef DValue elem; -#endif #ifdef IN_GCC union tree_node; typedef union tree_node block; -//union tree_node; typedef union tree_node elem; +union tree_node; typedef union tree_node elem; +#elif IN_LLVM +class DValue; +typedef DValue elem; #else struct block; -//struct elem; +struct elem; #endif struct code; diff --git a/dmd2/target.h b/dmd2/target.h index ad3d956d..4ec6f3d3 100644 --- a/dmd2/target.h +++ b/dmd2/target.h @@ -22,7 +22,7 @@ struct Target static int realsize; // size a real consumes in memory static int realpad; // 'padding' added to the CPU real size to bring it up to realsize static int realalignsize; // alignment for reals - + static void init(); static unsigned alignsize(Type* type); static unsigned fieldalign(Type* type); diff --git a/dmd2/template.c b/dmd2/template.c index 35687d6a..a8fb8229 100644 --- a/dmd2/template.c +++ b/dmd2/template.c @@ -5509,7 +5509,7 @@ void TemplateInstance::semanticTiargs(Loc loc, Scope *sc, Objects *tiargs, int f { ea = ea->optimize(WANTvalue); } - } + } else if (ea->op == TOKvar) { /* This test is to skip substituting a const var with * its initializer. The problem is the initializer won't @@ -6999,3 +6999,5 @@ void TemplateMixin::toCBuffer(OutBuffer *buf, HdrGenState *hgs) buf->writebyte(';'); buf->writenl(); } + +