Skip to content

CUT: wrap mio_library_ with unique_ptr#8670

Merged
maliberty merged 1 commit intoThe-OpenROAD-Project:masterfrom
calewis:leak3
Oct 25, 2025
Merged

CUT: wrap mio_library_ with unique_ptr#8670
maliberty merged 1 commit intoThe-OpenROAD-Project:masterfrom
calewis:leak3

Conversation

@calewis
Copy link
Contributor

@calewis calewis commented Oct 16, 2025

mio_library_ was not being deleted AFAICT.

@github-actions
Copy link
Contributor

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

@maliberty maliberty enabled auto-merge October 16, 2025 23:24
auto-merge was automatically disabled October 22, 2025 20:06

Head branch was pushed to by a user without write access

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@@ -6,6 +6,7 @@
#include <string.h>

#include <cmath>
#include <iostream>
#include <optional>
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: included header iostream is not used directly [misc-include-cleaner]

Suggested change
#include <optional>
#include <optional>

abc::Vec_Flt_t* axis_1_abc_vec = abc::Vec_FltAlloc(axis1_values->size());
abc::Vec_Int_t* axis_1_abc_int_vec
= abc::Vec_IntAlloc(axis1_values->size());
abc::Vec_Flt_t *axis_1_abc_vec = abc::Vec_FltAlloc(axis1_values->size());
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "abc::Vec_FltAlloc" is directly included [misc-include-cleaner]

    abc::Vec_Flt_t *axis_1_abc_vec = abc::Vec_FltAlloc(axis1_values->size());
                                          ^

abc::Vec_Flt_t* axis_1_abc_vec = abc::Vec_FltAlloc(axis1_values->size());
abc::Vec_Int_t* axis_1_abc_int_vec
= abc::Vec_IntAlloc(axis1_values->size());
abc::Vec_Flt_t *axis_1_abc_vec = abc::Vec_FltAlloc(axis1_values->size());
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "abc::Vec_Flt_t" is directly included [misc-include-cleaner]

    abc::Vec_Flt_t *axis_1_abc_vec = abc::Vec_FltAlloc(axis1_values->size());
         ^

abc::Vec_Int_t* axis_1_abc_int_vec
= abc::Vec_IntAlloc(axis1_values->size());
abc::Vec_Flt_t *axis_1_abc_vec = abc::Vec_FltAlloc(axis1_values->size());
abc::Vec_Int_t *axis_1_abc_int_vec =
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "abc::Vec_Int_t" is directly included [misc-include-cleaner]

    abc::Vec_Int_t *axis_1_abc_int_vec =
         ^

= abc::Vec_IntAlloc(axis1_values->size());
abc::Vec_Flt_t *axis_1_abc_vec = abc::Vec_FltAlloc(axis1_values->size());
abc::Vec_Int_t *axis_1_abc_int_vec =
abc::Vec_IntAlloc(axis1_values->size());
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "abc::Vec_IntAlloc" is directly included [misc-include-cleaner]

        abc::Vec_IntAlloc(axis1_values->size());
             ^

}

// Set standard cell function
abc::Vec_Wrd_t* vFunc;
abc::Vec_Wrd_t *vFunc;
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "abc::Vec_Wrd_t" is directly included [misc-include-cleaner]

src/cut/src/abc_library_factory.cpp:16:

- #include "rsz/Resizer.hh"
+ #include "misc/vec/vecWrd.h"
+ #include "rsz/Resizer.hh"

abc::Vec_WrdErase(&output_pin->vFunc);
vFunc = abc::Mio_ParseFormulaTruth(
output_pin->func_text,
(char**) (abc::Vec_PtrArray(input_names_abc)),
output_pin->func_text, (char **)(abc::Vec_PtrArray(input_names_abc)),
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "abc::Vec_PtrArray" is directly included [misc-include-cleaner]

        output_pin->func_text, (char **)(abc::Vec_PtrArray(input_names_abc)),
                                              ^

abc::word constant)
{
std::pair<abc::SC_Cell*, abc::SC_Pin*> result = {nullptr, nullptr};
std::pair<abc::SC_Cell *, abc::SC_Pin *> FindConstantCell(abc::SC_Lib *library,
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: function 'FindConstantCell' can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]

Suggested change
std::pair<abc::SC_Cell *, abc::SC_Pin *> FindConstantCell(abc::SC_Lib *library,
static std::pair<abc::SC_Cell *, abc::SC_Pin *> FindConstantCell(abc::SC_Lib *library,

return IsConst1Cell(cell_name) || IsConst0Cell(cell_name);
}

static bool abc_initialized = false;

void abcInit()
{
void abcInit() {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: function 'abcInit' can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]

Suggested change
void abcInit() {
static void abcInit() {

if (!abc_initialized) {
abc::Abc_Start();
abc_initialized = true;
}
}

void abcStop()
{
void abcStop() {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: function 'abcStop' can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]

Suggested change
void abcStop() {
static void abcStop() {

@github-actions
Copy link
Contributor

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

Release if a user requests it. Then make a new one for future requests.

Supress stdout of abc for future constructions.

Signed-off-by: Drew Lewis <cannada@google.com>
@calewis calewis reopened this Oct 22, 2025
@calewis
Copy link
Contributor Author

calewis commented Oct 22, 2025

@maliberty when merging upstream master I had signing issues so I basically squashed and repushed. Sorry that you might want to look at the changes again, but at least it's a short PR, the main thing since you approved was to make new copies of the library and suppress the stdout for abc.

@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! 👍"

@maliberty maliberty enabled auto-merge October 22, 2025 21:22
@maliberty maliberty disabled auto-merge October 25, 2025 18:33
@maliberty maliberty merged commit 866219a into The-OpenROAD-Project:master Oct 25, 2025
21 of 22 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.

2 participants

Comments