mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-24 15:01:16 +01:00
Merge pull request #12798 from mitaclaw/branch-watch-tool-fixes-2
Branch Watch Tool: Optimizations
This commit is contained in:
commit
e282649b57
@ -144,6 +144,7 @@ add_library(common
|
|||||||
TraversalClient.h
|
TraversalClient.h
|
||||||
TraversalProto.h
|
TraversalProto.h
|
||||||
TypeUtils.h
|
TypeUtils.h
|
||||||
|
Unreachable.h
|
||||||
UPnP.cpp
|
UPnP.cpp
|
||||||
UPnP.h
|
UPnP.h
|
||||||
VariantUtil.h
|
VariantUtil.h
|
||||||
|
21
Source/Core/Common/Unreachable.h
Normal file
21
Source/Core/Common/Unreachable.h
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
// Copyright 2024 Dolphin Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Common/CommonFuncs.h"
|
||||||
|
|
||||||
|
namespace Common
|
||||||
|
{
|
||||||
|
// TODO C++23: Replace with std::unreachable.
|
||||||
|
[[noreturn]] inline void Unreachable()
|
||||||
|
{
|
||||||
|
#ifdef _DEBUG
|
||||||
|
Crash();
|
||||||
|
#elif defined(_MSC_VER) && !defined(__clang__)
|
||||||
|
__assume(false);
|
||||||
|
#else
|
||||||
|
__builtin_unreachable();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
} // namespace Common
|
@ -165,6 +165,7 @@
|
|||||||
<ClInclude Include="Common\TraversalClient.h" />
|
<ClInclude Include="Common\TraversalClient.h" />
|
||||||
<ClInclude Include="Common\TraversalProto.h" />
|
<ClInclude Include="Common\TraversalProto.h" />
|
||||||
<ClInclude Include="Common\TypeUtils.h" />
|
<ClInclude Include="Common\TypeUtils.h" />
|
||||||
|
<ClInclude Include="Common\Unreachable.h" />
|
||||||
<ClInclude Include="Common\UPnP.h" />
|
<ClInclude Include="Common\UPnP.h" />
|
||||||
<ClInclude Include="Common\VariantUtil.h" />
|
<ClInclude Include="Common\VariantUtil.h" />
|
||||||
<ClInclude Include="Common\Version.h" />
|
<ClInclude Include="Common\Version.h" />
|
||||||
|
@ -141,15 +141,15 @@ bool BranchWatchProxyModel::filterAcceptsRow(int source_row, const QModelIndex&)
|
|||||||
if (!m_origin_symbol_name.isEmpty())
|
if (!m_origin_symbol_name.isEmpty())
|
||||||
{
|
{
|
||||||
if (const QVariant& symbol_name_v = sourceModel()->GetSymbolList()[source_row].origin_name;
|
if (const QVariant& symbol_name_v = sourceModel()->GetSymbolList()[source_row].origin_name;
|
||||||
!symbol_name_v.isValid() ||
|
!symbol_name_v.isValid() || !static_cast<const QString*>(symbol_name_v.data())
|
||||||
!symbol_name_v.value<QString>().contains(m_origin_symbol_name, Qt::CaseInsensitive))
|
->contains(m_origin_symbol_name, Qt::CaseInsensitive))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!m_destin_symbol_name.isEmpty())
|
if (!m_destin_symbol_name.isEmpty())
|
||||||
{
|
{
|
||||||
if (const QVariant& symbol_name_v = sourceModel()->GetSymbolList()[source_row].destin_name;
|
if (const QVariant& symbol_name_v = sourceModel()->GetSymbolList()[source_row].destin_name;
|
||||||
!symbol_name_v.isValid() ||
|
!symbol_name_v.isValid() || !static_cast<const QString*>(symbol_name_v.data())
|
||||||
!symbol_name_v.value<QString>().contains(m_destin_symbol_name, Qt::CaseInsensitive))
|
->contains(m_destin_symbol_name, Qt::CaseInsensitive))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include "Common/Assert.h"
|
#include "Common/Assert.h"
|
||||||
#include "Common/GekkoDisassembler.h"
|
#include "Common/GekkoDisassembler.h"
|
||||||
|
#include "Common/Unreachable.h"
|
||||||
#include "Core/Debugger/BranchWatch.h"
|
#include "Core/Debugger/BranchWatch.h"
|
||||||
#include "Core/PowerPC/PPCSymbolDB.h"
|
#include "Core/PowerPC/PPCSymbolDB.h"
|
||||||
|
|
||||||
@ -355,7 +356,8 @@ QVariant BranchWatchTableModel::DisplayRoleData(const QModelIndex& index) const
|
|||||||
case Column::TotalHits:
|
case Column::TotalHits:
|
||||||
return QString::number(kv->second.total_hits);
|
return QString::number(kv->second.total_hits);
|
||||||
}
|
}
|
||||||
return QVariant();
|
static_assert(Column::NumberOfColumns == 8);
|
||||||
|
Common::Unreachable();
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant BranchWatchTableModel::FontRoleData(const QModelIndex& index) const
|
QVariant BranchWatchTableModel::FontRoleData(const QModelIndex& index) const
|
||||||
@ -400,7 +402,8 @@ QVariant BranchWatchTableModel::TextAlignmentRoleData(const QModelIndex& index)
|
|||||||
case Column::DestinSymbol:
|
case Column::DestinSymbol:
|
||||||
return QVariant::fromValue(Qt::AlignLeft | Qt::AlignVCenter);
|
return QVariant::fromValue(Qt::AlignLeft | Qt::AlignVCenter);
|
||||||
}
|
}
|
||||||
return QVariant();
|
static_assert(Column::NumberOfColumns == 8);
|
||||||
|
Common::Unreachable();
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant BranchWatchTableModel::ForegroundRoleData(const QModelIndex& index) const
|
QVariant BranchWatchTableModel::ForegroundRoleData(const QModelIndex& index) const
|
||||||
@ -498,5 +501,6 @@ QVariant BranchWatchTableModel::SortRoleData(const QModelIndex& index) const
|
|||||||
case Column::TotalHits:
|
case Column::TotalHits:
|
||||||
return qulonglong{kv->second.total_hits};
|
return qulonglong{kv->second.total_hits};
|
||||||
}
|
}
|
||||||
return QVariant();
|
static_assert(Column::NumberOfColumns == 8);
|
||||||
|
Common::Unreachable();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user