You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As is typical for an established codebase that has been worked on by lots of different people, the consistency of naming and approach of things has drifted a bit over the last years. This makes it difficult to work on the compiler, particularly if you don't have full code completion at all times.
I'd suggest making that we make a pass over the compiler to regularize things. Here are some IMHO suggestions for things that I find irritating on a daily basis. That said, it would make sense to propose these on swift-dev before producing any monster patches:
Rename things referring to source locations, but spelling out "Location" to use "Loc". E.g. getDebugLocation() -> getDebugLoc()
Rename MultipleValueInstruction, SingleValueInstruction to SingleValueInst/MultipleValueInst since most of SIL uses "Inst". SILInstruction was supposed to be the one longhand one.
There are lots of different ways to get the current ASTContext, but a getASTContext() member is the most common (and flexible, because sometimes it isn't stored). As such, we should change public "Context" members to a getASTContext() method.
Some Expr nodes are created with "new (ctx) Node(...)" and others are made with Node::create(... ctx). We should standardize on the create methods, since they are more flexible.
I'm sure there are lots more places we can improve things as well.
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: 22bde6140d0fa9756c0c6301d019c71d
Issue Description:
As is typical for an established codebase that has been worked on by lots of different people, the consistency of naming and approach of things has drifted a bit over the last years. This makes it difficult to work on the compiler, particularly if you don't have full code completion at all times.
I'd suggest making that we make a pass over the compiler to regularize things. Here are some IMHO suggestions for things that I find irritating on a daily basis. That said, it would make sense to propose these on swift-dev before producing any monster patches:
Rename things referring to source locations, but spelling out "Location" to use "Loc". E.g. getDebugLocation() -> getDebugLoc()
Rename MultipleValueInstruction, SingleValueInstruction to SingleValueInst/MultipleValueInst since most of SIL uses "Inst". SILInstruction was supposed to be the one longhand one.
There are lots of different ways to get the current ASTContext, but a getASTContext() member is the most common (and flexible, because sometimes it isn't stored). As such, we should change public "Context" members to a getASTContext() method.
Some Expr nodes are created with "new (ctx) Node(...)" and others are made with Node::create(... ctx). We should standardize on the create methods, since they are more flexible.
I'm sure there are lots more places we can improve things as well.
The text was updated successfully, but these errors were encountered: