File tree Expand file tree Collapse file tree 4 files changed +22
-1
lines changed Expand file tree Collapse file tree 4 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -3240,6 +3240,10 @@ struct PrintSExpression : public OverriddenVisitor<PrintSExpression> {
3240
3240
}
3241
3241
o << maybeNewLine;
3242
3242
}
3243
+ if (curr->hasFeaturesSection ) {
3244
+ doIndent (o, indent);
3245
+ o << " ;; features section: " << curr->features .toString () << ' \n ' ;
3246
+ }
3243
3247
decIndent ();
3244
3248
o << maybeNewLine;
3245
3249
currModule = nullptr ;
Original file line number Diff line number Diff line change @@ -75,6 +75,21 @@ struct FeatureSet {
75
75
}
76
76
}
77
77
78
+ std::string toString () {
79
+ std::string ret;
80
+ uint32_t x = 1 ;
81
+ while (x & Feature::All) {
82
+ if (features & x) {
83
+ if (!ret.empty ()) {
84
+ ret += " , " ;
85
+ }
86
+ ret += toString (Feature (x));
87
+ }
88
+ x <<= 1 ;
89
+ }
90
+ return ret;
91
+ }
92
+
78
93
FeatureSet () : features(MVP) {}
79
94
FeatureSet (uint32_t features) : features(features) {}
80
95
operator uint32_t () const { return features; }
Original file line number Diff line number Diff line change 1
1
#include <assert.h>
2
- #include <string.h>
3
2
#include <binaryen-c.h>
3
+ #include <string.h>
4
4
5
5
// "hello world" type example: create a function that adds two i32s and returns
6
6
// the result
Original file line number Diff line number Diff line change 120
120
;; custom section ".debug_line", size 92
121
121
;; custom section ".debug_str", size 194
122
122
;; custom section "producers", size 137
123
+ ;; features section: exception-handling, reference-types
123
124
)
124
125
DWARF debug info
125
126
================
@@ -541,4 +542,5 @@ file_names[ 1]:
541
542
;; custom section ".debug_line", size 145
542
543
;; custom section ".debug_str", size 194
543
544
;; custom section "producers", size 137
545
+ ;; features section: exception-handling, reference-types
544
546
)
You can’t perform that action at this time.
0 commit comments