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 022692b..8e9e74b 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;
 }