Skip to content

Commit 26e162d

Browse files
committed
WebAssembly: remove more PCRel relocations
This at least seems to get rid of all the PCRel relocations emitted. Now it crashes in: (($sSTMp)+48)-8 The expr type is 0 expression kind not supported yay?!
1 parent 7e42e33 commit 26e162d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/IRGen/GenMeta.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -4295,6 +4295,12 @@ GenericRequirementsMetadata irgen::addGenericRequirements(
42954295
unsigned tag = unsigned(descriptorRef.isIndirect());
42964296
if (protocol->isObjC())
42974297
tag |= 0x02;
4298+
// WebAssembly: hack: Wasm doesn't support PC-relative offsets.
4299+
// also doesn't handle tag yet
4300+
if (IGM.TargetInfo.OutputObjectFormat == llvm::Triple::Wasm) {
4301+
B.add(llvm::ConstantExpr::getPtrToInt(descriptorRef.getValue(), IGM.RelativeAddressTy, false));
4302+
return;
4303+
}
42984304

42994305
B.addTaggedRelativeOffset(IGM.RelativeAddressTy,
43004306
descriptorRef.getValue(),

0 commit comments

Comments
 (0)