Skip to content

Commit 0e09006

Browse files
committed
grt: inline HeatMapHandleAdapter into MakeGlobalRouter.cpp
The clang-tidy CI action lints every changed file including headers, but HeatMapHandleAdapter.h had no compile_commands.json entry (only TUs do), so clang-tidy ran with no -I flags and failed to resolve gui/heatMap.h. The adapter has a single user; move the class into MakeGlobalRouter.cpp and delete the header. Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
1 parent d91141c commit 0e09006

3 files changed

Lines changed: 24 additions & 35 deletions

File tree

src/grt/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ cc_library(
179179
"src/AbstractRoutingCongestionDataSource.h",
180180
"src/GrouteRenderer.cpp",
181181
"src/GrouteRenderer.h",
182-
"src/HeatMapHandleAdapter.h",
183182
"src/MakeGlobalRouter.cpp",
184183
"src/Net.h",
185184
"src/Pin.h",

src/grt/src/HeatMapHandleAdapter.h

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/grt/src/MakeGlobalRouter.cpp

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
#include "grt/MakeGlobalRouter.h"
55

66
#include <memory>
7+
#include <utility>
78

9+
#include "AbstractRoutingCongestionDataSource.h"
810
#include "FastRoute.h"
9-
#include "HeatMapHandleAdapter.h"
1011
#include "grt/GlobalRouter.h"
12+
#include "gui/heatMap.h"
1113
#include "heatMap.h"
1214
#include "heatMapRudy.h"
1315
#include "tcl.h"
@@ -22,6 +24,27 @@ namespace grt {
2224
// Tcl files encoded into strings.
2325
extern const char* grt_tcl_inits[];
2426

27+
// Adapts a gui::HeatMapSourceHandle to the gui-free abstract interface
28+
// consumed by GlobalRouter. Defined in this TU so :grt does not see gui.
29+
class HeatMapHandleAdapter : public AbstractRoutingCongestionDataSource
30+
{
31+
public:
32+
explicit HeatMapHandleAdapter(gui::HeatMapSourceHandle handle)
33+
: handle_(std::move(handle))
34+
{
35+
}
36+
37+
void invalidate() override
38+
{
39+
if (handle_) {
40+
handle_->invalidateInstances();
41+
}
42+
}
43+
44+
private:
45+
gui::HeatMapSourceHandle handle_;
46+
};
47+
2548
void initGui(grt::GlobalRouter* grt, odb::dbDatabase* db, utl::Logger* logger)
2649
{
2750
grt->initGui(std::make_unique<HeatMapHandleAdapter>(

0 commit comments

Comments
 (0)