Commit fc45551d authored by pratik ashar's avatar pratik ashar Committed by gbsbuild

Fix incorrect template parameter index used

in SPIRV debug info adaptor

Change-Id: I1b48785a44934c3b30a8ce5b0d73491b5c1e3f42
parent 87a37cc6
......@@ -587,8 +587,13 @@ public:
if (isa<DISubprogram>(target)) {
// This constant matches with one used in
// DISubprogram::getRawTemplateParams()
#if LLVM_VERSION_MAJOR == 4
const unsigned TemplateParamsIndex = 8;
#elif LLVM_VERSION_MAJOR == 7
const unsigned TemplateParamsIndex = 9;
#endif
target->replaceOperandWith(TemplateParamsIndex, TParams.get());
assert(cast<DISubprogram>(target)->getRawTemplateParams() == TParams.get() && "Invalid template parameters");
return target;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment