mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-02 22:23:10 +00:00
[OCaml] De-duplicate llvm_raise and llvm_string_of_message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220898 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -25,14 +25,16 @@
|
||||
#include "caml/fail.h"
|
||||
#include "caml/callback.h"
|
||||
|
||||
static void llvm_raise(value Prototype, char *Message) {
|
||||
CAMLparam1(Prototype);
|
||||
CAMLlocal1(CamlMessage);
|
||||
|
||||
CamlMessage = copy_string(Message);
|
||||
value llvm_string_of_message(char* Message) {
|
||||
value String = caml_copy_string(Message);
|
||||
LLVMDisposeMessage(Message);
|
||||
|
||||
raise_with_arg(Prototype, CamlMessage);
|
||||
return String;
|
||||
}
|
||||
|
||||
void llvm_raise(value Prototype, char *Message) {
|
||||
CAMLparam1(Prototype);
|
||||
raise_with_arg(Prototype, llvm_string_of_message(Message));
|
||||
CAMLnoreturn;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user