Ver Fonte

[spirv] Require source location in decorateIndex.

Ehsan Nasiri há 6 anos atrás
pai
commit
c1885aa506

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

@@ -494,8 +494,7 @@ public:
                         SourceLocation srcLoc = {});
 
   /// \brief Decorates the given target with the given index.
-  void decorateIndex(SpirvInstruction *target, uint32_t index,
-                     SourceLocation srcLoc = {});
+  void decorateIndex(SpirvInstruction *target, uint32_t index, SourceLocation);
 
   /// \brief Decorates the given target with the given descriptor set and
   /// binding number.

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

@@ -1211,7 +1211,8 @@ bool DeclResultIdMapper::finalizeStageIOLocations(bool forInput) {
 
       spvBuilder.decorateLocation(var.getSpirvInstr(), loc);
       if (var.getIndexAttr())
-        spvBuilder.decorateIndex(var.getSpirvInstr(), idx);
+        spvBuilder.decorateIndex(var.getSpirvInstr(), idx,
+                                 var.getSemanticInfo().loc);
     }
 
     return noError;