diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2019-05-17 12:56:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-17 12:56:53 -0700 |
commit | 9c637288cf3b1c7505fa7d8edc1536b6e64d5967 (patch) | |
tree | fc7b0e579f3f9de41fca28c65551fb3359c8f40b /src/binaryen-c.h | |
parent | 1184678086b284944bb119a97ca048b64d4078b6 (diff) | |
download | binaryen-9c637288cf3b1c7505fa7d8edc1536b6e64d5967.tar.gz binaryen-9c637288cf3b1c7505fa7d8edc1536b6e64d5967.tar.bz2 binaryen-9c637288cf3b1c7505fa7d8edc1536b6e64d5967.zip |
Features C/JS API (#2049)
Add feature handling to the C/JS APIs. No features are enabled by
default, so all used features will have to be explicitly enabled in
order for modules to validate.
Diffstat (limited to 'src/binaryen-c.h')
-rw-r--r-- | src/binaryen-c.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/binaryen-c.h b/src/binaryen-c.h index 820b23cca..19434692b 100644 --- a/src/binaryen-c.h +++ b/src/binaryen-c.h @@ -137,6 +137,19 @@ BinaryenExternalKind BinaryenExternalTable(void); BinaryenExternalKind BinaryenExternalMemory(void); BinaryenExternalKind BinaryenExternalGlobal(void); +// Features. Call to get the value of each; you can cache them. Use bitwise +// operators to combine and test particular features. + +typedef uint32_t BinaryenFeatures; + +BinaryenFeatures BinaryenFeatureAtomics(void); +BinaryenFeatures BinaryenFeatureBulkMemory(void); +BinaryenFeatures BinaryenFeatureMutableGlobals(void); +BinaryenFeatures BinaryenFeatureNontrappingFPToInt(void); +BinaryenFeatures BinaryenFeatureSignExt(void); +BinaryenFeatures BinaryenFeatureSIMD128(void); +BinaryenFeatures BinaryenFeatureExceptionHandling(void); + // Modules // // Modules contain lists of functions, imports, exports, function types. The @@ -929,6 +942,12 @@ void BinaryenSetMemory(BinaryenModuleRef module, void BinaryenSetStart(BinaryenModuleRef module, BinaryenFunctionRef start); +// Features + +// These control what features are allowed when validation and in passes. +BinaryenFeatures BinaryenGetFeatures(BinaryenModuleRef module); +void BinaryenSetFeatures(BinaryenModuleRef module, BinaryenFeatures features); + // // ========== Module Operations ========== // |