Skip to content

Commit

Permalink
Use camelCasing in all TypeFunction.BitFields fields
Browse files Browse the repository at this point in the history
  • Loading branch information
nordlow committed Aug 26, 2024
1 parent a271bd1 commit 4298083
Show file tree
Hide file tree
Showing 33 changed files with 381 additions and 381 deletions.
130 changes: 65 additions & 65 deletions compiler/src/dmd/astbase.d
Original file line number Diff line number Diff line change
Expand Up @@ -3950,15 +3950,15 @@ struct ASTBase
private enum FunctionFlag : uint
{
none = 0,
isnothrow = 0x0001, // nothrow
isnogc = 0x0002, // is @nogc
isproperty = 0x0004, // can be called without parentheses
isref = 0x0008, // returns a reference
isreturn = 0x0010, // 'this' is returned by ref
isscope = 0x0020, // 'this' is scope
isreturninferred= 0x0040, // 'this' is return from inference
isscopeinferred = 0x0080, // 'this' is scope from inference
islive = 0x0100, // is @live
isNothrow = 0x0001, // nothrow
isNogc = 0x0002, // is @nogc
isProperty = 0x0004, // can be called without parentheses
isRef = 0x0008, // returns a reference
isReturn = 0x0010, // 'this' is returned by ref
isScope = 0x0020, // 'this' is scope
isReturnInferred= 0x0040, // 'this' is return from inference
isScopeInferred = 0x0080, // 'this' is scope from inference
isLive = 0x0100, // is @live
incomplete = 0x0200, // return type or default arguments removed
inoutParam = 0x0400, // inout on the parameters
inoutQual = 0x0800, // inout on the qualifier
Expand All @@ -3981,18 +3981,18 @@ struct ASTBase
if (stc & STC.pure_)
this.purity = PURE.fwdref;
if (stc & STC.nothrow_)
this.isnothrow = true;
this.isNothrow = true;
if (stc & STC.nogc)
this.isnogc = true;
this.isNogc = true;
if (stc & STC.property)
this.isproperty = true;
this.isProperty = true;
if (stc & STC.live)
this.islive = true;
this.isLive = true;

if (stc & STC.ref_)
this.isref = true;
this.isRef = true;
if (stc & STC.return_)
this.isreturn = true;
this.isReturn = true;
if (stc & STC.scope_)
this.isScopeQual = true;

Expand All @@ -4011,15 +4011,15 @@ struct ASTBase
Parameters* params = Parameter.arraySyntaxCopy(parameterList.parameters);
auto t = new TypeFunction(ParameterList(params, parameterList.varargs), treturn, linkage);
t.mod = mod;
t.isnothrow = isnothrow;
t.isnogc = isnogc;
t.isNothrow = isNothrow;
t.isNogc = isNogc;
t.purity = purity;
t.isproperty = isproperty;
t.isref = isref;
t.isreturn = isreturn;
t.isProperty = isProperty;
t.isRef = isRef;
t.isReturn = isReturn;
t.isScopeQual = isScopeQual;
t.isreturninferred = isreturninferred;
t.isscopeinferred = isscopeinferred;
t.isReturnInferred = isReturnInferred;
t.isScopeInferred = isScopeInferred;
t.isInOutParam = isInOutParam;
t.isInOutQual = isInOutQual;
t.trust = trust;
Expand All @@ -4028,111 +4028,111 @@ struct ASTBase
}

/// set or get if the function has the `nothrow` attribute
bool isnothrow() const pure nothrow @safe @nogc
bool isNothrow() const pure nothrow @safe @nogc
{
return (funcFlags & FunctionFlag.isnothrow) != 0;
return (funcFlags & FunctionFlag.isNothrow) != 0;
}
/// ditto
void isnothrow(bool v) pure nothrow @safe @nogc
void isNothrow(bool v) pure nothrow @safe @nogc
{
if (v) funcFlags |= FunctionFlag.isnothrow;
else funcFlags &= ~FunctionFlag.isnothrow;
if (v) funcFlags |= FunctionFlag.isNothrow;
else funcFlags &= ~FunctionFlag.isNothrow;
}

