Skip to content

Commit ce32b73

Browse files
authored
Orc rt session wrap unwrap (llvm#167635)
1 parent 5465979 commit ce32b73

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

orc-rt/include/orc-rt/Session.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include "orc-rt/ResourceManager.h"
1818
#include "orc-rt/move_only_function.h"
1919

20+
#include "orc-rt-c/CoreTypes.h"
21+
2022
#include <vector>
2123

2224
namespace orc_rt {
@@ -69,6 +71,14 @@ class Session {
6971
std::vector<std::unique_ptr<ResourceManager>> ResourceMgrs;
7072
};
7173

74+
inline orc_rt_SessionRef wrap(Session *S) noexcept {
75+
return reinterpret_cast<orc_rt_SessionRef>(S);
76+
}
77+
78+
inline Session *unwrap(orc_rt_SessionRef S) noexcept {
79+
return reinterpret_cast<Session *>(S);
80+
}
81+
7282
} // namespace orc_rt
7383

7484
#endif // ORC_RT_SESSION_H

0 commit comments

Comments
 (0)