Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
950bdef
chore: use black instead of autopep for python formatting
milianw Apr 15, 2026
536ec65
fix: deduplicate clang-tidy fixits in headers
milianw Apr 15, 2026
9c6f163
chore: disable some more modern clang-tidy checks
milianw Apr 15, 2026
e586e20
chore: workaround clang-tidy bugprone-branch-clone
milianw Apr 15, 2026
1e8aedf
chore: exclude clang-tidy checks in generated moc files
milianw Apr 15, 2026
03feabd
fix: clang-tidy misc-const-correctness
milianw Apr 15, 2026
292e2fc
chore: port flamegraph to QtConcurrent
milianw Apr 15, 2026
b056e76
fix: clang-tidy misc-non-private-member-variables-in-classes
milianw Apr 15, 2026
4d24cae
chore: disable misc-non-private-member-variables-in-classes for treem…
milianw Apr 15, 2026
a397f3c
fix: clang-tidy readability-redundant-casting
milianw Apr 15, 2026
ae36840
fix: clang-tidy readability-redundant-inline-specifier
milianw Apr 15, 2026
a66c6b3
fix: clang-tidy readability-math-missing-parentheses
milianw Apr 15, 2026
e6f4d9e
chore: disable clang-tidy modernize-macro-to-enum in hotspot-config.h
milianw Apr 15, 2026
5c8a3ad
chore: disable clang-tidy for autogen ui headers
milianw Apr 15, 2026
c7253b9
fix: clang-tidy modernize-use-using
milianw Apr 15, 2026
2941e5a
chore: leverage qHashMulti from Qt6
milianw Apr 15, 2026
360ac2b
fix: clang-tidy modernize-use-override
milianw Apr 15, 2026
244ddd7
fix: clang-tidy readability-inconsistent-ifelse-braces
milianw Apr 15, 2026
0ab2da5
fix: clang-tidy readability-ambiguous-smartptr-reset-call
milianw Apr 15, 2026
481fb69
fix: clang-tidy modernize-pass-by-value
milianw Apr 15, 2026
ac7afc0
fix: clang-tidy modernize-avoid-c-style-cast
milianw Apr 15, 2026
4ce775d
fix: clang-tidy modernize-use-default-member-init
milianw Apr 15, 2026
9349116
chore: disable clang-tidy modernize-use-default-member-init for TopProxy
milianw Apr 15, 2026
259cfd7
fix: clang-tidy readability-enum-initial-value
milianw Apr 15, 2026
41fb7d0
fix: clang-tidy performance-unnecessary-value-param
milianw Apr 15, 2026
736854e
fix: clang-tidy misc-use-internal-linkage
milianw Apr 15, 2026
da2e15e
chore: remove unneeded include
milianw Apr 15, 2026
972cf0d
chore: remove unneeded cast
milianw Apr 15, 2026
58e9fbb
chore: workaround clang-tidy misc-multiple-inheritance false-positive
milianw Apr 15, 2026
1e4d423
fix: clang-tidy misc-override-with-different-visibility
milianw Apr 15, 2026
d4cbd94
fix: silence error when no fixits have auto replacements
milianw Apr 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Checks:
-bugprone-assignment-in-if-condition,
-bugprone-narrowing-conversions,
-bugprone-switch-missing-default-case,
-bugprone-crtp-constructor-accessibility,
concurrency-*,
misc-*,
-misc-no-recursion,
Expand All @@ -20,6 +21,8 @@ Checks:
performance-*,
-performance-enum-size,
portability-*,
-portability-avoid-pragma-once,
-portability-template-virtual-member-function,
readability-*,
-readability-braces-around-statements,
-readability-uppercase-literal-suffix,
Expand Down
59 changes: 34 additions & 25 deletions .cmake-format.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
with section("parse"):

# Specify structure for custom cmake functions
additional_commands = {'foo': {'flags': ['BAR', 'BAZ'],
'kwargs': {'DEPENDS': '*', 'HEADERS': '*', 'SOURCES': '*'}}}
additional_commands = {
"foo": {
"flags": ["BAR", "BAZ"],
"kwargs": {"DEPENDS": "*", "HEADERS": "*", "SOURCES": "*"},
}
}

