ソースを参照

[spirv] Require source location for decorateCounterBuffer.

Ehsan Nasiri 6 年 前
コミット
be49f56b52

+ 1 - 1
tools/clang/include/clang/SPIRV/SpirvBuilder.h

@@ -515,7 +515,7 @@ public:
   /// \brief Decorates the given main buffer with the given counter buffer.
   /// \brief Decorates the given main buffer with the given counter buffer.
   void decorateCounterBuffer(SpirvInstruction *mainBuffer,
   void decorateCounterBuffer(SpirvInstruction *mainBuffer,
                              SpirvInstruction *counterBuffer,
                              SpirvInstruction *counterBuffer,
-                             SourceLocation srcLoc = {});
+                             SourceLocation srcLoc);
 
 
   /// \brief Decorates the given target with the given HLSL semantic string.
   /// \brief Decorates the given target with the given HLSL semantic string.
   void decorateHlslSemantic(SpirvInstruction *target, llvm::StringRef semantic,
   void decorateHlslSemantic(SpirvInstruction *target, llvm::StringRef semantic,

+ 2 - 1
tools/clang/lib/SPIRV/DeclResultIdMapper.cpp

@@ -984,7 +984,8 @@ void DeclResultIdMapper::createCounterVar(
                               decl->getAttr<VKBindingAttr>(),
                               decl->getAttr<VKBindingAttr>(),
                               decl->getAttr<VKCounterBindingAttr>(), true);
                               decl->getAttr<VKCounterBindingAttr>(), true);
     assert(declInstr);
     assert(declInstr);
-    spvBuilder.decorateCounterBuffer(declInstr, counterInstr);
+    spvBuilder.decorateCounterBuffer(declInstr, counterInstr,
+                                     decl->getLocation());
   }
   }
 
 
   if (indices)
   if (indices)