@@ -1023,6 +1023,9 @@ BinaryenOp BinaryenStringNewUTF8Array(void) { return StringNewUTF8Array; }
10231023BinaryenOp BinaryenStringNewWTF8Array (void ) { return StringNewWTF8Array; }
10241024BinaryenOp BinaryenStringNewReplaceArray (void ) { return StringNewReplaceArray; }
10251025BinaryenOp BinaryenStringNewWTF16Array (void ) { return StringNewWTF16Array; }
1026+ BinaryenOp BinaryenStringNewFromCodePoint (void ) {
1027+ return StringNewFromCodePoint;
1028+ }
10261029BinaryenOp BinaryenStringMeasureUTF8 (void ) { return StringMeasureUTF8; }
10271030BinaryenOp BinaryenStringMeasureWTF8 (void ) { return StringMeasureWTF8; }
10281031BinaryenOp BinaryenStringMeasureWTF16 (void ) { return StringMeasureWTF16; }
@@ -1045,6 +1048,8 @@ BinaryenOp BinaryenStringIterMoveAdvance(void) { return StringIterMoveAdvance; }
10451048BinaryenOp BinaryenStringIterMoveRewind (void ) { return StringIterMoveRewind; }
10461049BinaryenOp BinaryenStringSliceWTF8 (void ) { return StringSliceWTF8; }
10471050BinaryenOp BinaryenStringSliceWTF16 (void ) { return StringSliceWTF16; }
1051+ BinaryenOp BinaryenStringEqEqual (void ) { return StringEqEqual; }
1052+ BinaryenOp BinaryenStringEqCompare (void ) { return StringEqCompare; }
10481053
10491054BinaryenExpressionRef BinaryenBlock (BinaryenModuleRef module ,
10501055 const char * name,
@@ -1835,10 +1840,8 @@ BinaryenExpressionRef BinaryenStringNew(BinaryenModuleRef module,
18351840 BinaryenExpressionRef ptr,
18361841 BinaryenExpressionRef length,
18371842 BinaryenExpressionRef start,
1838- BinaryenExpressionRef end) {
1839- // TODO: add API support for this
1840- bool try_ = false ;
1841-
1843+ BinaryenExpressionRef end,
1844+ bool try_) {
18421845 Builder builder (*(Module*)module );
18431846 return static_cast <Expression*>(
18441847 length ? builder.makeStringNew (
@@ -1880,11 +1883,12 @@ BinaryenExpressionRef BinaryenStringConcat(BinaryenModuleRef module,
18801883 .makeStringConcat ((Expression*)left, (Expression*)right));
18811884}
18821885BinaryenExpressionRef BinaryenStringEq (BinaryenModuleRef module ,
1886+ BinaryenOp op,
18831887 BinaryenExpressionRef left,
18841888 BinaryenExpressionRef right) {
18851889 return static_cast <Expression*>(
18861890 Builder (*(Module*)module )
1887- .makeStringEq (StringEqEqual , (Expression*)left, (Expression*)right));
1891+ .makeStringEq (StringEqOp (op) , (Expression*)left, (Expression*)right));
18881892}
18891893BinaryenExpressionRef BinaryenStringAs (BinaryenModuleRef module ,
18901894 BinaryenOp op,
@@ -4506,6 +4510,16 @@ void BinaryenStringNewSetEnd(BinaryenExpressionRef expr,
45064510 // may be null (GC only)
45074511 static_cast <StringNew*>(expression)->end = (Expression*)endExpr;
45084512}
4513+ void BinaryenStringNewSetTry (BinaryenExpressionRef expr, bool try_) {
4514+ auto * expression = (Expression*)expr;
4515+ assert (expression->is <StringNew>());
4516+ static_cast <StringNew*>(expression)->try_ = try_;
4517+ }
4518+ bool BinaryenStringNewIsTry (BinaryenExpressionRef expr) {
4519+ auto * expression = (Expression*)expr;
4520+ assert (expression->is <StringNew>());
4521+ return static_cast <StringNew*>(expression)->try_ ;
4522+ }
45094523// StringConst
45104524const char * BinaryenStringConstGetString (BinaryenExpressionRef expr) {
45114525 auto * expression = (Expression*)expr;
@@ -4615,6 +4629,16 @@ void BinaryenStringConcatSetRight(BinaryenExpressionRef expr,
46154629 static_cast <StringConcat*>(expression)->right = (Expression*)rightExpr;
46164630}
46174631// StringEq
4632+ BinaryenOp BinaryenStringEqGetOp (BinaryenExpressionRef expr) {
4633+ auto * expression = (Expression*)expr;
4634+ assert (expression->is <StringEq>());
4635+ return static_cast <StringEq*>(expression)->op ;
4636+ }
4637+ void BinaryenStringEqSetOp (BinaryenExpressionRef expr, BinaryenOp op) {
4638+ auto * expression = (Expression*)expr;
4639+ assert (expression->is <StringEq>());
4640+ static_cast <StringEq*>(expression)->op = StringEqOp (op);
4641+ }
46184642BinaryenExpressionRef BinaryenStringEqGetLeft (BinaryenExpressionRef expr) {
46194643 auto * expression = (Expression*)expr;
46204644 assert (expression->is <StringEq>());
0 commit comments