Mesa (master): i965: Use scope operator to ensure brw_reg is interpreted as a type.

Matt Turner mattst88 at kemper.freedesktop.org
Tue Nov 24 18:04:18 UTC 2015


Module: Mesa
Branch: master
Commit: 799f924073c62c3a012c48a51895b46ad621e36c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=799f924073c62c3a012c48a51895b46ad621e36c

Author: Matt Turner <mattst88 at gmail.com>
Date:   Mon Nov 23 16:17:28 2015 -0800

i965: Use scope operator to ensure brw_reg is interpreted as a type.

In the next patch, I make backend_reg's inheritance from brw_reg
private, which confuses clang when it sees the type "struct brw_reg" in
the derived class constructors, thinking it is referring to the
privately inherited brw_reg:

brw_fs.cpp:366:23: error: 'brw_reg' is a private member of 'brw_reg'
fs_reg::fs_reg(struct brw_reg reg) :
                      ^
brw_shader.h:39:22: note: constrained by private inheritance here
struct backend_reg : private brw_reg
                     ^~~~~~~~~~~~~~~
brw_reg.h:232:8: note: member is declared here
struct brw_reg {
       ^

Avoid this by marking brw_reg with the scope resolution operator.

---

 src/mesa/drivers/dri/i965/brw_fs.cpp    |    2 +-
 src/mesa/drivers/dri/i965/brw_ir_fs.h   |    2 +-
 src/mesa/drivers/dri/i965/brw_ir_vec4.h |    4 ++--
 src/mesa/drivers/dri/i965/brw_vec4.cpp  |    4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 2e7b73f..c2f52ff 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -375,7 +375,7 @@ fs_reg::fs_reg()
    this->file = BAD_FILE;
 }
 
-fs_reg::fs_reg(struct brw_reg reg) :
+fs_reg::fs_reg(struct ::brw_reg reg) :
    backend_reg(reg)
 {
    this->reg_offset = 0;
diff --git a/src/mesa/drivers/dri/i965/brw_ir_fs.h b/src/mesa/drivers/dri/i965/brw_ir_fs.h
index 0410053..84ee529 100644
--- a/src/mesa/drivers/dri/i965/brw_ir_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_ir_fs.h
@@ -36,7 +36,7 @@ public:
    void init();
 
    fs_reg();
-   fs_reg(struct brw_reg reg);
+   fs_reg(struct ::brw_reg reg);
    fs_reg(enum brw_reg_file file, int nr);
    fs_reg(enum brw_reg_file file, int nr, enum brw_reg_type type);
 
diff --git a/src/mesa/drivers/dri/i965/brw_ir_vec4.h b/src/mesa/drivers/dri/i965/brw_ir_vec4.h
index e2e6604..861d7b8 100644
--- a/src/mesa/drivers/dri/i965/brw_ir_vec4.h
+++ b/src/mesa/drivers/dri/i965/brw_ir_vec4.h
@@ -41,7 +41,7 @@ public:
 
    src_reg(enum brw_reg_file file, int nr, const glsl_type *type);
    src_reg();
-   src_reg(struct brw_reg reg);
+   src_reg(struct ::brw_reg reg);
 
    bool equals(const src_reg &r) const;
 
@@ -108,7 +108,7 @@ public:
            unsigned writemask);
    dst_reg(enum brw_reg_file file, int nr, brw_reg_type type,
            unsigned writemask);
-   dst_reg(struct brw_reg reg);
+   dst_reg(struct ::brw_reg reg);
    dst_reg(class vec4_visitor *v, const struct glsl_type *type);
 
    explicit dst_reg(const src_reg &reg);
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index 9fc0857..5b1c045 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -71,7 +71,7 @@ src_reg::src_reg()
    init();
 }
 
-src_reg::src_reg(struct brw_reg reg) :
+src_reg::src_reg(struct ::brw_reg reg) :
    backend_reg(reg)
 {
    this->reg_offset = 0;
@@ -128,7 +128,7 @@ dst_reg::dst_reg(enum brw_reg_file file, int nr, brw_reg_type type,
    this->writemask = writemask;
 }
 
-dst_reg::dst_reg(struct brw_reg reg) :
+dst_reg::dst_reg(struct ::brw_reg reg) :
    backend_reg(reg)
 {
    this->reg_offset = 0;




More information about the mesa-commit mailing list