Skip to content

Commit 8e01185

Browse files
authored
merge main into amd-staging (llvm#1500)
2 parents 5b6e2cd + d410ad2 commit 8e01185

File tree

24 files changed

+255
-89
lines changed

24 files changed

+255
-89
lines changed

.ci/monolithic-linux.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ targets="${2}"
5353
lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests"
5454

5555
echo "--- cmake"
56-
pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
57-
pip install -q -r "${MONOREPO_ROOT}"/lldb/test/requirements.txt
58-
pip install -q -r "${MONOREPO_ROOT}"/.ci/requirements.txt
56+
pip install --break-system-packages -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
57+
pip install --break-system-packages -q -r "${MONOREPO_ROOT}"/lldb/test/requirements.txt
58+
pip install --break-system-packages -q -r "${MONOREPO_ROOT}"/.ci/requirements.txt
5959
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
6060
-D LLVM_ENABLE_PROJECTS="${projects}" \
6161
-G Ninja \

.github/workflows/containers/github-action-ci-windows/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ RUN choco install -y handle
108108
109109
RUN pip3 install pywin32 buildbot-worker==2.8.4
110110
111-
ARG RUNNER_VERSION=2.322.0
111+
ARG RUNNER_VERSION=2.323.0
112112
ENV RUNNER_VERSION=$RUNNER_VERSION
113113
114114
RUN powershell -Command \

.github/workflows/containers/github-action-ci/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ WORKDIR /home/gha
9595

9696
FROM ci-container as ci-container-agent
9797

98-
ENV GITHUB_RUNNER_VERSION=2.322.0
98+
ENV GITHUB_RUNNER_VERSION=2.323.0
9999

100100
RUN mkdir actions-runner && \
101101
cd actions-runner && \

clang/lib/Basic/SourceManager.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,11 @@
2424
#include "llvm/ADT/StringRef.h"
2525
#include "llvm/ADT/StringSwitch.h"
2626
#include "llvm/Support/Allocator.h"
27-
#include "llvm/Support/AutoConvert.h"
2827
#include "llvm/Support/Capacity.h"
2928
#include "llvm/Support/Compiler.h"
3029
#include "llvm/Support/Endian.h"
3130
#include "llvm/Support/ErrorHandling.h"
32-
#include "llvm/Support/FileSystem.h"
33-
#include "llvm/Support/MathExtras.h"
3431
#include "llvm/Support/MemoryBuffer.h"
35-
#include "llvm/Support/Path.h"
3632
#include "llvm/Support/raw_ostream.h"
3733
#include <algorithm>
3834
#include <cassert>

clang/lib/CodeGen/CGObjCMac.cpp

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -184,25 +184,6 @@ class ObjCCommonTypesHelper {
184184
/// SelectorPtrTy - LLVM type for selector handles (typeof(SEL))
185185
llvm::PointerType *SelectorPtrTy;
186186

187-
private:
188-
/// ProtocolPtrTy - LLVM type for external protocol handles
189-
/// (typeof(Protocol))
190-
llvm::Type *ExternalProtocolPtrTy;
191-
192-
public:
193-
llvm::Type *getExternalProtocolPtrTy() {
194-
if (!ExternalProtocolPtrTy) {
195-
// FIXME: It would be nice to unify this with the opaque type, so that the
196-
// IR comes out a bit cleaner.
197-
CodeGen::CodeGenTypes &Types = CGM.getTypes();
198-
ASTContext &Ctx = CGM.getContext();
199-
llvm::Type *T = Types.ConvertType(Ctx.getObjCProtoType());
200-
ExternalProtocolPtrTy = llvm::PointerType::getUnqual(T);
201-
}
202-
203-
return ExternalProtocolPtrTy;
204-
}
205-
206187
// SuperCTy - clang type for struct objc_super.
207188
QualType SuperCTy;
208189
// SuperPtrCTy - clang type for struct objc_super *.
@@ -5636,8 +5617,7 @@ CGObjCNonFragileABIMac::CGObjCNonFragileABIMac(CodeGen::CodeGenModule &cgm)
56365617
/* *** */
56375618

56385619
ObjCCommonTypesHelper::ObjCCommonTypesHelper(CodeGen::CodeGenModule &cgm)
5639-
: VMContext(cgm.getLLVMContext()), CGM(cgm),
5640-
ExternalProtocolPtrTy(nullptr) {
5620+
: VMContext(cgm.getLLVMContext()), CGM(cgm) {
56415621
CodeGen::CodeGenTypes &Types = CGM.getTypes();
56425622
ASTContext &Ctx = CGM.getContext();
56435623
unsigned ProgramAS = CGM.getDataLayout().getProgramAddressSpace();

clang/www/cxx_dr_status.html

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17242,7 +17242,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
1724217242
</tr>
1724317243
<tr class="open" id="2898">
1724417244
<td><a href="https://cplusplus.github.io/CWG/issues/2898.html">2898</a></td>
17245-
<td>open</td>
17245+
<td>tentatively ready</td>
1724617246
<td>Clarify implicit conversion sequence from <I>cv</I> <TT>T</TT> to <TT>T</TT></td>
1724717247
<td align="center">Not resolved</td>
1724817248
</tr>
@@ -17750,7 +17750,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
1775017750
</tr>
1775117751
<tr class="open" id="2982">
1775217752
<td><a href="https://cplusplus.github.io/CWG/issues/2982.html">2982</a></td>
17753-
<td>open</td>
17753+
<td>tentatively ready</td>
1775417754
<td>Deduction in <I>type-constraint</I>s</td>
1775517755
<td align="center">Not resolved</td>
1775617756
</tr>
@@ -17780,7 +17780,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
1778017780
</tr>
1778117781
<tr class="open" id="2987">
1778217782
<td><a href="https://cplusplus.github.io/CWG/issues/2987.html">2987</a></td>
17783-
<td>open</td>
17783+
<td>tentatively ready</td>
1778417784
<td>Remove dilapidated wording from <TT>static_cast</TT></td>
1778517785
<td align="center">Not resolved</td>
1778617786
</tr>
@@ -17945,6 +17945,36 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
1794517945
<td>open</td>
1794617946
<td>Comma-delimited vs. comma-separated output for <TT>#embed</TT></td>
1794717947
<td align="center">Not resolved</td>
17948+
</tr>
17949+
<tr class="open" id="3015">
17950+
<td><a href="https://cplusplus.github.io/CWG/issues/3015.html">3015</a></td>
17951+
<td>open</td>
17952+
<td>Handling of <I>header-name</I>s for <TT>#include</TT> and <TT>#embed</TT></td>
17953+
<td align="center">Not resolved</td>
17954+
</tr>
17955+
<tr class="open" id="3016">
17956+
<td><a href="https://cplusplus.github.io/CWG/issues/3016.html">3016</a></td>
17957+
<td>open</td>
17958+
<td>Satisfying the syntactic requirements of <TT>#include</TT> and <TT>#embed</TT></td>
17959+
<td align="center">Not resolved</td>
17960+
</tr>
17961+
<tr class="open" id="3017">
17962+
<td><a href="https://cplusplus.github.io/CWG/issues/3017.html">3017</a></td>
17963+
<td>open</td>
17964+
<td>Commas in controlling expression of conditional inclusion</td>
17965+
<td align="center">Not resolved</td>
17966+
</tr>
17967+
<tr class="open" id="3018">
17968+
<td><a href="https://cplusplus.github.io/CWG/issues/3018.html">3018</a></td>
17969+
<td>open</td>
17970+
<td>Validity of <TT>defined</TT> in <TT>__has_embed</TT></td>
17971+
<td align="center">Not resolved</td>
17972+
</tr>
17973+
<tr class="open" id="3019">
17974+
<td><a href="https://cplusplus.github.io/CWG/issues/3019.html">3019</a></td>
17975+
<td>open</td>
17976+
<td>Restrictions on character sequences in <I>header-name</I>s</td>
17977+
<td align="center">Not resolved</td>
1794817978
</tr></table>
1794917979

1795017980
</div>

compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,17 @@ INTERCEPTOR(int, ftruncate64, int fd, off64_t length) {
322322
#define RTSAN_MAYBE_INTERCEPT_FTRUNCATE64
323323
#endif
324324

325+
INTERCEPTOR(int, symlink, const char *target, const char *linkpath) {
326+
__rtsan_notify_intercepted_call("symlink");
327+
return REAL(symlink)(target, linkpath);
328+
}
329+
330+
INTERCEPTOR(int, symlinkat, const char *target, int newdirfd,
331+
const char *linkpath) {
332+
__rtsan_notify_intercepted_call("symlinkat");
333+
return REAL(symlinkat)(target, newdirfd, linkpath);
334+
}
335+
325336
// Streams
326337

327338
INTERCEPTOR(FILE *, fopen, const char *path, const char *mode) {
@@ -1359,6 +1370,12 @@ INTERCEPTOR(int, timerfd_gettime, int fd, struct itimerspec *val) {
13591370
__rtsan_notify_intercepted_call("timerfd_gettime");
13601371
return REAL(timerfd_gettime)(fd, val);
13611372
}
1373+
1374+
/* eventfd wrappers calls SYS_eventfd2 down the line */
1375+
INTERCEPTOR(int, eventfd, unsigned int count, int flags) {
1376+
__rtsan_notify_intercepted_call("eventfd");
1377+
return REAL(eventfd)(count, flags);
1378+
}
13621379
#define RTSAN_MAYBE_INTERCEPT_INOTIFY_INIT INTERCEPT_FUNCTION(inotify_init)
13631380
#define RTSAN_MAYBE_INTERCEPT_INOTIFY_INIT1 INTERCEPT_FUNCTION(inotify_init1)
13641381
#define RTSAN_MAYBE_INTERCEPT_INOTIFY_ADD_WATCH \
@@ -1370,6 +1387,7 @@ INTERCEPTOR(int, timerfd_gettime, int fd, struct itimerspec *val) {
13701387
INTERCEPT_FUNCTION(timerfd_settime)
13711388
#define RTSAN_MAYBE_INTERCEPT_TIMERFD_GETTIME \
13721389
INTERCEPT_FUNCTION(timerfd_gettime)
1390+
#define RTSAN_MAYBE_INTERCEPT_EVENTFD INTERCEPT_FUNCTION(eventfd)
13731391
#else
13741392
#define RTSAN_MAYBE_INTERCEPT_INOTIFY_INIT
13751393
#define RTSAN_MAYBE_INTERCEPT_INOTIFY_INIT1
@@ -1378,6 +1396,7 @@ INTERCEPTOR(int, timerfd_gettime, int fd, struct itimerspec *val) {
13781396
#define RTSAN_MAYBE_INTERCEPT_TIMERFD_CREATE
13791397
#define RTSAN_MAYBE_INTERCEPT_TIMERFD_SETTIME
13801398
#define RTSAN_MAYBE_INTERCEPT_TIMERFD_GETTIME
1399+
#define RTSAN_MAYBE_INTERCEPT_EVENTFD
13811400
#endif
13821401

13831402
INTERCEPTOR(int, pipe, int pipefd[2]) {
@@ -1515,6 +1534,8 @@ void __rtsan::InitializeInterceptors() {
15151534
RTSAN_MAYBE_INTERCEPT_READLINKAT;
15161535
INTERCEPT_FUNCTION(unlink);
15171536
INTERCEPT_FUNCTION(unlinkat);
1537+
INTERCEPT_FUNCTION(symlink);
1538+
INTERCEPT_FUNCTION(symlinkat);
15181539
INTERCEPT_FUNCTION(truncate);
15191540
INTERCEPT_FUNCTION(ftruncate);
15201541
RTSAN_MAYBE_INTERCEPT_TRUNCATE64;
@@ -1644,6 +1665,7 @@ void __rtsan::InitializeInterceptors() {
16441665
RTSAN_MAYBE_INTERCEPT_TIMERFD_CREATE;
16451666
RTSAN_MAYBE_INTERCEPT_TIMERFD_SETTIME;
16461667
RTSAN_MAYBE_INTERCEPT_TIMERFD_GETTIME;
1668+
RTSAN_MAYBE_INTERCEPT_EVENTFD;
16471669

16481670
INTERCEPT_FUNCTION(pipe);
16491671
INTERCEPT_FUNCTION(mkfifo);

compiler-rt/lib/rtsan/tests/rtsan_test_interceptors_posix.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include <pthread.h>
4545
#include <stdio.h>
4646
#if SANITIZER_LINUX
47+
#include <sys/eventfd.h>
4748
#include <sys/inotify.h>
4849
#include <sys/timerfd.h>
4950
#endif
@@ -896,6 +897,22 @@ TEST_F(RtsanOpenedFileTest, FtruncateDiesWhenRealtime) {
896897
ExpectNonRealtimeSurvival(Func);
897898
}
898899

900+
TEST_F(RtsanOpenedFileTest, SymlinkDiesWhenRealtime) {
901+
auto Func = [&]() {
902+
symlink("/tmp/rtsan_symlink_test", GetTemporaryFilePath());
903+
};
904+
ExpectRealtimeDeath(Func, "symlink");
905+
ExpectNonRealtimeSurvival(Func);
906+
}
907+
908+
TEST_F(RtsanOpenedFileTest, SymlinkatDiesWhenRealtime) {
909+
auto Func = [&]() {
910+
symlinkat("/tmp/rtsan_symlinkat_test", AT_FDCWD, GetTemporaryFilePath());
911+
};
912+
ExpectRealtimeDeath(Func, "symlinkat");
913+
ExpectNonRealtimeSurvival(Func);
914+
}
915+
899916
TEST_F(RtsanFileTest, FcloseDiesWhenRealtime) {
900917
FILE *f = fopen(GetTemporaryFilePath(), "w");
901918
EXPECT_THAT(f, Ne(nullptr));
@@ -1677,6 +1694,12 @@ TEST(TestRtsanInterceptors, TimerfdGettimeDiesWhenRealtime) {
16771694
ExpectRealtimeDeath(Func, "timerfd_gettime");
16781695
ExpectNonRealtimeSurvival(Func);
16791696
}
1697+
1698+
TEST(TestRtsanInterceptors, EventfdDiesWhenRealtime) {
1699+
auto Func = []() { eventfd(EFD_CLOEXEC, 0); };
1700+
ExpectRealtimeDeath(Func, "eventfd");
1701+
ExpectNonRealtimeSurvival(Func);
1702+
}
16801703
#endif
16811704

16821705
TEST(TestRtsanInterceptors, MkfifoDiesWhenRealtime) {

libc/src/math/generic/sin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ LLVM_LIBC_FUNCTION(double, sin, (double x)) {
158158
Float128 sin_k_f128 = get_sin_k(k);
159159
Float128 cos_k_f128 = get_sin_k(k + 64);
160160

161-
// sin(x) = sin((k * pi/128 + u)
161+
// sin(x) = sin(k * pi/128 + u)
162162
// = sin(u) * cos(k*pi/128) + cos(u) * sin(k*pi/128)
163163
Float128 r = fputil::quick_add(fputil::quick_mul(sin_k_f128, cos_u),
164164
fputil::quick_mul(cos_k_f128, sin_u));

llvm/include/llvm/MC/MCParser/AsmLexer.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class AsmLexer {
5353
const MCAsmInfo &MAI;
5454

5555
bool IsAtStartOfLine = true;
56-
bool AtStartOfStatement = true;
56+
bool JustConsumedEOL = true;
5757
bool IsPeeking = false;
5858
bool EndStatementAtEOF = true;
5959

@@ -91,7 +91,7 @@ class AsmLexer {
9191
const AsmToken &Lex() {
9292
assert(!CurTok.empty());
9393
// Mark if we parsing out a EndOfStatement.
94-
AtStartOfStatement = CurTok.front().getKind() == AsmToken::EndOfStatement;
94+
JustConsumedEOL = CurTok.front().getKind() == AsmToken::EndOfStatement;
9595
CurTok.erase(CurTok.begin());
9696
// LexToken may generate multiple tokens via UnLex but will always return
9797
// the first one. Place returned value at head of CurTok vector.
@@ -103,11 +103,10 @@ class AsmLexer {
103103
}
104104

105105
void UnLex(AsmToken const &Token) {
106-
AtStartOfStatement = false;
107106
CurTok.insert(CurTok.begin(), Token);
108107
}
109108

110-
bool isAtStartOfStatement() { return AtStartOfStatement; }
109+
bool justConsumedEOL() { return JustConsumedEOL; }
111110

112111
StringRef LexUntilEndOfStatement();
113112

0 commit comments

Comments
 (0)