Juan Manuel Martinez =?utf-8?q?Caamaño?Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>
================
@@ -878,7 +818,12 @@ std::optional<MCRegister>
SPIRVNonSemanticDebugHandler::emitDebugGlobalVariable(
SPIRV::ModuleAnalysisInfo &MAI) {
assert(GV && "GV must not be null in emitDebugGlobalVariable");
- MCRegister ParentReg = resolveGlobalVariableParent(GV);
+ assert(!CompileUnits.empty() &&
+ "emitDebugGlobalVariable requires non-empty CompileUnits");
+ auto ParentRegOpt = resolveScope(GV->getScope());
+ assert(ParentRegOpt && "DebugCompilationUnit must be emitted before "
----------------
dnovillo wrote:
I think you mean to do something along the lines of `if (!ParentRegOpt) return
nullopt;`? Definitely don't want to crash if this happens :)
https://github.com/llvm/llvm-project/pull/219925
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits