Mesa (master): i965/cfg: Make brw_cfg.h closer to C-includable.
Matt Turner
mattst88 at kemper.freedesktop.org
Thu May 15 22:43:22 UTC 2014
Module: Mesa
Branch: master
Commit: a77023c992fa37c609be56869c1bb5c00ec294b9
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a77023c992fa37c609be56869c1bb5c00ec294b9
Author: Matt Turner <mattst88 at gmail.com>
Date: Mon May 12 09:54:15 2014 -0700
i965/cfg: Make brw_cfg.h closer to C-includable.
Only bblock_link's inheritance left.
Acked-by: Eric Anholt <eric at anholt.net>
---
src/mesa/drivers/dri/i965/brw_cfg.h | 36 ++++++++++++++++++++++-------------
1 file changed, 23 insertions(+), 13 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_cfg.h b/src/mesa/drivers/dri/i965/brw_cfg.h
index 5911107..0a88d25 100644
--- a/src/mesa/drivers/dri/i965/brw_cfg.h
+++ b/src/mesa/drivers/dri/i965/brw_cfg.h
@@ -31,35 +31,43 @@
#include "brw_shader.h"
-class bblock_t;
+struct bblock_t;
+
+struct bblock_link : public exec_node {
+#ifdef __cplusplus
+ DECLARE_RALLOC_CXX_OPERATORS(bblock_link)
-class bblock_link : public exec_node {
-public:
bblock_link(bblock_t *block)
: block(block)
{
}
+#endif
- bblock_t *block;
+ struct bblock_t *block;
};
-class bblock_t {
-public:
+#ifndef __cplusplus
+struct backend_instruction;
+#endif
+
+struct bblock_t {
+#ifdef __cplusplus
DECLARE_RALLOC_CXX_OPERATORS(bblock_t)
bblock_t();
void add_successor(void *mem_ctx, bblock_t *successor);
void dump(backend_visitor *v);
+#endif
- backend_instruction *start;
- backend_instruction *end;
+ struct backend_instruction *start;
+ struct backend_instruction *end;
int start_ip;
int end_ip;
- exec_list parents;
- exec_list children;
+ struct exec_list parents;
+ struct exec_list children;
int block_num;
/* If the current basic block ends in an IF, ELSE, or ENDIF instruction,
@@ -68,11 +76,12 @@ public:
*
* Otherwise they are NULL.
*/
- backend_instruction *if_inst;
- backend_instruction *else_inst;
- backend_instruction *endif_inst;
+ struct backend_instruction *if_inst;
+ struct backend_instruction *else_inst;
+ struct backend_instruction *endif_inst;
};
+#ifdef __cplusplus
class cfg_t {
public:
DECLARE_RALLOC_CXX_OPERATORS(cfg_t)
@@ -93,5 +102,6 @@ public:
bblock_t **blocks;
int num_blocks;
};
+#endif
#endif /* BRW_CFG_H */
More information about the mesa-commit
mailing list