Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions lib/CppInterOp/CppInterOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#include "CppInterOp/CppInterOp.h"

#include "CppInterOpRuntime.h"

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 CppInterOpRuntime.h is not used directly [misc-include-cleaner]

Suggested change

#include "Compatibility.h"

#include "clang/AST/Attrs.inc"
Expand Down Expand Up @@ -3268,14 +3270,7 @@ TInterp_t CreateInterpreter(const std::vector<const char*>& Args /*={}*/,
}

I->declare(R"(
namespace __internal_CppInterOp {
template <typename Signature>
struct function;
template <typename Res, typename... ArgTypes>
struct function<Res(ArgTypes...)> {
typedef Res result_type;
};
} // namespace __internal_CppInterOp
#include "CppInterOpRuntime.h"
)");

sInterpreters->emplace_back(I, /*Owned=*/true);
Expand Down
19 changes: 19 additions & 0 deletions lib/CppInterOp/CppInterOpRuntime.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#ifndef CPPINTEROP_RUNTIME_H
#define CPPINTEROP_RUNTIME_H
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: header guard does not follow preferred style [llvm-header-guard]

Suggested change
#define CPPINTEROP_RUNTIME_H
#ifndef GITHUB_WORKSPACE_LIB_CPPINTEROP_CPPINTEROPRUNTIME_H
#define GITHUB_WORKSPACE_LIB_CPPINTEROP_CPPINTEROPRUNTIME_H

lib/CppInterOp/CppInterOpRuntime.h:18:

- #endif // CPPINTEROP_RUNTIME_H
+ #endif // GITHUB_WORKSPACE_LIB_CPPINTEROP_CPPINTEROPRUNTIME_H


// This header contains runtime utilities previously injected into the
// interpreter using I->declare(). It is now provided as a real header so that
// the interpreter can load it on startup.

namespace __internal_CppInterOp {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: declaration uses identifier '__internal_CppInterOp', which is a reserved identifier [bugprone-reserved-identifier]

Suggested change
namespace __internal_CppInterOp {
namespace internal_CppInterOp {


template <typename Signature>
struct function;
template <typename Res, typename... ArgTypes>
struct function<Res(ArgTypes...)> {
using result_type = Res;
};

} // namespace __internal_CppInterOp

#endif // CPPINTEROP_RUNTIME_H
Loading