Scope *PragmaDeclaration::newScope(Scope *sc) { if (ident == Id::Pinline) { PINLINE inlining = PINLINEdefault; if (!args || args->dim == 0) inlining = PINLINEdefault; else if (args->dim != 1) { error("one boolean expression expected for pragma(inline), not %d", args->dim); args->setDim(1); (*args)[0] = new ErrorExp(); } else { Expression *e = (*args)[0]; if (e->op != TOKint64 || !e->type->equals(Type::tbool)) { if (e->op != TOKerror) { error("pragma(inline, true or false) expected, not %s", e->toChars()); (*args)[0] = new ErrorExp(); } } else if (e->isBool(true)) inlining = PINLINEalways; else if (e->isBool(false)) inlining = PINLINEnever; } return createNewScope(sc, sc->stc, sc->linkage, sc->protection, sc->explicitProtection, sc->structalign, inlining); } return sc; }
Scope *StorageClassDeclaration::newScope(Scope *sc) { StorageClass scstc = sc->stc; /* These sets of storage classes are mutually exclusive, * so choose the innermost or most recent one. */ if (stc & (STCauto | STCscope | STCstatic | STCextern | STCmanifest)) scstc &= ~(STCauto | STCscope | STCstatic | STCextern | STCmanifest); if (stc & (STCauto | STCscope | STCstatic | STCtls | STCmanifest | STCgshared)) scstc &= ~(STCauto | STCscope | STCstatic | STCtls | STCmanifest | STCgshared); if (stc & (STCconst | STCimmutable | STCmanifest)) scstc &= ~(STCconst | STCimmutable | STCmanifest); if (stc & (STCgshared | STCshared | STCtls)) scstc &= ~(STCgshared | STCshared | STCtls); if (stc & (STCsafe | STCtrusted | STCsystem)) scstc &= ~(STCsafe | STCtrusted | STCsystem); scstc |= stc; //printf("scstc = x%llx\n", scstc); return createNewScope(sc, scstc, sc->linkage, sc->protection, sc->explicitProtection, sc->structalign); }
Scope *AlignDeclaration::newScope(Scope *sc) { return createNewScope(sc, sc->stc, sc->linkage, sc->protection, sc->explicitProtection, this->salign); }
Scope *ProtDeclaration::newScope(Scope *sc) { if (pkg_identifiers) semantic(sc); return createNewScope(sc, sc->stc, sc->linkage, this->protection, 1, sc->structalign); }
Scope *LinkDeclaration::newScope(Scope *sc) { return createNewScope(sc, sc->stc, this->linkage, sc->protection, sc->explicitProtection, sc->structalign, sc->inlining); }