summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.h
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2015-03-24 09:14:35 -0700
committerIan Romanick <[email protected]>2015-03-25 10:40:52 -0700
commitdec9664e35a35b447f21ea15631ae5a5404e9624 (patch)
treeb376e3a0a2b356343b942d235483a99f30072148 /src/glsl/ir.h
parent0c4ee62045ed184a5b9662f940b8a9e9bd454734 (diff)
glsl: Constify the as_foo functions
Now that they're all implemented using macros, this is trivial. v2: Remove redundant parenthesis. Suggested by Curro. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src/glsl/ir.h')
-rw-r--r--src/glsl/ir.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 0284b0278fc..b95ba2c761b 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -147,6 +147,11 @@ public:
{ \
assume(this != NULL); \
return is_##TYPE() ? (ir_##TYPE *) this : NULL; \
+ } \
+ const class ir_##TYPE *as_##TYPE() const \
+ { \
+ assume(this != NULL); \
+ return is_##TYPE() ? (ir_##TYPE *) this : NULL; \
}
AS_BASE(rvalue)
@@ -159,6 +164,11 @@ public:
{ \
assume(this != NULL); \
return ir_type == ir_type_##TYPE ? (ir_##TYPE *) this : NULL; \
+ } \
+ const class ir_##TYPE * as_##TYPE() const \
+ { \
+ assume(this != NULL); \
+ return ir_type == ir_type_##TYPE ? (const ir_##TYPE *) this : NULL; \
}
AS_CHILD(variable)
AS_CHILD(function)