llvm.org GIT mirror llvm / a6a29d9
[WebAssembly] MC: Don't generate extra types for weak alias Previously we were generating a void(void) function type for a weak alias. Update the weak-alias test case to catch this. Differential Revision: https://reviews.llvm.org/D34734 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307194 91177308-0d34-0410-b5e6-96231b3b80d8 Sam Clegg 2 years ago
3 changed file(s) with 13 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
106106
107107 struct WasmRelocation {
108108 uint32_t Type; // The type of the relocation.
109 int32_t Index; // Index into function to global index space.
109 uint32_t Index; // Index into function to global index space.
110110 uint64_t Offset; // Offset from the start of the section.
111111 int64_t Addend; // A value to add to the symbol.
112112 };
958958
959959 // Populate the Imports set.
960960 for (const MCSymbol &S : Asm.symbols()) {
961 // Weak aliases don't have thier own function types.
962 if (S.isVariable())
963 continue;
964
961965 const auto &WS = static_cast(S);
962966 int32_t Type;
963967
99 ret i32 0
1010 }
1111
12 ; CHECK: - Type: TYPE
13 ; CHECK-NEXT: Signatures:
14 ; CHECK-NEXT: - Index: 0
15 ; CHECK-NEXT: ReturnType: I32
16 ; CHECK-NEXT: ParamTypes:
17 ; CHECK-NEXT: - Type: FUNCTION
18 ; CHECK-NEXT: FunctionTypes: [ 0 ]
19
1220 ; CHECK: - Type: EXPORT
1321 ; CHECK-NEXT: Exports:
1422 ; CHECK-NEXT: - Name: foo
1725 ; CHECK-NEXT: - Name: foo_alias
1826 ; CHECK-NEXT: Kind: FUNCTION
1927 ; CHECK-NEXT: Index: 0
20
2128
2229 ; CHECK: - Type: CUSTOM
2330 ; CHECK-NEXT: Name: name