Skip to content

Conversation

@alexander-penev
Copy link
Collaborator

No description provided.

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

/// passed as a parameter, and if the parent is not passed,
/// then global scope will be assumed.
TCppScope_t GetScope(const std::string &name, TCppScope_t parent = 0);
DllExport TCppScope_t GetScope(const std::string &name, TCppScope_t parent = 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: use nullptr [modernize-use-nullptr]

Suggested change
DllExport TCppScope_t GetScope(const std::string &name, TCppScope_t parent = 0);
DllExport TCppScope_t GetScope(const std::string &name, TCppScope_t parent = nullptr);

@codecov
Copy link

codecov bot commented Mar 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.74%. Comparing base (468031a) to head (310d7c3).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #213   +/-   ##
=======================================
  Coverage   78.74%   78.74%           
=======================================
  Files           8        8           
  Lines        3091     3091           
=======================================
  Hits         2434     2434           
  Misses        657      657           
Files Coverage Δ
include/clang/Interpreter/CppInterOp.h 100.00% <ø> (ø)
lib/Interpreter/CppInterOp.cpp 86.36% <100.00%> (ø)
Files Coverage Δ
include/clang/Interpreter/CppInterOp.h 100.00% <ø> (ø)
lib/Interpreter/CppInterOp.cpp 86.36% <100.00%> (ø)

Comment on lines 19 to 23
#ifdef _WIN32
#define DllExport __declspec(dllexport)
#else
#define DllExport __attribute__((visibility("default")))
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#ifdef _WIN32
#define DllExport __declspec(dllexport)
#else
#define DllExport __attribute__((visibility("default")))
#endif
#ifdef _WIN32
#define CPPINTEROP_API __declspec(dllexport)
#else
#define CPPINTEROP_API __attribute__((visibility("default")))
#endif

It's probably better name.

/// can be used to iterate through the index value to get each specific
/// base class.
TCppScope_t GetBaseClass(TCppType_t klass, TCppIndex_t ibase);
DllExport DllExport TCppScope_t GetBaseClass(TCppType_t klass, TCppIndex_t ibase);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
DllExport DllExport TCppScope_t GetBaseClass(TCppType_t klass, TCppIndex_t ibase);
DllExport TCppScope_t GetBaseClass(TCppType_t klass, TCppIndex_t ibase);


/// Ends recording the standard stream and returns the result as a string.
std::string EndStdStreamCapture();
DllExport std::string EndStdStreamCapture();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
DllExport std::string EndStdStreamCapture();
DllExport std::string EndStdStreamCapture();
#undef CPPINTEROP_API

// End of JitCall Helper Functions

JitCall MakeFunctionCallable(TCppConstFunction_t func) {
DllExport JitCall MakeFunctionCallable(TCppConstFunction_t func) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We do not need to export things outside of the public API that's defined in the header file.

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

/// passed as a parameter, and if the parent is not passed,
/// then global scope will be assumed.
TCppScope_t GetScope(const std::string &name, TCppScope_t parent = 0);
CPPINTEROP_API TCppScope_t GetScope(const std::string &name, TCppScope_t parent = 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: use nullptr [modernize-use-nullptr]

Suggested change
CPPINTEROP_API TCppScope_t GetScope(const std::string &name, TCppScope_t parent = 0);
CPPINTEROP_API TCppScope_t GetScope(const std::string &name, TCppScope_t parent = nullptr);

// End of JitCall Helper Functions

JitCall MakeFunctionCallable(TCppConstFunction_t func) {
DllExport JitCall MakeFunctionCallable(TCppConstFunction_t func) {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: variable 'JitCall' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]

  DllExport JitCall MakeFunctionCallable(TCppConstFunction_t func) {
            ^

@vgvassilev vgvassilev force-pushed the FixWindowsExportSymbols branch from 9ddad94 to 310d7c3 Compare March 20, 2024 16:32
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

/// then global scope will be assumed.
TCppScope_t GetScope(const std::string &name, TCppScope_t parent = 0);
CPPINTEROP_API TCppScope_t GetScope(const std::string& name,
TCppScope_t parent = 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: use nullptr [modernize-use-nullptr]

Suggested change
TCppScope_t parent = 0);
TCppScope_t parent = nullptr);

bool ExistsFunctionTemplate(const std::string& name,
TCppScope_t parent = 0);
CPPINTEROP_API bool ExistsFunctionTemplate(const std::string& name,
TCppScope_t parent = 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: use nullptr [modernize-use-nullptr]

Suggested change
TCppScope_t parent = 0);
TCppScope_t parent = nullptr);

Copy link
Contributor

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

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

LGTM!

@vgvassilev vgvassilev merged commit 88fd586 into compiler-research:main Mar 21, 2024
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