Address code review comments.
diff --git a/compiler/back_end/cpp/testcode/next_keyword_test.cc b/compiler/back_end/cpp/testcode/next_keyword_test.cc
index c4990f4..3dc2be3 100644
--- a/compiler/back_end/cpp/testcode/next_keyword_test.cc
+++ b/compiler/back_end/cpp/testcode/next_keyword_test.cc
@@ -28,13 +28,14 @@
namespace test {
namespace {
+// For reference in the code below, the NextKeyword structure is defined as:
+//
// [$default byte_order: "LittleEndian"]
// struct NextKeyword:
// 0 [+4] UInt value32
// $next [+2] UInt value16
// $next [+1] UInt value8
// $next+3 [+1] UInt value8_offset
-
TEST(NextKeyword, FieldsAreCorrectlyLocated) {
::std::array<char, NextKeyword::IntrinsicSizeInBytes()> values = {
1, 0, 0, 0,
diff --git a/compiler/front_end/dependency_checker.py b/compiler/front_end/dependency_checker.py
index fa2d719..538a679 100644
--- a/compiler/front_end/dependency_checker.py
+++ b/compiler/front_end/dependency_checker.py
@@ -224,9 +224,10 @@
def _find_object_dependency_cycles(ir):
"""Finds dependency cycles in types in the ir."""
- dependencies, errors = _find_dependencies(ir)
- if errors:
- return errors
+ dependencies, find_dependency_errors = _find_dependencies(ir)
+ if find_dependency_errors:
+ return find_dependency_errors
+ errors = []
cycles = _find_cycles(dict(dependencies))
for cycle in cycles:
# TODO(bolms): This lists the entire strongly-connected component in a
diff --git a/compiler/front_end/synthetics.py b/compiler/front_end/synthetics.py
index aebc7e5..7080527 100644
--- a/compiler/front_end/synthetics.py
+++ b/compiler/front_end/synthetics.py
@@ -239,7 +239,6 @@
expression.function.args[0].CopyFrom(last_location.start)
expression.function.args[1].CopyFrom(last_location.size)
expression.source_location.CopyFrom(original_location)
- # DO NOT SUBMIT: Error messages for circular references?
_mark_as_synthetic(expression.function)
@@ -311,7 +310,7 @@
def desugar(ir):
"""Translates pure syntactic sugar to its desugared form.
- Replaces `$then` symbols with the start+length of the previous physical
+ Replaces `$next` symbols with the start+length of the previous physical
field.
Adds aliases for all fields in anonymous `bits` to the enclosing structure.
diff --git a/compiler/util/traverse_ir.py b/compiler/util/traverse_ir.py
index ce2c94f..b1e33f8 100644
--- a/compiler/util/traverse_ir.py
+++ b/compiler/util/traverse_ir.py
@@ -294,13 +294,13 @@
It does not have any built-in incidental actions.
Arguments:
- ir: An ir_pb2.Ir object to walk.
+ node: An ir_pb2.Ir object to walk.
pattern: A list of node types to match.
action: A callable, which will be called on nodes matching `pattern`.
incidental_actions: A dict of node types to callables, which can be used to
set new parameters for `action` for part of the IR tree.
skip_descendants_of: A list of types whose children should be skipped when
- traversing `ir`.
+ traversing `node`.
parameters: A list of top-level parameters.
Returns: