Skip to content

Commit bac4171

Browse files
authored
Remove xbegin and _xend (#126952)
`intrin.h` contains declarations for both `xbegin` and `_xend`, but they should already be included transitively from `rtmintrin.h` via `immintrin.h` and/or `x86intrin.h`. Having them in both places causes problems if both headers are included. Furthermore, the `intrin.h` declaration of `xbegin` seems to be bugged anyway, since it's missing its leading underscore. Fixes #95133
1 parent 876174f commit bac4171

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

clang/lib/Headers/intrin.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,6 @@ void _Store_HLERelease(long volatile *, long);
162162
void _Store64_HLERelease(__int64 volatile *, __int64);
163163
void _StorePointer_HLERelease(void *volatile *, void *);
164164
void _WriteBarrier(void);
165-
unsigned __int32 xbegin(void);
166-
void _xend(void);
167165

168166
/* These additional intrinsics are turned on in x64/amd64/x86_64 mode. */
169167
#if defined(__x86_64__) && !defined(__arm64ec__)

clang/test/Headers/no-xend.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: %clang_cc1 -triple x86_64-pc-win32 \
2+
// RUN: -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \
3+
// RUN: -ffreestanding -fsyntax-only -Werror -Wsystem-headers \
4+
// RUN: -isystem %S/Inputs/include %s
5+
6+
#include <immintrin.h>
7+
8+
#pragma clang attribute push(__attribute__((target("avx"))), apply_to=function)
9+
#include <intrin.h>
10+
#pragma clang attribute pop

0 commit comments

Comments
 (0)