summaryrefslogtreecommitdiff
path: root/runtime/entrypoints/quick/quick_entrypoints.h
diff options
context:
space:
mode:
author Peter Collingbourne <pcc@google.com> 2022-02-04 16:10:05 -0800
committer Treehugger Robot <treehugger-gerrit@google.com> 2022-02-14 09:23:14 +0000
commit4ef67d45b62c974faab601ed2dda4677c06f50c6 (patch)
tree9db749a9c643bdfedb78b4697e9e2ecbaaded7f0 /runtime/entrypoints/quick/quick_entrypoints.h
parent22b5fe062332f6b640a1022261b7f058ceaa184a (diff)
Set types of quick entry points to void*.
The quick entry points are not intended to be called from C++, so let's set their types to void* so that any attempt to call them will fail to compile. Introduce accessors to make it easier to set the fields. Change-Id: I7fae304100f55e96924c31a983ef0a705302d58d
Diffstat (limited to 'runtime/entrypoints/quick/quick_entrypoints.h')
-rw-r--r--runtime/entrypoints/quick/quick_entrypoints.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/entrypoints/quick/quick_entrypoints.h b/runtime/entrypoints/quick/quick_entrypoints.h
index 26e540303e..7af1a0b14e 100644
--- a/runtime/entrypoints/quick/quick_entrypoints.h
+++ b/runtime/entrypoints/quick/quick_entrypoints.h
@@ -44,7 +44,9 @@ class Thread;
// Pointers to functions that are called by quick compiler generated code via thread-local storage.
struct QuickEntryPoints {
-#define ENTRYPOINT_ENUM(name, rettype, ...) rettype ( * p ## name )( __VA_ARGS__ );
+#define ENTRYPOINT_ENUM(name, rettype, ...) \
+ void* p##name; \
+ void Set##name(rettype (*fn)(__VA_ARGS__)) { p##name = reinterpret_cast<void*>(fn); }
#include "quick_entrypoints_list.h"
QUICK_ENTRYPOINT_LIST(ENTRYPOINT_ENUM)
#undef QUICK_ENTRYPOINT_LIST