diff options
Diffstat (limited to 'src/binaryen-c.h')
-rw-r--r-- | src/binaryen-c.h | 46 |
1 files changed, 12 insertions, 34 deletions
diff --git a/src/binaryen-c.h b/src/binaryen-c.h index 95892443d..9a2750353 100644 --- a/src/binaryen-c.h +++ b/src/binaryen-c.h @@ -96,7 +96,6 @@ BinaryenExpressionId BinaryenLoopId(void); BinaryenExpressionId BinaryenBreakId(void); BinaryenExpressionId BinaryenSwitchId(void); BinaryenExpressionId BinaryenCallId(void); -BinaryenExpressionId BinaryenCallImportId(void); BinaryenExpressionId BinaryenCallIndirectId(void); BinaryenExpressionId BinaryenGetLocalId(void); BinaryenExpressionId BinaryenSetLocalId(void); @@ -339,15 +338,11 @@ BinaryenExpressionRef BinaryenLoop(BinaryenModuleRef module, const char* in, Bin BinaryenExpressionRef BinaryenBreak(BinaryenModuleRef module, const char* name, BinaryenExpressionRef condition, BinaryenExpressionRef value); // Switch: value can be NULL BinaryenExpressionRef BinaryenSwitch(BinaryenModuleRef module, const char** names, BinaryenIndex numNames, const char* defaultName, BinaryenExpressionRef condition, BinaryenExpressionRef value); -// Call, CallImport: Note the 'returnType' parameter. You must declare the -// type returned by the function being called, as that -// function might not have been created yet, so we don't -// know what it is. -// Also note that WebAssembly does not differentiate -// between Call and CallImport, but Binaryen does, so you -// must use CallImport if calling an import, and vice versa. +// Call: Note the 'returnType' parameter. You must declare the +// type returned by the function being called, as that +// function might not have been created yet, so we don't +// know what it is. BinaryenExpressionRef BinaryenCall(BinaryenModuleRef module, const char* target, BinaryenExpressionRef* operands, BinaryenIndex numOperands, BinaryenType returnType); -BinaryenExpressionRef BinaryenCallImport(BinaryenModuleRef module, const char* target, BinaryenExpressionRef* operands, BinaryenIndex numOperands, BinaryenType returnType); BinaryenExpressionRef BinaryenCallIndirect(BinaryenModuleRef module, BinaryenExpressionRef target, BinaryenExpressionRef* operands, BinaryenIndex numOperands, const char* type); // GetLocal: Note the 'type' parameter. It might seem redundant, since the // local at that index must have a type. However, this API lets you @@ -441,13 +436,6 @@ BinaryenIndex BinaryenCallGetNumOperands(BinaryenExpressionRef expr); // Gets the nested operand expression at the specified index within the specified `Call` expression. BinaryenExpressionRef BinaryenCallGetOperand(BinaryenExpressionRef expr, BinaryenIndex index); -// Gets the name of the target of the specified `CallImport` expression. -const char* BinaryenCallImportGetTarget(BinaryenExpressionRef expr); -// Gets the number of nested operand expressions within the specified `CallImport` expression. -BinaryenIndex BinaryenCallImportGetNumOperands(BinaryenExpressionRef expr); -// Gets the nested operand expression at the specified index within the specified `CallImport` expression. -BinaryenExpressionRef BinaryenCallImportGetOperand(BinaryenExpressionRef expr, BinaryenIndex index); - // Gets the nested target expression of the specified `CallIndirect` expression. BinaryenExpressionRef BinaryenCallIndirectGetTarget(BinaryenExpressionRef expr); // Gets the number of nested operand expressions within the specified `CallIndirect` expression. @@ -604,14 +592,10 @@ void BinaryenRemoveFunction(BinaryenModuleRef module, const char* name); // Imports -typedef void* BinaryenImportRef; - -WASM_DEPRECATED BinaryenImportRef BinaryenAddImport(BinaryenModuleRef module, const char* internalName, const char* externalModuleName, const char* externalBaseName, BinaryenFunctionTypeRef type); -BinaryenImportRef BinaryenAddFunctionImport(BinaryenModuleRef module, const char* internalName, const char* externalModuleName, const char* externalBaseName, BinaryenFunctionTypeRef functionType); -BinaryenImportRef BinaryenAddTableImport(BinaryenModuleRef module, const char* internalName, const char* externalModuleName, const char* externalBaseName); -BinaryenImportRef BinaryenAddMemoryImport(BinaryenModuleRef module, const char* internalName, const char* externalModuleName, const char* externalBaseName); -BinaryenImportRef BinaryenAddGlobalImport(BinaryenModuleRef module, const char* internalName, const char* externalModuleName, const char* externalBaseName, BinaryenType globalType); -void BinaryenRemoveImport(BinaryenModuleRef module, const char* internalName); +void BinaryenAddFunctionImport(BinaryenModuleRef module, const char* internalName, const char* externalModuleName, const char* externalBaseName, BinaryenFunctionTypeRef functionType); +void BinaryenAddTableImport(BinaryenModuleRef module, const char* internalName, const char* externalModuleName, const char* externalBaseName); +void BinaryenAddMemoryImport(BinaryenModuleRef module, const char* internalName, const char* externalModuleName, const char* externalBaseName); +void BinaryenAddGlobalImport(BinaryenModuleRef module, const char* internalName, const char* externalModuleName, const char* externalBaseName, BinaryenType globalType); // Exports @@ -790,18 +774,12 @@ void BinaryenFunctionSetDebugLocation(BinaryenFunctionRef func, BinaryenExpressi // ========== Import Operations ========== // -// Gets the external kind of the specified import. -BinaryenExternalKind BinaryenImportGetKind(BinaryenImportRef import); // Gets the external module name of the specified import. -const char* BinaryenImportGetModule(BinaryenImportRef import); +const char* BinaryenFunctionImportGetModule(BinaryenFunctionRef import); +const char* BinaryeGlobalImportGetModule(BinaryenGlobalRef import); // Gets the external base name of the specified import. -const char* BinaryenImportGetBase(BinaryenImportRef import); -// Gets the internal name of the specified import. -const char* BinaryenImportGetName(BinaryenImportRef import); -// Gets the type of the imported global, if referencing a `Global`. -BinaryenType BinaryenImportGetGlobalType(BinaryenImportRef import); -// Gets the name of the function type of the imported function, if referencing a `Function`. -const char* BinaryenImportGetFunctionType(BinaryenImportRef import); +const char* BinaryenFunctionImportGetBase(BinaryenFunctionRef import); +const char* BinaryenGlobalImportGetBase(BinaryenGlobalRef import); // // ========== Export Operations ========== |