# Override configurations per-command where available
override_spec = {}
Expand Down Expand Up @@ -41,7 +45,7 @@
# 'use-space', fractional indentation is left as spaces (utf-8 0x20). If set
# to `round-up` fractional indentation is replaced with a single tab character
# (utf-8 0x09) effectively shifting the column to the next tabstop
fractional_tab_policy = 'use-space'
fractional_tab_policy = "use-space"

# If an argument group contains more than this many sub-groups (parg or kwarg
# groups) then force it to a vertical layout.
Expand Down Expand Up @@ -69,7 +73,7 @@
# to this reference: `prefix`: the start of the statement, `prefix-indent`:
# the start of the statement, plus one indentation level, `child`: align to
# the column of the arguments
dangle_align = 'prefix'
dangle_align = "prefix"

# If the statement spelling length (including space and parenthesis) is
# smaller than this amount, then force reject nested layouts.
Expand All @@ -85,17 +89,22 @@
max_lines_hwrap = 2

# What style line endings to use in the output.
line_ending = 'unix'
line_ending = "unix"

# Format command names consistently as 'lower' or 'upper' case
command_case = 'lower'
command_case = "lower"

# Format keywords consistently as 'lower' or 'upper' case
keyword_case = 'upper'
keyword_case = "upper"

# A list of command names which should always be wrapped
always_wrap = ["add_executable", "add_library",
"target_link_libraries", "target_include_directories", "install"]
always_wrap = [
"add_executable",
"add_library",
"target_link_libraries",
"target_include_directories",
"install",
]

# If true, the argument lists which are known to be sortable will be sorted
# lexicographicall
Expand All @@ -121,10 +130,10 @@
with section("markup"):

# What character to use for bulleted lists
bullet_char = '*'
bullet_char = "*"

# What character to use as punctuation after numerals in an enumerated list
enum_char = '.'
enum_char = "."

# If comment markup is enabled, don't reflow the first comment block in each
# listfile. Use this to preserve formatting of your copyright/license
Expand All @@ -137,15 +146,15 @@

# Regular expression to match preformat fences in comments default=
# ``r'^\s*([`~]{3}[`~]*)(.*)$'``
fence_pattern = '^\\s*([`~]{3}[`~]*)(.*)$'
fence_pattern = "^\\s*([`~]{3}[`~]*)(.*)$"

# Regular expression to match rulers in comments default=
# ``r'^\s*[^\w\s]{3}.*[^\w\s]{3}$'``
ruler_pattern = '^\\s*[^\\w\\s]{3}.*[^\\w\\s]{3}$'
ruler_pattern = "^\\s*[^\\w\\s]{3}.*[^\\w\\s]{3}$"

# If a comment line matches starts with this pattern then it is explicitly a
# trailing comment for the preceeding argument. Default is '#<'
explicit_trailing_pattern = '#<'
explicit_trailing_pattern = "#<"

# If a comment line starts with at least this many consecutive hash
# characters, then don't lstrip() them off. This allows for lazy hash rulers
Expand All @@ -168,38 +177,38 @@
disabled_codes = []

# regular expression pattern describing valid function names
function_pattern = '[0-9a-z_]+'
function_pattern = "[0-9a-z_]+"

# regular expression pattern describing valid macro names
macro_pattern = '[0-9a-z_]+'
macro_pattern = "[0-9a-z_]+"

# regular expression pattern describing valid names for variables with global
# (cache) scope
global_var_pattern = '[A-Z][0-9A-Z_]+'
global_var_pattern = "[A-Z][0-9A-Z_]+"

# regular expression pattern describing valid names for variables with global
# scope (but internal semantic)
internal_var_pattern = '[A-Z][0-9A-Z_]+'
internal_var_pattern = "[A-Z][0-9A-Z_]+"

# regular expression pattern describing valid names for variables with local
# scope
local_var_pattern = '[A-Za-z][A-Za-z0-9_]+'
local_var_pattern = "[A-Za-z][A-Za-z0-9_]+"

# regular expression pattern describing valid names for privatedirectory
# variables
private_var_pattern = '[0-9a-z_]+'
private_var_pattern = "[0-9a-z_]+"

