Преглед на файлове

[spirv] Require source location for decorateCounterBuffer.

Ehsan Nasiri преди 6 години
родител
ревизия
be49f56b52
променени са 2 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 1 1
      tools/clang/include/clang/SPIRV/SpirvBuilder.h
  2. 2 1
      tools/clang/lib/SPIRV/DeclResultIdMapper.cpp

+ 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.
   void decorateCounterBuffer(SpirvInstruction *mainBuffer,
                              SpirvInstruction *counterBuffer,
-                             SourceLocation srcLoc = {});
+                             SourceLocation srcLoc);
 
   /// \brief Decorates the given target with the given HLSL semantic string.
   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<VKCounterBindingAttr>(), true);
     assert(declInstr);
-    spvBuilder.decorateCounterBuffer(declInstr, counterInstr);
+    spvBuilder.decorateCounterBuffer(declInstr, counterInstr,
+                                     decl->getLocation());
   }
 
   if (indices)