/// set or get if the function has the `@nogc` attribute
bool isnogc() const pure nothrow @safe @nogc
bool isNogc() const pure nothrow @safe @nogc
{
return (funcFlags & FunctionFlag.isnogc) != 0;
return (funcFlags & FunctionFlag.isNogc) != 0;
}
/// ditto
void isnogc(bool v) pure nothrow @safe @nogc
void isNogc(bool v) pure nothrow @safe @nogc
{
if (v) funcFlags |= FunctionFlag.isnogc;
else funcFlags &= ~FunctionFlag.isnogc;
if (v) funcFlags |= FunctionFlag.isNogc;
else funcFlags &= ~FunctionFlag.isNogc;
}

/// set or get if the function has the `@property` attribute
bool isproperty() const pure nothrow @safe @nogc
bool isProperty() const pure nothrow @safe @nogc
{
return (funcFlags & FunctionFlag.isproperty) != 0;
return (funcFlags & FunctionFlag.isProperty) != 0;
}
/// ditto
void isproperty(bool v) pure nothrow @safe @nogc
void isProperty(bool v) pure nothrow @safe @nogc
{
if (v) funcFlags |= FunctionFlag.isproperty;
else funcFlags &= ~FunctionFlag.isproperty;
if (v) funcFlags |= FunctionFlag.isProperty;
else funcFlags &= ~FunctionFlag.isProperty;
}

/// set or get if the function has the `ref` attribute
bool isref() const pure nothrow @safe @nogc
bool isRef() const pure nothrow @safe @nogc
{
return (funcFlags & FunctionFlag.isref) != 0;
return (funcFlags & FunctionFlag.isRef) != 0;
}
/// ditto
void isref(bool v) pure nothrow @safe @nogc
void isRef(bool v) pure nothrow @safe @nogc
{
if (v) funcFlags |= FunctionFlag.isref;
else funcFlags &= ~FunctionFlag.isref;
if (v) funcFlags |= FunctionFlag.isRef;
else funcFlags &= ~FunctionFlag.isRef;
}

/// set or get if the function has the `return` attribute
bool isreturn() const pure nothrow @safe @nogc
bool isReturn() const pure nothrow @safe @nogc
{
return (funcFlags & FunctionFlag.isreturn) != 0;
return (funcFlags & FunctionFlag.isReturn) != 0;
}
/// ditto
void isreturn(bool v) pure nothrow @safe @nogc
void isReturn(bool v) pure nothrow @safe @nogc
{
if (v) funcFlags |= FunctionFlag.isreturn;
else funcFlags &= ~FunctionFlag.isreturn;
if (v) funcFlags |= FunctionFlag.isReturn;
else funcFlags &= ~FunctionFlag.isReturn;
}

/// set or get if the function has the `scope` attribute
bool isScopeQual() const pure nothrow @safe @nogc
{
return (funcFlags & FunctionFlag.isscope) != 0;
return (funcFlags & FunctionFlag.isScope) != 0;
}
/// ditto
void isScopeQual(bool v) pure nothrow @safe @nogc
{
if (v) funcFlags |= FunctionFlag.isscope;
else funcFlags &= ~FunctionFlag.isscope;
if (v) funcFlags |= FunctionFlag.isScope;
else funcFlags &= ~FunctionFlag.isScope;
}

/// set or get if the function has the `return` attribute inferred
bool isreturninferred() const pure nothrow @safe @nogc
bool isReturnInferred() const pure nothrow @safe @nogc
{
return (funcFlags & FunctionFlag.isreturninferred) != 0;
return (funcFlags & FunctionFlag.isReturnInferred) != 0;
}
/// ditto
void isreturninferred(bool v) pure nothrow @safe @nogc
void isReturnInferred(bool v) pure nothrow @safe @nogc
{
if (v) funcFlags |= FunctionFlag.isreturninferred;
else funcFlags &= ~FunctionFlag.isreturninferred;
if (v) funcFlags |= FunctionFlag.isReturnInferred;
else funcFlags &= ~FunctionFlag.isReturnInferred;
}

