Skip to content
This repository was archived by the owner on Oct 24, 2019. It is now read-only.

Commit 502e753

Browse files
committed
write Clang precompiled headers to a custom section
This doesn't fix the alignment issue yet. See https://bugs.llvm.org/show_bug.cgi?id=35928 and https://reviews.llvm.org/D42233.
1 parent d8a8f3f commit 502e753

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Diff for: lib/CodeGen/TargetLoweringObjectFileImpl.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1672,6 +1672,10 @@ static SectionKind getWasmKindForNamedSection(StringRef Name, SectionKind K) {
16721672
if (K.isText())
16731673
return SectionKind::getText();
16741674

1675+
// Clang precompiled header data isn't needed at runtime; use custom section
1676+
if (Name == "__clangast")
1677+
return SectionKind::getMetadata();
1678+
16751679
// Otherwise, ignore whatever section type the generic impl detected and use
16761680
// a plain data section.
16771681
return SectionKind::getData();

Diff for: lib/MC/WasmObjectWriter.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,10 @@ static bool isInSymtab(const MCSymbolWasm &Sym) {
11351135
if (Sym.isSection())
11361136
return false;
11371137

1138+
// Clang's precompiled headers are in a separate custom section
1139+
if (Sym.getName() == "__clang_ast")
1140+
return false;
1141+
11381142
return true;
11391143
}
11401144

0 commit comments

Comments
 (0)