Skip to content

Commit 4dc36ce

Browse files
committed
[LLT] mark the CFI jumptable naked on Windows
1 parent 4ed97c1 commit 4dc36ce

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

llvm/lib/Transforms/IPO/LowerTypeTests.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,12 +1554,7 @@ void LowerTypeTestsModule::createJumpTable(
15541554

15551555
// Align the whole table by entry size.
15561556
F->setAlignment(Align(getJumpTableEntrySize(JumpTableArch)));
1557-
// Skip prologue.
1558-
// Disabled on win32 due to https://llvm.org/bugs/show_bug.cgi?id=28641#c3.
1559-
// Luckily, this function does not get any prologue even without the
1560-
// attribute.
1561-
if (OS != Triple::Win32)
1562-
F->addFnAttr(Attribute::Naked);
1557+
F->addFnAttr(Attribute::Naked);
15631558
if (JumpTableArch == Triple::arm)
15641559
F->addFnAttr("target-features", "-thumb-mode");
15651560
if (JumpTableArch == Triple::thumb) {

llvm/test/Transforms/LowerTypeTests/function.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ define i1 @foo(ptr %p) {
115115
; NATIVE-SAME: "s"(ptr @g.cfi)
116116

117117
; X86-LINUX: attributes #[[ATTR]] = { naked nocf_check noinline }
118-
; X86-WIN32: attributes #[[ATTR]] = { nocf_check noinline }
118+
; X86-WIN32: attributes #[[ATTR]] = { naked nocf_check noinline }
119119
; ARM: attributes #[[ATTR]] = { naked noinline
120120
; THUMB: attributes #[[ATTR]] = { naked noinline "target-cpu"="cortex-a8" "target-features"="+thumb-mode" }
121121
; THUMBV6M: attributes #[[ATTR]] = { naked noinline "target-features"="+thumb-mode" }

0 commit comments

Comments
 (0)