Skip to content

Commit 9abf63c

Browse files
authored
Reduce boilerplate with a C macro for class delegations. NFC (#3290)
Split off from #3264
1 parent 6c28516 commit 9abf63c

File tree

2 files changed

+120
-784
lines changed

2 files changed

+120
-784
lines changed

src/wasm-delegations.h

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
* Copyright 2020 WebAssembly Community Group participants
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
DELEGATE(Nop);
18+
DELEGATE(Block);
19+
DELEGATE(If);
20+
DELEGATE(Loop);
21+
DELEGATE(Break);
22+
DELEGATE(Switch);
23+
DELEGATE(Call);
24+
DELEGATE(CallIndirect);
25+
DELEGATE(LocalGet);
26+
DELEGATE(LocalSet);
27+
DELEGATE(GlobalGet);
28+
DELEGATE(GlobalSet);
29+
DELEGATE(Load);
30+
DELEGATE(Store);
31+
DELEGATE(AtomicRMW);
32+
DELEGATE(AtomicCmpxchg);
33+
DELEGATE(AtomicWait);
34+
DELEGATE(AtomicNotify);
35+
DELEGATE(AtomicFence);
36+
DELEGATE(SIMDExtract);
37+
DELEGATE(SIMDReplace);
38+
DELEGATE(SIMDShuffle);
39+
DELEGATE(SIMDTernary);
40+
DELEGATE(SIMDShift);
41+
DELEGATE(SIMDLoad);
42+
DELEGATE(SIMDLoadStoreLane);
43+
DELEGATE(MemoryInit);
44+
DELEGATE(DataDrop);
45+
DELEGATE(MemoryCopy);
46+
DELEGATE(MemoryFill);
47+
DELEGATE(Const);
48+
DELEGATE(Unary);
49+
DELEGATE(Binary);
50+
DELEGATE(Select);
51+
DELEGATE(Drop);
52+
DELEGATE(Return);
53+
DELEGATE(MemorySize);
54+
DELEGATE(MemoryGrow);
55+
DELEGATE(Unreachable);
56+
DELEGATE(Pop);
57+
DELEGATE(RefNull);
58+
DELEGATE(RefIsNull);
59+
DELEGATE(RefFunc);
60+
DELEGATE(RefEq);
61+
DELEGATE(Try);
62+
DELEGATE(Throw);
63+
DELEGATE(Rethrow);
64+
DELEGATE(BrOnExn);
65+
DELEGATE(TupleMake);
66+
DELEGATE(TupleExtract);
67+
DELEGATE(I31New);
68+
DELEGATE(I31Get);
69+
DELEGATE(RefTest);
70+
DELEGATE(RefCast);
71+
DELEGATE(BrOnCast);
72+
DELEGATE(RttCanon);
73+
DELEGATE(RttSub);
74+
DELEGATE(StructNew);
75+
DELEGATE(StructGet);
76+
DELEGATE(StructSet);
77+
DELEGATE(ArrayNew);
78+
DELEGATE(ArrayGet);
79+
DELEGATE(ArraySet);
80+
DELEGATE(ArrayLen);

0 commit comments

Comments
 (0)