Skip to content

Commit

Permalink
Merge pull request #996 from klickverbot/remove-breakabi
Browse files Browse the repository at this point in the history
Removed BREAKABI - has been true for ages (dmd 0.176).
  • Loading branch information
WalterBright committed Jun 11, 2012
2 parents 6b6acd9 + b3e564e commit 4327657
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 46 deletions.
20 changes: 1 addition & 19 deletions src/func.c
Expand Up @@ -505,9 +505,6 @@ void FuncDeclaration::semantic(Scope *sc)
break;

else if (!this->parent->isClassDeclaration() // if both are mixins then error
#if !BREAKABI
&& !isDtorDeclaration()
#endif
#if DMDV2
&& !isPostBlitDeclaration()
#endif
Expand Down Expand Up @@ -970,7 +967,6 @@ void FuncDeclaration::semantic3(Scope *sc)

if (f->linkage == LINKd)
{ // Declare _arguments[]
#if BREAKABI
v_arguments = new VarDeclaration(0, Type::typeinfotypelist->type, Id::_arguments_typeinfo, NULL);
v_arguments->storage_class = STCparameter;
v_arguments->semantic(sc2);
Expand All @@ -983,14 +979,6 @@ void FuncDeclaration::semantic3(Scope *sc)
_arguments->semantic(sc2);
sc2->insert(_arguments);
_arguments->parent = this;
#else
t = Type::typeinfo->type->arrayOf();
v_arguments = new VarDeclaration(0, t, Id::_arguments, NULL);
v_arguments->storage_class = STCparameter | STCin;
v_arguments->semantic(sc2);
sc2->insert(v_arguments);
v_arguments->parent = this;
#endif
}
if (f->linkage == LINKd || (f->parameters && Parameter::dim(f->parameters)))
{ // Declare _argptr
Expand Down Expand Up @@ -3591,14 +3579,8 @@ char *DtorDeclaration::toChars()

int DtorDeclaration::isVirtual()
{
/* This should be FALSE so that dtor's don't get put into the vtbl[],
* but doing so will require recompiling everything.
*/
#if BREAKABI
// FALSE so that dtor's don't get put into the vtbl[]
return FALSE;
#else
return FuncDeclaration::isVirtual();
#endif
}

void DtorDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
Expand Down
1 change: 0 additions & 1 deletion src/mars.h
Expand Up @@ -87,7 +87,6 @@ void unittests();

#define DMDV1 0
#define DMDV2 1 // Version 2.0 features
#define BREAKABI 1 // 0 if not ready to break the ABI just yet
#define STRUCTTHISREF DMDV2 // if 'this' for struct is a reference, not a pointer
#define SNAN_DEFAULT_INIT DMDV2 // if floats are default initialized to signalling NaN
#define SARRAYVALUE DMDV2 // static arrays are value types
Expand Down
31 changes: 5 additions & 26 deletions src/typinf.c
Expand Up @@ -882,11 +882,11 @@ int TypeClass::builtinTypeInfo()
Expression *createTypeInfoArray(Scope *sc, Expression *exps[], unsigned dim)
{
#if 1
/* Get the corresponding TypeInfo_Tuple and
* point at its elements[].
*/

/* Create the TypeTuple corresponding to the types of args[]
/*
* Pass a reference to the TypeInfo_Tuple corresponding to the types of the
* arguments. Source compatibility is maintained by computing _arguments[]
* at the start of the called function by offseting into the TypeInfo_Tuple
* reference.
*/
Parameters *args = new Parameters;
args->setDim(dim);
Expand All @@ -899,27 +899,6 @@ Expression *createTypeInfoArray(Scope *sc, Expression *exps[], unsigned dim)
e = e->optimize(WANTvalue);
assert(e->op == TOKsymoff); // should be SymOffExp

#if BREAKABI
/*
* Should just pass a reference to TypeInfo_Tuple instead,
* but that would require existing code to be recompiled.
* Source compatibility can be maintained by computing _arguments[]
* at the start of the called function by offseting into the
* TypeInfo_Tuple reference.
*/

#else
// Advance to elements[] member of TypeInfo_Tuple
SymOffExp *se = (SymOffExp *)e;
se->offset += PTRSIZE + PTRSIZE;

// Set type to TypeInfo[]*
se->type = Type::typeinfo->type->arrayOf()->pointerTo();

// Indirect to get the _arguments[] value
e = new PtrExp(0, se);
e->type = se->type->next;
#endif
return e;
#else
/* Improvements:
Expand Down

0 comments on commit 4327657

Please sign in to comment.