diff --git a/doc/compiler_example.md b/doc/compiler_example.md index dcd1df7d88..0397785e68 100644 --- a/doc/compiler_example.md +++ b/doc/compiler_example.md @@ -277,7 +277,7 @@ Then, for each of the remaining arguments, we do: ``` which emits an IR to add the value to the sum. The `to_math_type` will emit any code needed to convert this to the correct numeric type (returns either a numeric constant or a `RegVal` containing the value). -A second important detail is that we create a new register which will hold the result. This may seem inefficient in cases, but a later compile pass will try to make this new register be the same register as `first_val` if possible, and will eliminate the `IR_RegSet`. +An important detail is that we create a new register which will hold the result. This may seem inefficient in cases, but a later compile pass will try to make this new register be the same register as `first_val` if possible, and will eliminate the `IR_RegSet`. # Register Allocation diff --git a/goalc/compiler/compilation/Function.cpp b/goalc/compiler/compilation/Function.cpp index 2757692094..025b9ea827 100644 --- a/goalc/compiler/compilation/Function.cpp +++ b/goalc/compiler/compilation/Function.cpp @@ -216,7 +216,7 @@ Val* Compiler::compile_function_or_method_call(const goos::Object& form, Env* en head_as_lambda = dynamic_cast(head); } - if(!head_as_lambda) { + if (!head_as_lambda) { head = head->to_gpr(env); } @@ -227,8 +227,6 @@ Val* Compiler::compile_function_or_method_call(const goos::Object& form, Env* en eval_args.push_back(intermediate->to_reg(env)); } - - if (head_as_lambda) { // inline the function!