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:
Matt Pharr
2012-04-28 13:47:31 -10:00
parent 27b62781cc
commit a1a43cdfe0
3 changed files with 49 additions and 36 deletions

View File

@@ -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);