Fix bug so that programIndex (et al.) are available in the debugger.
It's now possible to successfully print out the value of programIndex, programCount, etc., in the debugger. The issue was that they were defined as having InternalLinkage, which meant that DCE removed them at the end of compilation. Now they're declared to have WeakODRLinkage, which ensures that one copy survives (but there aren't multiply-defined symbols when compiling multiple files.)
This commit is contained in:
2
func.cpp
2
func.cpp
@@ -198,7 +198,7 @@ Function::emitCode(FunctionEmitContext *ctx, llvm::Function *function,
|
||||
// value
|
||||
maskSymbol->storagePtr = ctx->GetFullMaskPointer();
|
||||
|
||||
// add debugging info for __mask, programIndex, ...
|
||||
// add debugging info for __mask
|
||||
maskSymbol->pos = firstStmtPos;
|
||||
ctx->EmitVariableDebugInfo(maskSymbol);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user