From: Kenneth Graunke Date: Wed, 4 Sep 2013 00:07:18 +0000 (-0700) Subject: glsl: Add optional parameters to the ir_factory constructor. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8d90328eb3a934e07a9fa54b829e768750ab6d8b;p=mesa.git glsl: Add optional parameters to the ir_factory constructor. Each ir_factory needs an instruction list and memory context in order to be useful. Rather than creating an object and manually assigning these, we can just use optional parameters in the constructor. This makes it possible to create a ready-to-use factory in one line: ir_factory body(&sig->body, mem_ctx); Signed-off-by: Kenneth Graunke Reviewed-by: Matt Turner Reviewed-by: Paul Berry --- diff --git a/src/glsl/ir_builder.h b/src/glsl/ir_builder.h index 36ae7125871..429900bd18a 100644 --- a/src/glsl/ir_builder.h +++ b/src/glsl/ir_builder.h @@ -82,9 +82,9 @@ public: class ir_factory { public: - ir_factory() - : instructions(NULL), - mem_ctx(NULL) + ir_factory(exec_list *instructions = NULL, void *mem_ctx = NULL) + : instructions(instructions), + mem_ctx(mem_ctx) { return; }