# regular expression pattern describing valid names for public directory
# variables
public_var_pattern = '.*'
public_var_pattern = ".*"

# regular expression pattern describing valid names for function/macro
# arguments and loop variables.
argument_var_pattern = '[a-z_][a-z0-9_]+'
argument_var_pattern = "[a-z_][a-z0-9_]+"

# regular expression pattern describing valid names for keywords used in
# functions or macros
keyword_pattern = '[A-Z][0-9A-Z_]+'
keyword_pattern = "[A-Z][0-9A-Z_]+"

# In the heuristic for C0201, how many conditionals to match within a loop in
# before considering the loop a parser.
Expand All @@ -225,11 +234,11 @@
emit_byteorder_mark = False

# Specify the encoding of the input file. Defaults to utf-8
input_encoding = 'utf-8'
input_encoding = "utf-8"

# Specify the encoding of the output file. Defaults to utf-8. Note that cmake
# only claims to support utf-8 so be careful when using anything else
output_encoding = 'utf-8'
output_encoding = "utf-8"

# -------------------------------------
# Miscellaneous configurations options.
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ repos:
- id: pylint
args: ["--disable=C0103,C0301,C0114,R0801,E0401"]
exclude: (\.cmake-format\.py)
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v1.7.0
- repo: https://github.com/psf/black
rev: 26.3.1
hooks:
- id: autopep8
- id: black
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
Expand Down
4 changes: 4 additions & 0 deletions hotspot-config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

// NOLINTBEGIN(modernize-macro-to-enum)

#define HOTSPOT_VERSION_STRING "@HOTSPOT_VERSION_STRING@"
#define HOTSPOT_VERSION_MAJOR @hotspot_VERSION_MAJOR@
#define HOTSPOT_VERSION_MINOR @hotspot_VERSION_MINOR@
Expand All @@ -26,3 +28,5 @@
#cmakedefine01 QCustomPlot_FOUND

#cmakedefine01 KGraphViewerPart_FOUND

// NOLINTEND(modernize-macro-to-enum)
3 changes: 2 additions & 1 deletion scripts/run_clang_tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ rm -Rf scripts/fixits
mkdir -p scripts/fixits

run-clang-tidy -quiet -extra-arg="-Wno-gnu-zero-variadic-macro-arguments" \
-exclude-header-filter "autogen.+(\.moc$|ui_.+\.h$)" \
-j $(nproc) -config-file .clang-tidy -export-fixes scripts/fixits/fixits.yaml \
-use-color -p "$build_dir" "$PWD/src"

Expand All @@ -24,5 +25,5 @@ if [ -s "scripts/fixits/fixits.yaml" ]; then

echo "fixits with auto replacements:"

grep -l Replacements:$ scripts/fixits/*/fixits.yaml | xargs dirname
grep -l Replacements:$ scripts/fixits/*/fixits.yaml | xargs dirname 2> /dev/null
fi
48 changes: 35 additions & 13 deletions scripts/split-clang-tidy-fixits.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,54 @@
import yaml


def normalizePaths(message):
"""to enable deduplication, normalize paths"""
message["FilePath"] = os.path.normpath(message["FilePath"])


def fileOffsetToLine(message):
''' to ease manual inspection, translate FileOffset to a FileLine '''
if message['FilePath'] == "":
"""to ease manual inspection, translate FileOffset to a FileLine"""
if message["FilePath"] == "":
return
with open(message['FilePath'], 'r', encoding='utf-8') as sourceFile:
numNewlines = sourceFile.read(message['FileOffset']).count('\n')
message['FileLine'] = numNewlines + 1
with open(message["FilePath"], "r", encoding="utf-8") as sourceFile:
numNewlines = sourceFile.read(message["FileOffset"]).count("\n")
message["FileLine"] = numNewlines + 1


inputFile = sys.argv[1]
groupedFixits = {}
seenFixits = {}


with open(inputFile, 'r', encoding='utf-8') as mainFixitsFile:
with open(inputFile, "r", encoding="utf-8") as mainFixitsFile:
mainFixits = yaml.safe_load(mainFixitsFile)

if not mainFixits:
print("no diagnostics found")
sys.exit(0)

for fixit in mainFixits['Diagnostics']:
fileOffsetToLine(fixit['DiagnosticMessage'])
for note in fixit.get('Notes', []):
for fixit in mainFixits["Diagnostics"]:
diagnostic = fixit["DiagnosticName"]

# normalize and add file offsets
normalizePaths(fixit["DiagnosticMessage"])
fileOffsetToLine(fixit["DiagnosticMessage"])
for note in fixit.get("Notes", []):
normalizePaths(note)
fileOffsetToLine(note)
for replacement in fixit["DiagnosticMessage"].get("Replacements", []):
normalizePaths(replacement)

stringified = yaml.dump(fixit, sort_keys=True)
seenGroup = seenFixits.get(diagnostic)
if not seenGroup:
seenFixits[diagnostic] = set(stringified)
elif stringified in seenGroup:
# duplicate entry, e.g. from header
continue
else:
seenGroup.add(stringified)

diagnostic = fixit['DiagnosticName']
group = groupedFixits.get(diagnostic)
if not group:
groupedFixits[diagnostic] = [fixit]
Expand All @@ -46,12 +68,12 @@ def fileOffsetToLine(message):
diagnosticDir = f"{baseDir}/{diagnostic}"
if not os.path.isdir(diagnosticDir):
os.mkdir(diagnosticDir)
with open(f"{diagnosticDir}/fixits.yaml", 'w', encoding='utf-8') as fixitsFile:
text = yaml.dump({'Diagnostics': fixits, 'MainSourceFile': ''})
with open(f"{diagnosticDir}/fixits.yaml", "w", encoding="utf-8") as fixitsFile:
text = yaml.dump({"Diagnostics": fixits, "MainSourceFile": ""})

# sadly clang-apply-replacements doesn't like our additional FileLine
# and we cannot add comments directly with pyaml
# so instead we do this manually here
text = text.replace('FileLine:', '# FileLine:')
text = text.replace("FileLine:", "# FileLine:")

fixitsFile.write(text)
2 changes: 1 addition & 1 deletion src/aboutdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AboutDialog : public QDialog
Q_OBJECT
public:
explicit AboutDialog(QWidget* parent = nullptr);
~AboutDialog();
~AboutDialog() override;

void setTitle(const QString& title);
void setText(const QString& text);
Expand Down
5 changes: 3 additions & 2 deletions src/callgraphwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,21 @@ class CallgraphWidget : public QWidget
{
Q_OBJECT
public:
~CallgraphWidget();
~CallgraphWidget() override;

static CallgraphWidget* createCallgraphWidget(const Data::CallerCalleeResults& results, QWidget* parent = nullptr);

void selectSymbol(const Data::Symbol& symbol);

bool eventFilter(QObject* watched, QEvent* event) override;

signals:
void clickedOn(const Data::Symbol& symbol);

public slots:
void setResults(const Data::CallerCalleeResults& results);

protected:
bool eventFilter(QObject* watched, QEvent* event) override;
void changeEvent(QEvent* event) override;
void showEvent(QShowEvent* event) override;

Expand Down
2 changes: 1 addition & 1 deletion src/costcontextmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CostContextMenu : public QObject
Q_OBJECT
public:
explicit CostContextMenu(QObject* parent = nullptr);
~CostContextMenu();
~CostContextMenu() override;

void addToMenu(QHeaderView* view, QMenu* menu);
void hideColumns(QTreeView* view);
Expand Down
5 changes: 3 additions & 2 deletions src/costheaderview.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@ class CostHeaderView : public QHeaderView
Q_OBJECT
public:
explicit CostHeaderView(CostContextMenu* contextMenu, QWidget* parent = nullptr);
~CostHeaderView();
~CostHeaderView() override;

void setAutoResize(bool autoResize)
{
m_autoResize = autoResize;
}

private:
protected:
void resizeEvent(QResizeEvent* event) override;
void resizeColumns(bool reset);

private:
bool m_isResizing = false;
bool m_autoResize = true;
};
1 change: 0 additions & 1 deletion src/dockwidgetsetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class DockingArea : public DockMainWindow
public:
using DockMainWindow::MainWindow;

protected:
QMargins centerWidgetMargins() const override
{
return {};
Expand Down
Loading
Loading