Skip to content

Commit ffbad27

Browse files
authored
Remove const ref from Loc parameters (#20846)
1 parent c73dca1 commit ffbad27

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+923
-923
lines changed

compiler/src/dmd/aggregate.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
154154
bool disableNew; /// disallow allocations using `new`
155155
Sizeok sizeok = Sizeok.none; /// set when structsize contains valid data
156156

157-
final extern (D) this(const ref Loc loc, Identifier id)
157+
final extern (D) this(Loc loc, Identifier id)
158158
{
159159
super(loc, id);
160160
visibility = Visibility(Visibility.Kind.public_);
@@ -189,7 +189,7 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
189189

190190
abstract void finalizeSize();
191191

192-
override final uinteger_t size(const ref Loc loc)
192+
override final uinteger_t size(Loc loc)
193193
{
194194
//printf("+AggregateDeclaration::size() %s, scope = %p, sizeok = %d\n", toChars(), _scope, sizeok);
195195
bool ok = determineSize(this, loc);

compiler/src/dmd/aggregate.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace dmd
4545
{
4646
FuncDeclaration *search_toString(StructDeclaration *sd);
4747
void semanticTypeInfoMembers(StructDeclaration *sd);
48-
bool fill(StructDeclaration* sd, const Loc &loc, Expressions &elements, bool ctorinit);
48+
bool fill(StructDeclaration* sd, Loc loc, Expressions &elements, bool ctorinit);
4949
}
5050

5151
enum class ClassKind : uint8_t
@@ -119,7 +119,7 @@ class AggregateDeclaration : public ScopeDsymbol
119119

120120
virtual Scope *newScope(Scope *sc);
121121
virtual void finalizeSize() = 0;
122-
uinteger_t size(const Loc &loc) override final;
122+
uinteger_t size(Loc loc) override final;
123123
Type *getType() override final;
124124
bool isDeprecated() const override final; // is aggregate deprecated?
125125
bool isNested() const;
@@ -168,7 +168,7 @@ class StructDeclaration : public AggregateDeclaration
168168
private:
169169
uint16_t bitFields;
170170
public:
171-
static StructDeclaration *create(const Loc &loc, Identifier *id, bool inObject);
171+
static StructDeclaration *create(Loc loc, Identifier *id, bool inObject);
172172
StructDeclaration *syntaxCopy(Dsymbol *s) override;
173173
const char *kind() const override;
174174
void finalizeSize() override final;
@@ -278,7 +278,7 @@ class ClassDeclaration : public AggregateDeclaration
278278
ObjcClassDeclaration objc; // Data for a class declaration that is needed for the Objective-C integration
279279
Symbol *cpp_type_info_ptr_sym; // cached instance of class Id.cpp_type_info_ptr
280280

281-
static ClassDeclaration *create(const Loc &loc, Identifier *id, BaseClasses *baseclasses, Dsymbols *members, bool inObject);
281+
static ClassDeclaration *create(Loc loc, Identifier *id, BaseClasses *baseclasses, Dsymbols *members, bool inObject);
282282
const char *toPrettyChars(bool QualifyTypes = false) override;
283283
ClassDeclaration *syntaxCopy(Dsymbol *s) override;
284284
Scope *newScope(Scope *sc) override;

compiler/src/dmd/aliasthis.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extern (C++) final class AliasThis : Dsymbol
3131
/// Whether this `alias this` is deprecated or not
3232
bool isDeprecated_;
3333

34-
extern (D) this(const ref Loc loc, Identifier ident) @safe
34+
extern (D) this(Loc loc, Identifier ident) @safe
3535
{
3636
super(loc, null); // it's anonymous (no identifier)
3737
this.ident = ident;

0 commit comments

Comments
 (0)