/// set or get if the function has the `scope` attribute inferred
bool isscopeinferred() const pure nothrow @safe @nogc
bool isScopeInferred() const pure nothrow @safe @nogc
{
return (funcFlags & FunctionFlag.isscopeinferred) != 0;
return (funcFlags & FunctionFlag.isScopeInferred) != 0;
}
/// ditoo
void isscopeinferred(bool v) pure nothrow @safe @nogc
void isScopeInferred(bool v) pure nothrow @safe @nogc
{
if (v) funcFlags |= FunctionFlag.isscopeinferred;
else funcFlags &= ~FunctionFlag.isscopeinferred;
if (v) funcFlags |= FunctionFlag.isScopeInferred;
else funcFlags &= ~FunctionFlag.isScopeInferred;
}

/// set or get if the function has the `@live` attribute
bool islive() const pure nothrow @safe @nogc
bool isLive() const pure nothrow @safe @nogc
{
return (funcFlags & FunctionFlag.islive) != 0;
return (funcFlags & FunctionFlag.isLive) != 0;
}
/// ditto
void islive(bool v) pure nothrow @safe @nogc
void isLive(bool v) pure nothrow @safe @nogc
{
if (v) funcFlags |= FunctionFlag.islive;
else funcFlags &= ~FunctionFlag.islive;
if (v) funcFlags |= FunctionFlag.isLive;
else funcFlags &= ~FunctionFlag.isLive;
}

/// set or get if the return type or the default arguments are removed
Expand Down
6 changes: 3 additions & 3 deletions compiler/src/dmd/canthrow.d
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ CT canThrow(Expression e, FuncDeclaration func, ErrorSink eSink)
void checkFuncThrows(Expression e, FuncDeclaration f)
{
auto tf = f.type.toBasetype().isTypeFunction();
if (tf && !tf.isnothrow)
if (tf && !tf.isNothrow)
{
if (eSink)
{
Expand All @@ -81,7 +81,7 @@ CT canThrow(Expression e, FuncDeclaration func, ErrorSink eSink)
errorSupplementalInferredAttr(f, 10, false, STC.nothrow_);

import dmd.expressionsem : checkOverriddenDtor;
f.checkOverriddenDtor(null, e.loc, dd => dd.type.toTypeFunction().isnothrow, "not nothrow");
f.checkOverriddenDtor(null, e.loc, dd => dd.type.toTypeFunction().isNothrow, "not nothrow");
}
else if (func)
{
Expand Down Expand Up @@ -133,7 +133,7 @@ CT canThrow(Expression e, FuncDeclaration func, ErrorSink eSink)
if (ce.f && ce.f == func)
return;
const tf = ce.calledFunctionType();
if (tf && tf.isnothrow)
if (tf && tf.isNothrow)
return;

if (ce.f)
Expand Down
8 changes: 4 additions & 4 deletions compiler/src/dmd/clone.d
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ StorageClass mergeFuncAttrs(StorageClass s1, const FuncDeclaration f) pure

if (tf.purity != PURE.impure)
s2 |= STC.pure_;
if (tf.isnothrow)
if (tf.isNothrow)
s2 |= STC.nothrow_;
if (tf.isnogc)
if (tf.isNogc)
s2 |= STC.nogc;

const sa = s1 & s2;
Expand Down Expand Up @@ -377,7 +377,7 @@ FuncDeclaration buildOpAssign(StructDeclaration sd, Scope* sc)
auto er = new ThisExp(loc);
Statement s2 = new ReturnStatement(loc, er);
fop.fbody = new CompoundStatement(loc, s1, s2);
tf.isreturn = true;
tf.isReturn = true;
}
sd.members.push(fop);
fop.addMember(sc, sd);
Expand Down Expand Up @@ -1274,7 +1274,7 @@ FuncDeclaration buildPostBlit(StructDeclaration sd, Scope* sc)
// block to destroy any prior successfully postblitted fields should
// this field's postblit fail.
// Don't generate it for betterC code since it cannot throw exceptions.
if (fieldsToDestroy.length > 0 && !(cast(TypeFunction)sdv.postblit.type).isnothrow && global.params.useExceptions)
if (fieldsToDestroy.length > 0 && !(cast(TypeFunction)sdv.postblit.type).isNothrow && global.params.useExceptions)
{
// create a list of destructors that need to be called
Expression[] dtorCalls;
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dmd/cppmangle.d
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ private final class CppMangleVisitor : Visitor
// if so, just pick up the type from the instance
if (!rt)
rt = tf.nextOf();
if (tf.isref)
if (tf.isRef)
rt = rt.referenceTo();
auto prev = this.context.push(tf.nextOf());
scope (exit) this.context.pop(prev);
Expand Down Expand Up @@ -1915,7 +1915,7 @@ extern(C++):
if (t.linkage == LINK.c)
buf.writeByte('Y');
Type tn = t.next;
if (t.isref)
if (t.isRef)
tn = tn.referenceTo();
tn.accept(this);
mangleFunctionParameters(t.parameterList);
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dmd/cppmanglewin.d
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ extern(D):
else
{
Type rettype = type.next;
if (type.isref)
if (type.isRef)
rettype = rettype.referenceTo();
ignoreConst = false;
if (rettype.ty == Tstruct)
Expand Down
6 changes: 3 additions & 3 deletions compiler/src/dmd/dcast.d
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ MATCH implicitConvTo(Expression e, Type t)
*/
Type tb = t.toBasetype();
MOD mod = tb.mod;
if (tf.isref)
if (tf.isRef)
{
}
else
Expand Down Expand Up @@ -3487,8 +3487,8 @@ Lagain:
d.purity = PURE.impure;
assert(d.purity != PURE.fwdref);

d.isnothrow = (tf1.isnothrow && tf2.isnothrow);
d.isnogc = (tf1.isnogc && tf2.isnogc);
d.isNothrow = (tf1.isNothrow && tf2.isNothrow);
d.isNogc = (tf1.isNogc && tf2.isNogc);

if (tf1.trust == tf2.trust)
d.trust = tf1.trust;
Expand Down
6 changes: 3 additions & 3 deletions compiler/src/dmd/dinterpret.d
Original file line number Diff line number Diff line change
Expand Up @@ -720,9 +720,9 @@ private Expression interpretFunction(UnionExp* pue, FuncDeclaration fd, InterSta
}
}

if (tf.isref && e.op == EXP.variable && e.isVarExp().var == fd.vthis)
if (tf.isRef && e.op == EXP.variable && e.isVarExp().var == fd.vthis)
e = thisarg;
if (tf.isref && fd.hasDualContext() && e.op == EXP.index)
if (tf.isRef && fd.hasDualContext() && e.op == EXP.index)
{
auto ie = e.isIndexExp();
auto pe = ie.e1.isPtrExp();
Expand Down Expand Up @@ -999,7 +999,7 @@ Expression interpretStatement(UnionExp* pue, Statement s, InterState* istate)
/* If the function returns a ref AND it's been called from an assignment,
* we need to return an lvalue. Otherwise, just do an (rvalue) interpret.
*/
if (tf.isref)
if (tf.isRef)
{
result = interpret(pue, s.exp, istate, CTFEGoal.LValue);
return;
Expand Down
16 changes: 8 additions & 8 deletions compiler/src/dmd/dmangle.d
Original file line number Diff line number Diff line change
Expand Up @@ -358,31 +358,31 @@ void mangleFuncType(TypeFunction t, TypeFunction ta, ubyte modMask, Type tret, r

if (ta.purity)
buf.writestring("Na");
if (ta.isnothrow)
if (ta.isNothrow)
buf.writestring("Nb");
if (ta.isref)
if (ta.isRef)
buf.writestring("Nc");
if (ta.isproperty)
if (ta.isProperty)
buf.writestring("Nd");
if (ta.isnogc)
if (ta.isNogc)
buf.writestring("Ni");

// `return scope` must be in that order
if (ta.isreturnscope && !ta.isreturninferred)
if (ta.isReturnScope && !ta.isReturnInferred)
{
buf.writestring("NjNl");
}
else
{
// when return ref, the order is `scope return`
if (ta.isScopeQual && !ta.isscopeinferred)
if (ta.isScopeQual && !ta.isScopeInferred)
buf.writestring("Nl");

if (ta.isreturn && !ta.isreturninferred)
if (ta.isReturn && !ta.isReturnInferred)
buf.writestring("Nj");
}

if (ta.islive)
if (ta.isLive)
buf.writestring("Nm");

switch (ta.trust)
Expand Down
Loading

0 comments on commit 4298083

Please sign in to comment.