[PATCH 28/79] [Backport to 15][DebugInfo] Align Instruction names to the specificatio...
authorViktoria Maximova <viktoria.maksimova@intel.com>
Thu, 23 Mar 2023 16:20:23 +0000 (09:20 -0700)
committerAndreas Beckmann <anbe@debian.org>
Thu, 8 Feb 2024 21:48:18 +0000 (22:48 +0100)
This patch fixes the discovered typos in Debug Instruction names, so we
can generate spec-conformant SPIR-V module.
https://registry.khronos.org/SPIR-V/specs/unified1/DebugInfo.html

Gbp-Pq: Name 0028-Backport-to-15-DebugInfo-Align-Instruction-names-to-.patch

15 files changed:
lib/SPIRV/LLVMToSPIRVDbgTran.cpp
lib/SPIRV/LLVMToSPIRVDbgTran.h
lib/SPIRV/SPIRVToLLVMDbgTran.cpp
lib/SPIRV/SPIRVToLLVMDbgTran.h
lib/SPIRV/libSPIRV/SPIRV.debug.h
lib/SPIRV/libSPIRV/SPIRVExtInst.h
test/DebugInfo/DebugFunction.cl
test/DebugInfo/DebugInfoSubrangeWithOnlyCount.spt
test/DebugInfo/Generic/tu-member-opaque.spvasm
test/DebugInfo/NonSemantic/DebugFunction.cl
test/DebugInfo/NonSemantic/Shader200/DIModule.ll
test/DebugInfo/NonSemantic/Shader200/DebugInfoSubrange.ll
test/DebugInfo/NonSemantic/Shader200/SourceLanguageLLVMToSPIRV.ll
test/DebugInfo/OpenCL100/DebugInfoSubrange.ll
test/DebugInfo/SourceLanguageLLVMToSPIRV.ll

index a48be01d2f63e8e679b8d37aa44eeb9de51c08d6..4d7caea72c37e97c72bcb16e40bf45b4808849b6 100644 (file)
@@ -344,7 +344,7 @@ SPIRVEntry *LLVMToSPIRVDbgTran::transDbgEntryImpl(const MDNode *MDN) {
 
     // Compilation unit
     case dwarf::DW_TAG_compile_unit:
-      return transDbgCompilationUnit(cast<DICompileUnit>(DIEntry));
+      return transDbgCompileUnit(cast<DICompileUnit>(DIEntry));
 
     // Templates
     case dwarf::DW_TAG_template_type_parameter:
@@ -539,8 +539,7 @@ SPIRVId LLVMToSPIRVDbgTran::getDebugInfoNoneId() {
 
 // Compilation unit
 
-SPIRVEntry *
-LLVMToSPIRVDbgTran::transDbgCompilationUnit(const DICompileUnit *CU) {
+SPIRVEntry *LLVMToSPIRVDbgTran::transDbgCompileUnit(const DICompileUnit *CU) {
   using namespace SPIRVDebug::Operand::CompilationUnit;
   SPIRVWordVec Ops(OperandCount);
   Ops[SPIRVDebugInfoVersionIdx] = SPIRVDebug::DebugInfoVersion;
@@ -977,7 +976,7 @@ SPIRVEntry *LLVMToSPIRVDbgTran::transDbgInheritance(const DIDerivedType *DT) {
   Ops[FlagsIdx] = transDebugFlags(DT);
   if (isNonSemanticDebugInfo())
     transformToConstant(Ops, {FlagsIdx});
-  return BM->addDebugInfo(SPIRVDebug::Inheritance, getVoidTy(), Ops);
+  return BM->addDebugInfo(SPIRVDebug::TypeInheritance, getVoidTy(), Ops);
 }
 
 SPIRVEntry *LLVMToSPIRVDbgTran::transDbgPtrToMember(const DIDerivedType *DT) {
@@ -992,7 +991,7 @@ SPIRVEntry *LLVMToSPIRVDbgTran::transDbgPtrToMember(const DIDerivedType *DT) {
 SPIRVEntry *
 LLVMToSPIRVDbgTran::transDbgTemplateParams(DITemplateParameterArray TPA,
                                            const SPIRVEntry *Target) {
-  using namespace SPIRVDebug::Operand::Template;
+  using namespace SPIRVDebug::Operand::TypeTemplate;
   SPIRVWordVec Ops(MinOperandCount);
   Ops[TargetIdx] = Target->getId();
   for (DITemplateParameter *TP : TPA) {
@@ -1003,7 +1002,7 @@ LLVMToSPIRVDbgTran::transDbgTemplateParams(DITemplateParameterArray TPA,
 
 SPIRVEntry *
 LLVMToSPIRVDbgTran::transDbgTemplateParameter(const DITemplateParameter *TP) {
-  using namespace SPIRVDebug::Operand::TemplateParameter;
+  using namespace SPIRVDebug::Operand::TypeTemplateParameter;
   SPIRVWordVec Ops(OperandCount);
   Ops[NameIdx] = BM->getString(TP->getName().str())->getId();
   Ops[TypeIdx] = transDbgEntry(TP->getType())->getId();
@@ -1023,7 +1022,7 @@ LLVMToSPIRVDbgTran::transDbgTemplateParameter(const DITemplateParameter *TP) {
 
 SPIRVEntry *LLVMToSPIRVDbgTran::transDbgTemplateTemplateParameter(
     const DITemplateValueParameter *TVP) {
-  using namespace SPIRVDebug::Operand::TemplateTemplateParameter;
+  using namespace SPIRVDebug::Operand::TypeTemplateTemplateParameter;
   SPIRVWordVec Ops(OperandCount);
   assert(isa<MDString>(TVP->getValue()));
   MDString *Val = cast<MDString>(TVP->getValue());
@@ -1040,7 +1039,7 @@ SPIRVEntry *LLVMToSPIRVDbgTran::transDbgTemplateTemplateParameter(
 
 SPIRVEntry *LLVMToSPIRVDbgTran::transDbgTemplateParameterPack(
     const DITemplateValueParameter *TVP) {
-  using namespace SPIRVDebug::Operand::TemplateParameterPack;
+  using namespace SPIRVDebug::Operand::TypeTemplateParameterPack;
   SPIRVWordVec Ops(MinOperandCount);
   assert(isa<MDNode>(TVP->getValue()));
   MDNode *Params = cast<MDNode>(TVP->getValue());
@@ -1120,7 +1119,8 @@ SPIRVEntry *LLVMToSPIRVDbgTran::transDbgFunction(const DISubprogram *Func) {
 
   SPIRVEntry *DebugFunc = nullptr;
   if (!Func->isDefinition()) {
-    DebugFunc = BM->addDebugInfo(SPIRVDebug::FunctionDecl, getVoidTy(), Ops);
+    DebugFunc =
+        BM->addDebugInfo(SPIRVDebug::FunctionDeclaration, getVoidTy(), Ops);
   } else {
     // Here we add operands specific function definition
     using namespace SPIRVDebug::Operand::Function;
index c17a67d2e00c9b31b7a36a755098dfb4bf43c089..9e5f711c94e29edd70485538324509e330468fa0 100644 (file)
@@ -99,7 +99,7 @@ private:
   SPIRVId getDebugInfoNoneId();
 
   // Compilation unit
-  SPIRVEntry *transDbgCompilationUnit(const DICompileUnit *CU);
+  SPIRVEntry *transDbgCompileUnit(const DICompileUnit *CU);
 
   /// The following methods (till the end of the file) implement translation
   /// of debug instrtuctions described in the spec.
index d7986137cc7063381e83a48e55618d2b5f3a13ec..152683a507a86608afe40484d7d10a79c02d6399 100644 (file)
@@ -149,7 +149,7 @@ DIScope *SPIRVToLLVMDbgTran::getScope(const SPIRVEntry *ScopeInst) {
 }
 
 DICompileUnit *
-SPIRVToLLVMDbgTran::transCompileUnit(const SPIRVExtInst *DebugInst) {
+SPIRVToLLVMDbgTran::transCompilationUnit(const SPIRVExtInst *DebugInst) {
   const SPIRVWordVec &Ops = DebugInst->getArguments();
 
   using namespace SPIRVDebug::Operand::CompilationUnit;
@@ -337,8 +337,8 @@ SPIRVToLLVMDbgTran::transTypeArrayDynamic(const SPIRVExtInst *DebugInst) {
   DINodeArray SubscriptArray = Builder.getOrCreateArray(Subscripts);
   size_t Size = getDerivedSizeInBits(BaseTy) * TotalCount;
 
-  auto TransOperand = [&](SPIRVWord Idx) -> PointerUnion<DIExpression *,
-                                                         DIVariable *> {
+  auto TransOperand =
+      [&](SPIRVWord Idx) -> PointerUnion<DIExpression *, DIVariable *> {
     if (!getDbgInst<SPIRVDebug::DebugInfoNone>(Ops[Idx])) {
       if (const auto *GV = getDbgInst<SPIRVDebug::GlobalVariable>(Ops[Idx]))
         return transDebugInst<DIGlobalVariable>(GV);
@@ -737,9 +737,10 @@ DINode *SPIRVToLLVMDbgTran::transFunction(const SPIRVExtInst *DebugInst) {
 
   // Here we create fake array of template parameters. If it was plain nullptr,
   // the template parameter operand would be removed in DISubprogram::getImpl.
-  // But we want it to be there, because if there is DebugTemplate instruction
-  // refering to this function, TransTemplate method must be able to replace the
-  // template parameter operand, thus it must be in the operands list.
+  // But we want it to be there, because if there is DebugTypeTemplate
+  // instruction refering to this function, transTypeTemplate method must be
+  // able to replace the template parameter operand, thus it must be in the
+  // operands list.
   SmallVector<llvm::Metadata *, 8> Elts;
   DINodeArray TParams = Builder.getOrCreateArray(Elts);
   llvm::DITemplateParameterArray TParamsArray = TParams.get();
@@ -816,9 +817,10 @@ DINode *SPIRVToLLVMDbgTran::transFunctionDecl(const SPIRVExtInst *DebugInst) {
 
   // Here we create fake array of template parameters. If it was plain nullptr,
   // the template parameter operand would be removed in DISubprogram::getImpl.
-  // But we want it to be there, because if there is DebugTemplate instruction
-  // refering to this function, TransTemplate method must be able to replace the
-  // template parameter operand, thus it must be in the operands list.
+  // But we want it to be there, because if there is DebugTypeTemplate
+  // instruction refering to this function, transTypeTemplate method must be
+  // able to replace the template parameter operand, thus it must be in the
+  // operands list.
   SmallVector<llvm::Metadata *, 8> Elts;
   DINodeArray TParams = Builder.getOrCreateArray(Elts);
   llvm::DITemplateParameterArray TParamsArray = TParams.get();
@@ -932,7 +934,8 @@ DINode *SPIRVToLLVMDbgTran::transTypedef(const SPIRVExtInst *DebugInst) {
   return Builder.createTypedef(Ty, Alias, File, LineNo, Scope);
 }
 
-DINode *SPIRVToLLVMDbgTran::transInheritance(const SPIRVExtInst *DebugInst) {
+DINode *
+SPIRVToLLVMDbgTran::transTypeInheritance(const SPIRVExtInst *DebugInst) {
   using namespace SPIRVDebug::Operand::TypeInheritance;
   const SPIRVWordVec &Ops = DebugInst->getArguments();
   assert(Ops.size() >= OperandCount && "Invalid number of operands");
@@ -953,8 +956,8 @@ DINode *SPIRVToLLVMDbgTran::transInheritance(const SPIRVExtInst *DebugInst) {
 }
 
 DINode *
-SPIRVToLLVMDbgTran::transTemplateParameter(const SPIRVExtInst *DebugInst) {
-  using namespace SPIRVDebug::Operand::TemplateParameter;
+SPIRVToLLVMDbgTran::transTypeTemplateParameter(const SPIRVExtInst *DebugInst) {
+  using namespace SPIRVDebug::Operand::TypeTemplateParameter;
   const SPIRVWordVec &Ops = DebugInst->getArguments();
   assert(Ops.size() >= OperandCount && "Invalid number of operands");
   StringRef Name = getString(Ops[NameIdx]);
@@ -972,9 +975,9 @@ SPIRVToLLVMDbgTran::transTemplateParameter(const SPIRVExtInst *DebugInst) {
   return Builder.createTemplateTypeParameter(Context, Name, Ty, false);
 }
 
-DINode *SPIRVToLLVMDbgTran::transTemplateTemplateParameter(
+DINode *SPIRVToLLVMDbgTran::transTypeTemplateTemplateParameter(
     const SPIRVExtInst *DebugInst) {
-  using namespace SPIRVDebug::Operand::TemplateTemplateParameter;
+  using namespace SPIRVDebug::Operand::TypeTemplateTemplateParameter;
   const SPIRVWordVec &Ops = DebugInst->getArguments();
   assert(Ops.size() >= OperandCount && "Invalid number of operands");
   StringRef Name = getString(Ops[NameIdx]);
@@ -984,9 +987,9 @@ DINode *SPIRVToLLVMDbgTran::transTemplateTemplateParameter(
                                                  TemplName);
 }
 
-DINode *
-SPIRVToLLVMDbgTran::transTemplateParameterPack(const SPIRVExtInst *DebugInst) {
-  using namespace SPIRVDebug::Operand::TemplateParameterPack;
+DINode *SPIRVToLLVMDbgTran::transTypeTemplateParameterPack(
+    const SPIRVExtInst *DebugInst) {
+  using namespace SPIRVDebug::Operand::TypeTemplateParameterPack;
   const SPIRVWordVec &Ops = DebugInst->getArguments();
   assert(Ops.size() >= MinOperandCount && "Invalid number of operands");
   StringRef Name = getString(Ops[NameIdx]);
@@ -999,8 +1002,8 @@ SPIRVToLLVMDbgTran::transTemplateParameterPack(const SPIRVExtInst *DebugInst) {
   return Builder.createTemplateParameterPack(Context, Name, nullptr, Pack);
 }
 
-MDNode *SPIRVToLLVMDbgTran::transTemplate(const SPIRVExtInst *DebugInst) {
-  using namespace SPIRVDebug::Operand::Template;
+MDNode *SPIRVToLLVMDbgTran::transTypeTemplate(const SPIRVExtInst *DebugInst) {
+  using namespace SPIRVDebug::Operand::TypeTemplate;
   const SPIRVWordVec &Ops = DebugInst->getArguments();
   const size_t NumOps = Ops.size();
   assert(NumOps >= MinOperandCount && "Invalid number of operands");
@@ -1104,7 +1107,7 @@ MDNode *SPIRVToLLVMDbgTran::transDebugInstImpl(const SPIRVExtInst *DebugInst) {
     return nullptr;
 
   case SPIRVDebug::CompilationUnit:
-    return transCompileUnit(DebugInst);
+    return transCompilationUnit(DebugInst);
 
   case SPIRVDebug::TypeBasic:
     return transTypeBasic(DebugInst);
@@ -1151,7 +1154,7 @@ MDNode *SPIRVToLLVMDbgTran::transDebugInstImpl(const SPIRVExtInst *DebugInst) {
   case SPIRVDebug::Function:
     return transFunction(DebugInst);
 
-  case SPIRVDebug::FunctionDecl:
+  case SPIRVDebug::FunctionDeclaration:
     return transFunctionDecl(DebugInst);
 
   case SPIRVDebug::GlobalVariable:
@@ -1166,20 +1169,20 @@ MDNode *SPIRVToLLVMDbgTran::transDebugInstImpl(const SPIRVExtInst *DebugInst) {
   case SPIRVDebug::InlinedAt:
     return transDebugInlined(DebugInst);
 
-  case SPIRVDebug::Inheritance:
-    return transInheritance(DebugInst);
+  case SPIRVDebug::TypeInheritance:
+    return transTypeInheritance(DebugInst);
 
   case SPIRVDebug::TypeTemplateParameter:
-    return transTemplateParameter(DebugInst);
+    return transTypeTemplateParameter(DebugInst);
 
   case SPIRVDebug::TypeTemplateTemplateParameter:
-    return transTemplateTemplateParameter(DebugInst);
+    return transTypeTemplateTemplateParameter(DebugInst);
 
   case SPIRVDebug::TypeTemplateParameterPack:
-    return transTemplateParameterPack(DebugInst);
+    return transTypeTemplateParameterPack(DebugInst);
 
   case SPIRVDebug::TypeTemplate:
-    return transTemplate(DebugInst);
+    return transTypeTemplate(DebugInst);
 
   case SPIRVDebug::ImportedEntity:
     return transImportedEntry(DebugInst);
index 28a42d377084d353afee5da7d05f5c74d09552d9..2102f218e101e1e4c999f1233ead7b4a7e08c928 100644 (file)
@@ -102,7 +102,7 @@ private:
 
   MDNode *transDebugInlined(const SPIRVExtInst *Inst);
 
-  DICompileUnit *transCompileUnit(const SPIRVExtInst *DebugInst);
+  DICompileUnit *transCompilationUnit(const SPIRVExtInst *DebugInst);
 
   DIBasicType *transTypeBasic(const SPIRVExtInst *DebugInst);
 
@@ -127,11 +127,11 @@ private:
 
   DINode *transTypeEnum(const SPIRVExtInst *DebugInst);
 
-  DINode *transTemplateParameter(const SPIRVExtInst *DebugInst);
-  DINode *transTemplateTemplateParameter(const SPIRVExtInst *DebugInst);
-  DINode *transTemplateParameterPack(const SPIRVExtInst *DebugInst);
+  DINode *transTypeTemplateParameter(const SPIRVExtInst *DebugInst);
+  DINode *transTypeTemplateTemplateParameter(const SPIRVExtInst *DebugInst);
+  DINode *transTypeTemplateParameterPack(const SPIRVExtInst *DebugInst);
 
-  MDNode *transTemplate(const SPIRVExtInst *DebugInst);
+  MDNode *transTypeTemplate(const SPIRVExtInst *DebugInst);
 
   DINode *transTypeFunction(const SPIRVExtInst *DebugInst);
 
@@ -150,7 +150,7 @@ private:
 
   DINode *transTypedef(const SPIRVExtInst *DebugInst);
 
-  DINode *transInheritance(const SPIRVExtInst *DebugInst);
+  DINode *transTypeInheritance(const SPIRVExtInst *DebugInst);
 
   DINode *transImportedEntry(const SPIRVExtInst *DebugInst);
 
index dfe2535bd197494daccef763794883a702b6196f..3454d7c7554770cbdf3fe209f6e994a8d6b6ad7e 100644 (file)
@@ -26,14 +26,14 @@ enum Instruction {
   TypeEnum                      = 9,
   TypeComposite                 = 10,
   TypeMember                    = 11,
-  Inheritance                   = 12,
+  TypeInheritance               = 12,
   TypePtrToMember               = 13,
   TypeTemplate                  = 14,
   TypeTemplateParameter         = 15,
   TypeTemplateParameterPack     = 16,
   TypeTemplateTemplateParameter = 17,
   GlobalVariable                = 18,
-  FunctionDecl                  = 19,
+  FunctionDeclaration           = 19,
   Function                      = 20,
   LexicalBlock                  = 21,
   LexicalBlockDiscriminator     = 22,
@@ -456,7 +456,7 @@ enum {
 };
 }
 
-namespace Template {
+namespace TypeTemplate {
 enum {
   TargetIdx         = 0,
   FirstParameterIdx = 1,
@@ -464,7 +464,7 @@ enum {
 };
 }
 
-namespace TemplateParameter {
+namespace TypeTemplateParameter {
 enum {
   NameIdx      = 0,
   TypeIdx      = 1,
@@ -476,7 +476,7 @@ enum {
 };
 }
 
-namespace TemplateTemplateParameter {
+namespace TypeTemplateTemplateParameter {
 enum {
   NameIdx         = 0,
   TemplateNameIdx = 1,
@@ -487,7 +487,7 @@ enum {
 };
 }
 
-namespace TemplateParameterPack {
+namespace TypeTemplateParameterPack {
 enum {
   NameIdx           = 0,
   SourceIdx         = 1,
index 2085db6e1f26b8bc7e8f11bc8d130220bdb3f672..f9d55433cb41a0725bfd56ef0f0e4f9f494cf5f0 100644 (file)
@@ -221,7 +221,7 @@ SPIRV_DEF_NAMEMAP(OCLExtOpKind, OCLExtOpMap)
 typedef SPIRVDebug::Instruction SPIRVDebugExtOpKind;
 template <> inline void SPIRVMap<SPIRVDebugExtOpKind, std::string>::init() {
   add(SPIRVDebug::DebugInfoNone, "DebugInfoNone");
-  add(SPIRVDebug::CompilationUnit, "DebugCompileUnit");
+  add(SPIRVDebug::CompilationUnit, "DebugCompilationUnit");
   add(SPIRVDebug::Source, "DebugSource");
   add(SPIRVDebug::TypeBasic, "DebugTypeBasic");
   add(SPIRVDebug::TypePointer, "DebugTypePointer");
@@ -234,19 +234,19 @@ template <> inline void SPIRVMap<SPIRVDebugExtOpKind, std::string>::init() {
   add(SPIRVDebug::TypeMember, "DebugTypeMember");
   add(SPIRVDebug::TypeEnum, "DebugTypeEnum");
   add(SPIRVDebug::Typedef, "DebugTypedef");
-  add(SPIRVDebug::TypeTemplateParameter, "DebugTemplateParameter");
-  add(SPIRVDebug::TypeTemplateParameterPack, "DebugTemplateParameterPack");
+  add(SPIRVDebug::TypeTemplateParameter, "DebugTypeTemplateParameter");
+  add(SPIRVDebug::TypeTemplateParameterPack, "DebugTypeTemplateParameterPack");
   add(SPIRVDebug::TypeTemplateTemplateParameter,
-      "DebugTemplateTemplateParameter");
-  add(SPIRVDebug::TypeTemplate, "DebugTemplate");
+      "DebugTypeTemplateTemplateParameter");
+  add(SPIRVDebug::TypeTemplate, "DebugTypeTemplate");
   add(SPIRVDebug::TypePtrToMember, "DebugTypePtrToMember,");
   add(SPIRVDebug::TypeSubrange, "DebugTypeSubrange");
   add(SPIRVDebug::TypeString, "DebugTypeString");
-  add(SPIRVDebug::Inheritance, "DebugInheritance");
+  add(SPIRVDebug::TypeInheritance, "DebugTypeInheritance");
   add(SPIRVDebug::Function, "DebugFunction");
-  add(SPIRVDebug::FunctionDecl, "DebugFunctionDecl");
+  add(SPIRVDebug::FunctionDeclaration, "DebugFunctionDeclaration");
   add(SPIRVDebug::LexicalBlock, "DebugLexicalBlock");
-  add(SPIRVDebug::LexicalBlockDiscriminator, "LexicalBlockDiscriminator");
+  add(SPIRVDebug::LexicalBlockDiscriminator, "DebugLexicalBlockDiscriminator");
   add(SPIRVDebug::LocalVariable, "DebugLocalVariable");
   add(SPIRVDebug::InlinedVariable, "DebugInlinedVariable");
   add(SPIRVDebug::GlobalVariable, "DebugGlobalVariable");
index a587b93c12e19ae0c7f44abbc5ead8f236fd7a3c..c7e5899ff80a686412dbdf3c9399d611b0a1b202 100644 (file)
@@ -1,8 +1,8 @@
 // Check for 2 things:
 // - After round trip translation function definition has !dbg metadata attached
 //   specifically if -gline-tables-only was used for Clang
-// - Parent operand of DebugFunction is DebugCompileUnit, not an OpString, even
-//   if in LLVM IR it points to a DIFile instead of DICompileUnit.
+// - Parent operand of DebugFunction is DebugCompilationUnit, not an OpString,
+//   even if in LLVM IR it points to a DIFile instead of DICompileUnit.
 
 // RUN: %clang_cc1 %s -cl-std=clc++ -emit-llvm-bc -triple spir -debug-info-kind=line-tables-only -O0 -o - -no-opaque-pointers | llvm-spirv -o %t.spv
 // RUN: llvm-spirv %t.spv -to-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV
@@ -17,7 +17,7 @@ void kernel k() {
 
 // CHECK-SPIRV: String [[foo:[0-9]+]] "foo"
 // CHECK-SPIRV: String [[k:[0-9]+]] "k"
-// CHECK-SPIRV: [[CU:[0-9]+]] {{[0-9]+}} DebugCompileUnit
+// CHECK-SPIRV: [[CU:[0-9]+]] {{[0-9]+}} DebugCompilationUnit
 // CHECK-SPIRV: DebugFunction [[foo]] {{.*}} [[CU]] {{.*}} [[foo_id:[0-9]+]] {{[0-9]+}} {{$}}
 // CHECK-SPIRV: DebugFunction [[k]] {{.*}} [[CU]] {{.*}} [[k_id:[0-9]+]] {{[0-9]+}} {{$}}
 
index 28f905108c8996045f797d1bf7395c44eb269029..67d2a519ff1874c3aa1d6ad6e46486dad76ed9b6 100644 (file)
 
 5 ExtInst 3 27 2 DebugInfoNone 
 7 ExtInst 3 30 2 DebugSource 29 27 
-9 ExtInst 3 31 2 DebugCompileUnit 65536 4 30 21
+9 ExtInst 3 31 2 DebugCompilationUnit 65536 4 30 21
 7 ExtInst 3 32 2 DebugTypeFunction 0 27 
 8 ExtInst 3 35 2 DebugTypeBasic 33 34 3 
 7 ExtInst 3 36 2 DebugTypeArray 35 11 ; Count = 1000
 8 ExtInst 3 37 2 DebugTypePointer 36 4294967295 0 
 16 ExtInst 3 40 2 DebugFunction 38 32 30 25 0 31 39 44 25 27 27 
 12 ExtInst 3 42 2 DebugLocalVariable 41 37 30 15 0 40 0 
-6 ExtInst 3 43 2 DebugTemplate 40 
+6 ExtInst 3 43 2 DebugTypeTemplate 40
 6 ExtInst 3 44 2 DebugOperation 0 
 6 ExtInst 3 45 2 DebugExpression 44 
 
index 135afcbfee256671f9aa2b7bd64c1abb9f7f6a88..bebeb6737ed01f11db3498dd45d128abbbc335cc 100644 (file)
@@ -52,7 +52,7 @@
 
 5 ExtInst 3 7 2 DebugInfoNone
 7 ExtInst 3 10 2 DebugSource 9 7
-9 ExtInst 3 11 2 DebugCompileUnit 65536 0 10 12
+9 ExtInst 3 11 2 DebugCompilationUnit 65536 0 10 12
 7 ExtInst 3 12 2 DebugTypeFunction 0 7
 7 ExtInst 3 16 2 DebugSource 15 7
 8 ExtInst 3 21 2 DebugTypeBasic 20 18 4
index c913fc0450c2c27e7c8a5babcf572e50867c2e1d..da27864f27ad74f522f93e04e5cc7af2836cc5bb 100644 (file)
@@ -1,8 +1,8 @@
 // Check for 2 things:
 // - After round trip translation function definition has !dbg metadata attached
 //   specifically if -gline-tables-only was used for Clang
-// - Parent operand of DebugFunction is DebugCompileUnit, not an OpString, even
-//   if in LLVM IR it points to a DIFile instead of DICompileUnit.
+// - Parent operand of DebugFunction is DebugCompilationUnit, not an OpString,
+//   even if in LLVM IR it points to a DIFile instead of DICompileUnit.
 
 // RUN: %clang_cc1 %s -cl-std=clc++ -emit-llvm-bc -triple spir -debug-info-kind=line-tables-only -O0 -o - | llvm-spirv -o %t.spv
 // RUN: llvm-spirv %t.spv --spirv-debug-info-version=nonsemantic-shader-100 -to-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV
@@ -17,7 +17,7 @@ void kernel k() {
 
 // CHECK-SPIRV: String [[foo:[0-9]+]] "foo"
 // CHECK-SPIRV: String [[k:[0-9]+]] "k"
-// CHECK-SPIRV: [[CU:[0-9]+]] {{[0-9]+}} DebugCompileUnit
+// CHECK-SPIRV: [[CU:[0-9]+]] {{[0-9]+}} DebugCompilationUnit
 // CHECK-SPIRV: DebugFunction [[foo]] {{.*}} [[CU]] {{.*}} [[foo_id:[0-9]+]] {{[0-9]+}} {{$}}
 // CHECK-SPIRV: DebugFunction [[k]] {{.*}} [[CU]] {{.*}} [[k_id:[0-9]+]] {{[0-9]+}} {{$}}
 
index 8347d0101126f636655b641aa98d8a1275f257a1..fb83dfca0bc1af2f9ae0fd8144d5560d0a9689cf 100644 (file)
@@ -34,7 +34,7 @@ target triple = "spir64-unknown-unknown"
 ; CHECK-SPIRV-DAG: Constant [[#TypeInt32]] [[#DWARF:]] 4
 
 ; CHECK-SPIRV: ExtInst [[#]] [[#Source:]] [[#]] DebugSource [[#FileName]]
-; CHECK-SPIRV: ExtInst [[#]] [[#Parent:]] [[#]] DebugCompileUnit [[#Version]] [[#DWARF]]
+; CHECK-SPIRV: ExtInst [[#]] [[#Parent:]] [[#]] DebugCompilationUnit [[#Version]] [[#DWARF]]
 ; CHECK-SPIRV: ExtInst [[#]] [[#SourceEmpty:]] [[#]] DebugSource [[#EmptyStr]]
 ; CHECK-SPIRV: ExtInst [[#]] [[#Module:]] [[#]] DebugModule [[#Name]] [[#SourceEmpty]] [[#Constant0]] [[#Parent]] [[#Defines]] [[#IncludePath]] [[#ApiNotes]] [[#Constant0]]
 ; CHECK-SPIRV: ExtInst [[#]] [[#]] [[#]] DebugImportedEntity [[#]] [[#]] [[#]] [[#Source]] [[#Module]]
index 23a729fbbc93963bf5acf4f3662f3bebece6252c..d83e170a611d8c537bd4e9891ce58e6e19b53d37 100644 (file)
@@ -16,8 +16,8 @@
 ; CHECK-SPIRV: [[#DINoneId:]] [[#EISId]] DebugInfoNone
 
 ; CHECK-SPIRV: [[#DebugFuncId:]] [[#EISId]] DebugFunction
-; CHECK-SPIRV: [[#DebugTemplate:]] [[#EISId]] DebugTemplate [[#DebugFuncId]]
-; CHECK-SPIRV: [[#LocalVarId:]] [[#EISId]] DebugLocalVariable [[#LocalVarNameId]] [[#]] [[#]] [[#]] [[#]] [[#DebugTemplate]]
+; CHECK-SPIRV: [[#DebugTypeTemplate:]] [[#EISId]] DebugTypeTemplate [[#DebugFuncId]]
+; CHECK-SPIRV: [[#LocalVarId:]] [[#EISId]] DebugLocalVariable [[#LocalVarNameId]] [[#]] [[#]] [[#]] [[#]] [[#DebugTypeTemplate]]
 ; CHECK-SPIRV: [[#EISId]] DebugTypeSubrange [[#DINoneId]] [[#Constant1Id]] [[#LocalVarId]]  [[#DINoneId]]
 
 ; CHECK-SPIRV: [[#DIExprId:]] [[#EISId]] DebugExpression
index c1b3d8ca77961c988ff4c4bb528de8a96e253b29..e27e0f7db50f5a406e5a6e27159b24e2ac7bae77 100644 (file)
 ; RUN: llvm-spirv --spirv-debug-info-version=nonsemantic-shader-200 -spirv-text %t.bc -o - | FileCheck %s --check-prefix=CHECK-CPP14
 
 ; CHECK-C99: Constant [[#]] [[#Constant:]] 211
-; CHECK-C99: DebugCompileUnit [[#]] [[#]] [[#]] [[#Constant]]
+; CHECK-C99: DebugCompilationUnit [[#]] [[#]] [[#]] [[#Constant]]
 ; CHECK-OPENCLC: Constant [[#]] [[#Constant:]] 3
-; CHECK-OPENCLC: DebugCompileUnit [[#]] [[#]] [[#]] [[#Constant]]
+; CHECK-OPENCLC: DebugCompilationUnit [[#]] [[#]] [[#]] [[#Constant]]
 ; CHECK-CPP: Constant [[#]] [[#Constant:]] 214
-; CHECK-CPP: DebugCompileUnit [[#]] [[#]] [[#]] [[#Constant]]
+; CHECK-CPP: DebugCompilationUnit [[#]] [[#]] [[#]] [[#Constant]]
 ; CHECK-CPP14: Constant [[#]] [[#Constant:]] 217
-; CHECK-CPP14: DebugCompileUnit [[#]] [[#]] [[#]] [[#Constant]]
+; CHECK-CPP14: DebugCompilationUnit [[#]] [[#]] [[#]] [[#Constant]]
 
 target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
 target triple = "spir64-unknown-unknown"
index 27c810832c240ac14fa19e17a6b83a6477bae854..fcc11485f32722b3e196b2c37a8d209184b66125 100644 (file)
@@ -14,7 +14,7 @@
 ; CHECK-SPIRV: Constant [[#TypeInt64Id]] [[#NegativeCount:]] 4294967295 4294967295
 
 ; CHECK-SPIRV: [[#DbgFuncId:]] [[#]] DebugFunction [[#FuncNameId]]
-; CHECK-SPIRV: [[#DbgTemplateId:]] [[#]] DebugTemplate [[#DbgFuncId]]
+; CHECK-SPIRV: [[#DbgTemplateId:]] [[#]] DebugTypeTemplate [[#DbgFuncId]]
 ; CHECK-SPIRV: [[#]] [[#DbgLocVarId:]] [[#]] DebugLocalVariable [[#VarNameId]] [[#]] [[#]] [[#]] [[#]] [[#DbgTemplateId]]
 ; CHECK-SPIRV: DebugTypeArray [[#]] [[#DbgLocVarId]] [[#LowerBoundId]]
 
index f6c381c565a97ff7c4c460042ce729796dd2a25a..51b4376e7fb9bf92b71bb11677c3a82b8cd6d334 100644 (file)
@@ -39,5 +39,5 @@ entry:
 !7 = distinct !DISubprogram(name: "func", scope: !8, file: !8, line: 1, scopeLine: 2, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)
 !8 = !DIFile(filename: "test.cl", directory: "/tmp", checksumkind: CSK_MD5, checksum: "18aa9ce738eaafc7b7b7181c19092815")
 
-; CHECK-OPENCLC: DebugCompileUnit {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} 3
-; CHECK-CPP4OPENCL: DebugCompileUnit {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} 6
+; CHECK-OPENCLC: DebugCompilationUnit {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} 3
+; CHECK-CPP4OPENCL: DebugCompilationUnit {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} 6