1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

LLVM 13 debug info fixes

This commit is contained in:
Brian Fiete 2022-02-07 14:27:05 -05:00
parent d85f164b8a
commit 3635e3830a
3 changed files with 21 additions and 11 deletions

View file

@ -2614,9 +2614,13 @@ void BfModule::UpdateSrcPos(BfAstNode* astNode, BfSrcPosFlags flags, int debugLo
if (mCurMethodState->mCrossingMixin)
inlineAt = BfIRMDNode();
if ((!useDIScope) && (mIsComptimeModule))
if ((!useDIScope) && (mIsComptimeModule))
useDIScope = wantDIFile;
mBfIRBuilder->SetCurrentDebugLocation(mCurFilePosition.mCurLine + 1, column, useDIScope, inlineAt);
if (!useDIScope)
mBfIRBuilder->ClearDebugLocation();
else
mBfIRBuilder->SetCurrentDebugLocation(mCurFilePosition.mCurLine + 1, column, useDIScope, inlineAt);
if ((flags & BfSrcPosFlag_Expression) == 0)
mBfIRBuilder->CreateStatementStart();
}
@ -2639,15 +2643,19 @@ void BfModule::SetIllegalSrcPos(BfSrcPosFlags flags)
{
if ((mBfIRBuilder->DbgHasInfo()) && (mCurMethodState != NULL))
{
if ((mCurMethodState->mCurScope->mDIInlinedAt) && (mCompiler->mOptions.IsCodeView()))
auto curScope = mCurMethodState->mCurScope->mDIScope;
if (curScope)
{
// Currently, CodeView does not record column positions so we can't use an illegal column position as an "invalid" marker
mBfIRBuilder->SetCurrentDebugLocation(0, 0, mCurMethodState->mCurScope->mDIScope, mCurMethodState->mCurScope->mDIInlinedAt);
}
else
{
// Set to whatever it previously was but at column zero, which we will know to be illegal
mBfIRBuilder->SetCurrentDebugLocation(mCurFilePosition.mCurLine + 1, 0, mCurMethodState->mCurScope->mDIScope, mCurMethodState->mCurScope->mDIInlinedAt);
if ((mCurMethodState->mCurScope->mDIInlinedAt) && (mCompiler->mOptions.IsCodeView()))
{
// Currently, CodeView does not record column positions so we can't use an illegal column position as an "invalid" marker
mBfIRBuilder->SetCurrentDebugLocation(0, 0, curScope, mCurMethodState->mCurScope->mDIInlinedAt);
}
else
{
// Set to whatever it previously was but at column zero, which we will know to be illegal
mBfIRBuilder->SetCurrentDebugLocation(mCurFilePosition.mCurLine + 1, 0, curScope, mCurMethodState->mCurScope->mDIInlinedAt);
}
}
if ((flags & BfSrcPosFlag_Expression) == 0)