[Beignet] [PATCH 5/5] GenRegister src[] is not allowed in clang, change this style.

Lu Guanqun guanqun.lu at intel.com
Mon Apr 15 23:39:03 PDT 2013


Signed-off-by: Lu Guanqun <guanqun.lu at intel.com>
---
 backend/src/backend/gen_insn_selection.hpp |    2 +-
 backend/src/ir/instruction.cpp             |   12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/backend/src/backend/gen_insn_selection.hpp b/backend/src/backend/gen_insn_selection.hpp
index 0c8263d..f6735c2 100644
--- a/backend/src/backend/gen_insn_selection.hpp
+++ b/backend/src/backend/gen_insn_selection.hpp
@@ -117,7 +117,7 @@ namespace gbe
     /*! To store various indices */
     uint16_t index;
     /*! Variable sized. Destinations and sources go here */
-    GenRegister regs[];
+    GenRegister regs[0];
   private:
     /*! Just Selection class can create SelectionInstruction */
     SelectionInstruction(SelectionOpcode, uint32_t dstNum, uint32_t srcNum);
diff --git a/backend/src/ir/instruction.cpp b/backend/src/ir/instruction.cpp
index d76aa74..9fd4247 100644
--- a/backend/src/ir/instruction.cpp
+++ b/backend/src/ir/instruction.cpp
@@ -294,7 +294,7 @@ namespace ir {
       LabelIndex labelIndex; //!< Index of the label the branch targets
       bool hasPredicate:1;   //!< Is it predicated?
       bool hasLabel:1;       //!< Is there any target label?
-      Register dst[];        //!< No destination
+      Register dst[0];       //!< No destination
     };
 
     class ALIGNED_INSTRUCTION LoadInstruction :
@@ -334,7 +334,7 @@ namespace ir {
       INLINE void out(std::ostream &out, const Function &fn) const;
       INLINE bool isAligned(void) const { return !!dwAligned; }
       Type type;              //!< Type to store
-      Register src[];         //!< Address where to load from
+      Register src[0];        //!< Address where to load from
       Register offset;        //!< Alias to make it similar to store
       Tuple values;           //!< Values to load
       AddressSpace addrSpace; //!< Where to load
@@ -389,7 +389,7 @@ namespace ir {
       AddressSpace addrSpace; //!< Where to store
       uint8_t valueNum:7;     //!< Number of values to store
       uint8_t dwAligned:1;    //!< DWORD aligned is what matters with GEN
-      Register dst[];         //!< No destination
+      Register dst[0];        //!< No destination
     };
 
     class ALIGNED_INSTRUCTION SampleInstruction : // TODO
@@ -488,7 +488,7 @@ namespace ir {
       bool wellFormed(const Function &fn, std::string &why) const;
       INLINE void out(std::ostream &out, const Function &fn) const;
       Register dst[1];               //!< RegisterData to store into
-      Register src[];                //!< No source register
+      Register src[0];               //!< No source register
       ImmediateIndex immediateIndex; //!< Index in the vector of immediates
       Type type;                     //!< Type of the immediate
     };
@@ -507,7 +507,7 @@ namespace ir {
       INLINE bool wellFormed(const Function &fn, std::string &why) const;
       INLINE void out(std::ostream &out, const Function &fn) const;
       uint32_t parameters;
-      Register dst[], src[];
+      Register dst[0], src[0];
     };
 
     class ALIGNED_INSTRUCTION LabelInstruction :
@@ -524,7 +524,7 @@ namespace ir {
       INLINE bool wellFormed(const Function &fn, std::string &why) const;
       INLINE void out(std::ostream &out, const Function &fn) const;
       LabelIndex labelIndex;  //!< Index of the label
-      Register dst[], src[];
+      Register dst[0], src[0];
     };
 
 #undef ALIGNED_INSTRUCTION



More information about the Beignet mailing list