{
std::size_t vertex_count = vertexes.size();
std::int64_t max_index = vertex_count;
- std::int64_t min_index = -vertex_count;
+ std::int64_t min_index = -max_index;
auto vertex_index =
parse_signed_integer(vertex_index_str, max_index, min_index);
if(!vertex_index || *vertex_index == 0)
id_states.resize(id_bound - 1);
}
}
+
+namespace
+{
+#define DECLARE_LIBRARY_SYMBOL(name) \
+ static void library_symbol_##name() __attribute__((weakref(#name)));
+#ifdef __ARM_EABI__
+DECLARE_LIBRARY_SYMBOL(__aeabi_unwind_cpp_pr0)
+#endif
+}
+
+Jit_symbol_resolver::Resolved_symbol Jit_symbol_resolver::resolve(util::string_view name)
+{
+#define RESOLVE_LIBRARY_SYMBOL(symbol_name) \
+ if(#symbol_name == name) \
+ { \
+ if(library_symbol_##symbol_name == nullptr) \
+ throw std::runtime_error( \
+ "JIT symbol resolve error: library symbol not linked: " #symbol_name); \
+ return library_symbol_##symbol_name; \
+ }
+
+#ifdef __ARM_EABI__
+ RESOLVE_LIBRARY_SYMBOL(__aeabi_unwind_cpp_pr0)
+#endif
+#warning finish implementing
+ return nullptr;
+}
}
spirv_to_llvm::Converted_module spirv_to_llvm::spirv_to_llvm(
struct Jit_symbol_resolver
{
typedef void (*Resolved_symbol)();
- Resolved_symbol resolve(util::string_view name)
- {
-#warning finish implementing
- return nullptr;
- }
+ Resolved_symbol resolve(util::string_view name);
static std::uint64_t resolve(const char *name, void *user_data) noexcept
{
return reinterpret_cast<std::uint64_t>(