Skip to content

Commit

Permalink
[PExplicit] Correct local var names in IR
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-goel committed Apr 18, 2024
1 parent 20a53dd commit 5a6390d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ internal object GetMachineName(Machine machine)

internal static string GetVar(string rawName)
{
return $"{rawName}";
return $"var_{rawName}";
}

internal string FreshTempVar()
{
var id = nextTempVarId;
nextTempVarId++;
return $"temp_{id}";
return $"temp_var_{id}";
}

private static bool IsAsciiAlphabetic(char c)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ private void WriteContinuation(CompilationContext context, StringWriter output,
var arg =caseFun.Signature.Parameters[0];
var argValue = new Variable($"{arg.Name}_payload", continuation.SourceLocation, VariableRole.Param);
argValue.Type = PrimitiveType.Any;
context.WriteLine(output, $"PValue<?> {arg.Name}_payload = {messageName}.getPayload();");
context.WriteLine(output, $"PValue<?> var_{arg.Name}_payload = {messageName}.getPayload();");
var assignMsg = new AssignStmt(continuation.SourceLocation, new VariableAccessExpr(continuation.SourceLocation, arg), new VariableAccessExpr(continuation.SourceLocation, argValue));
context.WriteLine(output, $"{GetPExplicitType(arg.Type)} {CompilationContext.GetVar(arg.Name)} = {GetDefaultValue(arg.Type)};");
WriteStmt(continuation, context, output, caseContext, assignMsg);
Expand Down

0 comments on commit 5a6390d

Please sign in to comment.