From 3425959e21ac959b414390bccb36fb928e5953e0 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 14 Dec 2023 09:35:42 +0100 Subject: [PATCH] CompilerExplorer: Add assembly => source links When hovering over the assembly, the matching source lines are highlighted. Links inside the assembly are now clickable. Change-Id: I22479a2e1badcfd95e0f341b2556fc93c8469625 Reviewed-by: David Schulz --- src/plugins/compilerexplorer/api/compile.h | 66 +++-- .../compilerexplorereditor.cpp | 244 +++++++++++++++--- .../compilerexplorer/compilerexplorereditor.h | 38 ++- 3 files changed, 296 insertions(+), 52 deletions(-) diff --git a/src/plugins/compilerexplorer/api/compile.h b/src/plugins/compilerexplorer/api/compile.h index 618af39a246..0f0493739d2 100644 --- a/src/plugins/compilerexplorer/api/compile.h +++ b/src/plugins/compilerexplorer/api/compile.h @@ -226,7 +226,7 @@ struct CompilerResult struct CompileResult : CompilerResult { - struct Asm + struct AssemblyLine { // A part of the asm that is a (hyper)link to a label (the name references labelDefinitions) struct Label @@ -246,34 +246,68 @@ struct CompileResult : CompilerResult label.range.endCol = object["range"]["endCol"].toInt(); return label; } + + bool operator==(const Label &other) const + { + return name == other.name && range.startCol == other.range.startCol + && range.endCol == other.range.endCol; + } + bool operator!=(const Label &other) const { return !(*this == other); } }; QList