Skip to content

Move CppInterOp.h into its own location; issue a warning to help users. #591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 27, 2025

Conversation

vgvassilev
Copy link
Contributor

Currently we have the CppInterOp.h in clang/Interpreter/ which makes people think that it is a clang header file. This patch moves the header into its own folder to avoid confusion.

This patch also adds a warning for people to update their header files. That's technically not a breaking change and can land any time. The next patch will rename libclangCppInterOp into libCppInterOp which would be technically a breaking change and will be done in v2.0.

This would be a good opportunity to fix stylistic changes without bloating the history such as the header preamble, indentation and such.

@vgvassilev vgvassilev force-pushed the move-to-new-location branch 4 times, most recently from a262a61 to ef0abf9 Compare May 25, 2025 14:10
Currently we have the `CppInterOp.h` in `clang/Interpreter/` which makes people
think that it is a clang header file. This patch moves the header into its own
folder to avoid confusion.
Copy link

codecov bot commented May 25, 2025

Codecov Report

Attention: Patch coverage is 70.80214% with 273 lines in your changes missing coverage. Please review.

Project coverage is 77.31%. Comparing base (2d2a2cb) to head (dffab27).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
lib/CppInterOp/DynamicLibraryManagerSymbol.cpp 68.01% 198 Missing ⚠️
lib/CppInterOp/DynamicLibraryManager.cpp 73.09% 53 Missing ⚠️
lib/CppInterOp/Paths.cpp 75.82% 22 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #591      +/-   ##
==========================================
+ Coverage   76.43%   77.31%   +0.88%     
==========================================
  Files           9        9              
  Lines        3666     3685      +19     
==========================================
+ Hits         2802     2849      +47     
+ Misses        864      836      -28     
Files with missing lines Coverage Δ
include/CppInterOp/CppInterOp.h 100.00% <100.00%> (ø)
lib/CppInterOp/CXCppInterOp.cpp 48.86% <100.00%> (ø)
lib/CppInterOp/Compatibility.h 91.96% <ø> (ø)
lib/CppInterOp/CppInterOp.cpp 84.66% <ø> (ø)
lib/CppInterOp/CppInterOpInterpreter.h 86.97% <ø> (ø)
lib/CppInterOp/DynamicLibraryManager.h 90.00% <ø> (ø)
lib/CppInterOp/Paths.cpp 65.97% <75.82%> (ø)
lib/CppInterOp/DynamicLibraryManager.cpp 73.09% <73.09%> (ø)
lib/CppInterOp/DynamicLibraryManagerSymbol.cpp 68.01% <68.01%> (ø)
Files with missing lines Coverage Δ
include/CppInterOp/CppInterOp.h 100.00% <100.00%> (ø)
lib/CppInterOp/CXCppInterOp.cpp 48.86% <100.00%> (ø)
lib/CppInterOp/Compatibility.h 91.96% <ø> (ø)
lib/CppInterOp/CppInterOp.cpp 84.66% <ø> (ø)
lib/CppInterOp/CppInterOpInterpreter.h 86.97% <ø> (ø)
lib/CppInterOp/DynamicLibraryManager.h 90.00% <ø> (ø)
lib/CppInterOp/Paths.cpp 65.97% <75.82%> (ø)
lib/CppInterOp/DynamicLibraryManager.cpp 73.09% <73.09%> (ø)
lib/CppInterOp/DynamicLibraryManagerSymbol.cpp 68.01% <68.01%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

There were too many comments to post at once. Showing the first 10 out of 27. Check the log or trigger a new build to see more.

void ReportInvokeEnd() const;

public:
Kind getKind() const { return m_Kind; }
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 'getKind' should be marked [[nodiscard]] [modernize-use-nodiscard]

Suggested change
Kind getKind() const { return m_Kind; }
[[nodiscard]] Kind getKind() const { return m_Kind; }

@anutosh491
Copy link
Collaborator

Thanks a lot for this PR.

@vgvassilev vgvassilev changed the title Move CppInterOp.h into its own location; issue a warning to help users. [WIP] Move CppInterOp.h into its own location; issue a warning to help users. May 26, 2025
@vgvassilev vgvassilev force-pushed the move-to-new-location branch from ef0abf9 to 8eb2abd Compare May 27, 2025 06:28
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

There were too many comments to post at once. Showing the first 10 out of 18. Check the log or trigger a new build to see more.


public:
Kind getKind() const { return m_Kind; }
bool isValid() const { return getKind() != kUnknown; }
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 'isValid' should be marked [[nodiscard]] [modernize-use-nodiscard]

Suggested change
bool isValid() const { return getKind() != kUnknown; }
[[nodiscard]] bool isValid() const { return getKind() != kUnknown; }

public:
Kind getKind() const { return m_Kind; }
bool isValid() const { return getKind() != kUnknown; }
bool isInvalid() const { return !isValid(); }
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 'isInvalid' should be marked [[nodiscard]] [modernize-use-nodiscard]

Suggested change
bool isInvalid() const { return !isValid(); }
[[nodiscard]] bool isInvalid() const { return !isValid(); }

@vgvassilev vgvassilev force-pushed the move-to-new-location branch from 8eb2abd to 6cee917 Compare May 27, 2025 06:59
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

This would help us resolve headers such as gtest.h and reduce the clang-tidy
compilation errors.
@vgvassilev vgvassilev force-pushed the move-to-new-location branch from 6cee917 to 54e04e6 Compare May 27, 2025 07:27
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

#include <memory>
#include <string>
#include <vector>
#include "clang-c/CXCppInterOp.h"
#include "clang-c/CXString.h"

using namespace clang;
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: expected namespace name [clang-diagnostic-error]

using namespace clang;
                ^

@vgvassilev vgvassilev force-pushed the move-to-new-location branch from 54e04e6 to 6be71ed Compare May 27, 2025 08:00
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

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

@vgvassilev vgvassilev force-pushed the move-to-new-location branch from 406b7d5 to 3cec1bf Compare May 27, 2025 10:12
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

@vgvassilev vgvassilev force-pushed the move-to-new-location branch from 3cec1bf to 3ef8b36 Compare May 27, 2025 11:09
@vgvassilev vgvassilev force-pushed the move-to-new-location branch from 3ef8b36 to dffab27 Compare May 27, 2025 11:50
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

@vgvassilev
Copy link
Contributor Author

I cannot explain the windows failures. It might be that it has to do with some leftovers from the rename locally after the PR gets rebased on the bots... I'd prefer to merge this and debug later if necessary.

@vgvassilev vgvassilev merged commit 102762c into compiler-research:main May 27, 2025
75 of 78 checks passed
@vgvassilev vgvassilev deleted the move-to-new-location branch May 27, 2025 13:38
@vgvassilev vgvassilev changed the title [WIP] Move CppInterOp.h into its own location; issue a warning to help users. Move CppInterOp.h into its own location; issue a warning to help users. May 27, 2025
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