浏览代码

Don't emit type annotation for empty struct. (#802)

After dxil generation, there should be no empty struct used in instructions.
Xiang Li 7 年之前
父节点
当前提交
6adad2b8a3
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      lib/HLSL/DxilMetadataHelper.cpp

+ 3 - 1
lib/HLSL/DxilMetadataHelper.cpp

@@ -686,7 +686,9 @@ void DxilMDHelper::EmitDxilTypeSystem(DxilTypeSystem &TypeSystem, vector<GlobalV
   for (auto it = TypeMap.begin(); it != TypeMap.end(); ++it, GVIdx++) {
     StructType *pStructType = const_cast<StructType *>(it->first);
     DxilStructAnnotation *pA = it->second.get();
-
+    // Don't emit type annotation for empty struct.
+    if (pA->IsEmptyStruct())
+      continue;
     // Emit struct type field annotations.
     Metadata *pMD = EmitDxilStructAnnotation(*pA);