mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Fixed debug info for static local variables
This commit is contained in:
parent
67b30b639d
commit
485316385b
1 changed files with 10 additions and 0 deletions
|
@ -15195,6 +15195,16 @@ void BfModule::DoLocalVariableDebugInfo(BfLocalVariable* localVarDef, bool doAli
|
|||
|
||||
if (!mBfIRBuilder->mIgnoreWrites)
|
||||
{
|
||||
if ((localVarDef->mIsStatic) && (localVarDef->mAddr) && (!localVarDef->mResolvedType->IsValuelessType()))
|
||||
{
|
||||
auto refType = CreateRefType(localVarDef->mResolvedType);
|
||||
diType = mBfIRBuilder->DbgGetType(refType);
|
||||
|
||||
auto refAlloca = CreateAlloca(refType);
|
||||
mBfIRBuilder->CreateStore(localVarDef->mAddr, refAlloca);
|
||||
diValue = refAlloca;
|
||||
}
|
||||
|
||||
auto diVariable = mBfIRBuilder->DbgCreateAutoVariable(mCurMethodState->mCurScope->mDIScope,
|
||||
localVarDef->mName, mCurFilePosition.mFileInstance->mDIFile, mCurFilePosition.mCurLine, diType, initType);
|
||||
localVarDef->mDbgVarInst = diVariable;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue