ir_constant_visitor: Handle dereferences of constant records
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 10 Jun 2010 00:30:19 +0000 (17:30 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 11 Jun 2010 22:37:27 +0000 (15:37 -0700)
ir_constant_expression.cpp

index 022692b9c927477773c12211d1e83b8e978b9d41..8e9e74bb7d889bb5a2222b4edf993974690a65c8 100644 (file)
@@ -566,9 +566,9 @@ ir_constant_visitor::visit(ir_dereference_array *ir)
 void
 ir_constant_visitor::visit(ir_dereference_record *ir)
 {
-   (void) ir;
-   value = NULL;
-   /* FINISHME: Other dereference modes. */
+   ir_constant *v = ir->record->constant_expression_value();
+
+   this->value = (v != NULL) ? v->get_record_field(ir->field) : NULL;
 }