Skip to content

Commit

Permalink
Merge branch 'master' into 143-rename-public-to-external
Browse files Browse the repository at this point in the history
  • Loading branch information
frogg authored Feb 22, 2018
2 parents 456132e + 5e2880e commit 18c143b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions Sources/IRGen/IULIAFunction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ struct IULIAFunction {

let capabilityBindingDeclaration: String
if let capabilityBinding = capabilityBinding {
capabilityBindingDeclaration = "let \(mangleIdentifierName(capabilityBinding.name)) := caller()\n"
capabilityBindingDeclaration = "let \(IULIAFunction.mangleIdentifierName(capabilityBinding.name)) := caller()\n"
} else {
capabilityBindingDeclaration = ""
}

let payableValueDeclaration: String
if let payableValueParameter = functionDeclaration.firstPayableValueParameter {
payableValueDeclaration = "let \(mangleIdentifierName(payableValueParameter.identifier.name)) := callvalue()\n"
payableValueDeclaration = "let \(IULIAFunction.mangleIdentifierName(payableValueParameter.identifier.name)) := callvalue()\n"
} else {
payableValueDeclaration = ""
}
Expand Down Expand Up @@ -112,7 +112,7 @@ struct IULIAFunction {
return "\(name)(\(parametersString))"
}

func mangleIdentifierName(_ name: String) -> String {
static func mangleIdentifierName(_ name: String) -> String {
return "_\(name)"
}

Expand Down Expand Up @@ -200,9 +200,9 @@ extension IULIAFunction {

switch lhs {
case .variableDeclaration(let variableDeclaration):
return "let \(mangleIdentifierName(variableDeclaration.identifier.name)) := \(rhsCode)"
return "let \(IULIAFunction.mangleIdentifierName(variableDeclaration.identifier.name)) := \(rhsCode)"
case .identifier(let identifier) where identifier.enclosingType == nil:
return "\(mangleIdentifierName(identifier.name)) := \(rhsCode)"
return "\(IULIAFunction.mangleIdentifierName(identifier.name)) := \(rhsCode)"
default:
let lhsCode = render(lhs, asLValue: true)
return "sstore(\(lhsCode), \(rhsCode))"
Expand Down Expand Up @@ -285,7 +285,7 @@ extension IULIAFunction {
if let _ = identifier.enclosingType {
return renderPropertyAccess(lhs: .self(Token(kind: .self, sourceLocation: identifier.sourceLocation)), rhs: .identifier(identifier), asLValue: asLValue)
}
return mangleIdentifierName(identifier.name)
return IULIAFunction.mangleIdentifierName(identifier.name)
}

func render(_ variableDeclaration: VariableDeclaration) -> String {
Expand Down
2 changes: 1 addition & 1 deletion Sources/IRGen/IULIAInterface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct IULIAInterface {
}

func render(_ functionParameter: Parameter) -> String {
return "\(CanonicalType(from: functionParameter.type.rawType)!.rawValue) \(functionParameter.identifier.name)"
return "\(CanonicalType(from: functionParameter.type.rawType)!.rawValue) \(IULIAFunction.mangleIdentifierName(functionParameter.identifier.name))"
}
}

Expand Down

0 comments on commit 18c143b

Please sign in to comment.