Skip to content

Fix some uses of using namespace#9528

Merged
maliberty merged 15 commits intoThe-OpenROAD-Project:masterfrom
hzeller:feature-20260223-no-use-ns
Feb 25, 2026
Merged

Fix some uses of using namespace#9528
maliberty merged 15 commits intoThe-OpenROAD-Project:masterfrom
hzeller:feature-20260223-no-use-ns

Conversation

@hzeller
Copy link
Collaborator

@hzeller hzeller commented Feb 23, 2026

No description provided.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces the broad using namespace sta; with specific using declarations in RepairDesign.cc and RepairHold.cc. This is a good practice to avoid namespace pollution and potential symbol conflicts. However, some symbols that were previously available via the sta namespace (either directly or through nested using declarations in OpenSTA headers) are now missing, which will lead to compilation errors. Specifically, sta::Slacks and std::sort need to be explicitly imported or qualified where they are used unqualified.

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@hzeller hzeller force-pushed the feature-20260223-no-use-ns branch 2 times, most recently from bb05061 to cd6c3f9 Compare February 23, 2026 17:42
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@hzeller hzeller force-pushed the feature-20260223-no-use-ns branch from cd6c3f9 to 692a6a7 Compare February 23, 2026 17:54
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@povik
Copy link
Contributor

povik commented Feb 23, 2026

What's the motivation? I understood the motivation to get rid of using from headers but I'm not sure why using namespace would be undesirable in these .cc files. My experience is it's an additional burden to keep those using sections updated during rsz development. It uses a lot of sta types.

@povik
Copy link
Contributor

povik commented Feb 23, 2026

I see #9525, let's discuss there

Signed-off-by: Henner Zeller <h.zeller@acm.org>
```
src/rmp/src/Restructure.cpp:             #include "sta/GraphClass.hh" for sta::VertexSet
src/rsz/src/ConcreteSwapArithModules.cc: #include "sta/GraphClass.hh" for sta::VertexSet
src/rsz/src/RecoverPower.hh:             #include "sta/GraphClass.hh" for sta::VertexSet
```

Signed-off-by: Henner Zeller <h.zeller@acm.org>
Signed-off-by: Henner Zeller <h.zeller@acm.org>
@hzeller hzeller force-pushed the feature-20260223-no-use-ns branch from 692a6a7 to 00f5b41 Compare February 25, 2026 15:36
@maliberty
Copy link
Member

This exacerbates the situation @povik is trying to avoid (discussed in #9525). I think we should jump to FQN directly.

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Henner Zeller <h.zeller@acm.org>
@hzeller
Copy link
Collaborator Author

hzeller commented Feb 25, 2026

I am doing this manually, so I first need to break out the using clauses before I can fix the inline implementation. Maybe there is a tool for that, but first steps first.

I can keep working on this until we have the inline situation, but I need to break this into several commits to stay sane :)

Signed-off-by: Henner Zeller <h.zeller@acm.org>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Henner Zeller <h.zeller@acm.org>
Signed-off-by: Henner Zeller <h.zeller@acm.org>
Signed-off-by: Henner Zeller <h.zeller@acm.org>
Signed-off-by: Henner Zeller <h.zeller@acm.org>
Signed-off-by: Henner Zeller <h.zeller@acm.org>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Henner Zeller <h.zeller@acm.org>
Signed-off-by: Henner Zeller <h.zeller@acm.org>
Signed-off-by: Henner Zeller <h.zeller@acm.org>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Henner Zeller <h.zeller@acm.org>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@hzeller
Copy link
Collaborator Author

hzeller commented Feb 25, 2026

Alright, done.
Replacing the names with the FQN is something I would've avoided in the first step so that it is easy to do step by step. But, anyway, it's done now.

@maliberty @povik

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Comment on lines +54 to +69
using sta::Delay;
using sta::Edge;
using sta::fuzzyEqual;
using sta::fuzzyGreater;
using sta::fuzzyGreaterEqual;
using sta::fuzzyLess;
using sta::InstancePinIterator;
using sta::Path;
using sta::PathExpanded;
using sta::Scene;
using sta::Slack;
using sta::TimingArc;
using sta::Vertex;
using sta::VertexInEdgeIterator;
using sta::VertexOutEdgeIterator;
using sta::VertexSet;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you do these too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@maliberty
Copy link
Member

Thanks for doing this manual work. I hope it will be acceptable to all.

Signed-off-by: Henner Zeller <h.zeller@acm.org>
@maliberty maliberty enabled auto-merge February 25, 2026 18:46
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@hzeller
Copy link
Collaborator Author

hzeller commented Feb 25, 2026

The CI error seems to be some docker glitch

@maliberty maliberty disabled auto-merge February 25, 2026 19:44
@maliberty maliberty merged commit 9e689fc into The-OpenROAD-Project:master Feb 25, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants