Skip to content

Commit c8058ff

Browse files
committed
merge main into amd-staging
2 parents 8050157 + 4cfbc44 commit c8058ff

File tree

49 files changed

+1412
-2084
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1412
-2084
lines changed

clang-tools-extra/clangd/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set(CLANGD_TEST_DEPS
33
ClangdTests
44
clangd-indexer
55
split-file
6+
IndexBenchmark
67
)
78

89
if(CLANGD_BUILD_XPC)

clang-tools-extra/clangd/test/include-cleaner-batch-fix.test

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
# RUN: cp -r %S/Inputs/include-cleaner %t/include
88
# RUN: echo '-I%t/include' > %t/compile_flags.txt
99
# Create a config file enabling include-cleaner features.
10-
# RUN: echo $'Diagnostics:\n UnusedIncludes: Strict\n MissingIncludes: Strict' >> %t/clangd/config.yaml
10+
# RUN: echo 'Diagnostics:' > %t/clangd/config.yaml
11+
# RUN: echo ' UnusedIncludes: Strict' >> %t/clangd/config.yaml
12+
# RUN: echo ' MissingIncludes: Strict' >> %t/clangd/config.yaml
1113

1214
# RUN: env XDG_CONFIG_HOME=%t clangd -lit-test -enable-config --compile-commands-dir=%t < %s | FileCheck -strict-whitespace %s
1315
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{"workspace":{"workspaceEdit":{"documentChanges":true, "changeAnnotationSupport":{"groupsOnLabel":true}}}},"trace":"off"}}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
# Paths are not constructed correctly for the test to run on Windows.
2+
# UNSUPPORTED: system-windows
13
# RUN: clangd-indexer %p/Inputs/BenchmarkSource.cpp -- -I%p/Inputs > %t.index
2-
# FIXME: By default, benchmarks are excluded from the list of default targets hence not built. Find a way to depend on benchmarks to run the next command.
3-
# REQUIRES: shell
4-
# RUN: if [ -f %clangd-benchmark-dir/IndexBenchmark ]; then %clangd-benchmark-dir/IndexBenchmark %t.index %p/Inputs/requests.json --benchmark_min_time=0.01 ; fi
4+
# RUN: %clangd-benchmark-dir/IndexBenchmark %t.index %p/Inputs/requests.json --benchmark_min_time=0.01
55
# Pass invalid JSON file and check that IndexBenchmark fails to parse it.
6-
# RUN: if [ -f %clangd-benchmark-dir/IndexBenchmark ]; then not %clangd-benchmark-dir/IndexBenchmark %t.index %t --benchmark_min_time=0.01 ; fi
6+
# RUN: not %clangd-benchmark-dir/IndexBenchmark %t.index %t --benchmark_min_time=0.01

clang-tools-extra/clangd/test/system-include-extractor.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
# Create a bin directory to store the mock-driver and add it to the path
77
# RUN: mkdir -p %t.dir/bin
8-
# RUN: export PATH=%t.dir/bin:$PATH
8+
# RUN: %python -c "print(__import__('os').environ['PATH'])" > %t.path
9+
# RUN: export PATH=%t.dir/bin:%{readfile:%t.path}
910
# Generate a mock-driver that will print %temp_dir%/my/dir and
1011
# %temp_dir%/my/dir2 as include search paths.
1112
# RUN: echo '#!/bin/sh' >> %t.dir/bin/my_driver.sh

clang/cmake/caches/Fuchsia-stage2.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ set(CMAKE_CXX_VISIBILITY_PRESET default CACHE STRING "")
5858

5959
set(CMAKE_BUILD_TYPE Release CACHE STRING "")
6060
if (APPLE)
61-
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "")
61+
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "")
6262
elseif(WIN32)
6363
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded" CACHE STRING "")
6464
endif()
@@ -83,7 +83,7 @@ if(APPLE)
8383
set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
8484
set(LIBCXX_HARDENING_MODE "none" CACHE STRING "")
8585
set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
86-
set(RUNTIMES_CMAKE_ARGS "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13;-DCMAKE_OSX_ARCHITECTURES=arm64|x86_64" CACHE STRING "")
86+
set(RUNTIMES_CMAKE_ARGS "-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0;-DCMAKE_OSX_ARCHITECTURES=arm64|x86_64" CACHE STRING "")
8787
endif()
8888

8989
if(WIN32 OR LLVM_WINSYSROOT)

clang/cmake/caches/Fuchsia.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
9797
set(LLVM_ENABLE_BACKTRACES ON CACHE BOOL "")
9898
set(CMAKE_BUILD_TYPE Release CACHE STRING "")
9999
if(APPLE)
100-
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "")
100+
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "")
101101
elseif(WIN32)
102102
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded" CACHE STRING "")
103103
endif()
@@ -140,7 +140,7 @@ else()
140140
set(SANITIZER_TEST_CXX "libc++" CACHE STRING "")
141141
set(SANITIZER_TEST_CXX_INTREE ON CACHE BOOL "")
142142
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
143-
set(RUNTIMES_CMAKE_ARGS "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13;-DCMAKE_OSX_ARCHITECTURES=arm64|x86_64" CACHE STRING "")
143+
set(RUNTIMES_CMAKE_ARGS "-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0;-DCMAKE_OSX_ARCHITECTURES=arm64|x86_64" CACHE STRING "")
144144
endif()
145145

146146
if(BOOTSTRAP_CMAKE_SYSTEM_NAME)

clang/include/clang/CIR/MissingFeatures.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ struct MissingFeatures {
151151

152152
// Coroutines
153153
static bool coroEndBuiltinCall() { return false; }
154-
static bool coroutineFrame() { return false; }
155154
static bool emitBodyAndFallthrough() { return false; }
156155
static bool coroOutsideFrameMD() { return false; }
157156

clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID,
502502
return getUndefRValue(e->getType());
503503

504504
case Builtin::BI__builtin_coro_frame: {
505-
cgm.errorNYI(e->getSourceRange(), "BI__builtin_coro_frame NYI");
506-
assert(!cir::MissingFeatures::coroutineFrame());
507-
return getUndefRValue(e->getType());
505+
return emitCoroutineFrame();
508506
}
509507
case Builtin::BI__builtin_coro_free:
510508
case Builtin::BI__builtin_coro_size: {

clang/lib/CIR/CodeGen/CIRGenCoroutine.cpp

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ struct ParamReferenceReplacerRAII {
9797
}
9898
};
9999
} // namespace
100+
101+
RValue CIRGenFunction::emitCoroutineFrame() {
102+
if (curCoro.data && curCoro.data->coroBegin) {
103+
return RValue::get(curCoro.data->coroBegin);
104+
}
105+
cgm.errorNYI("NYI");
106+
return RValue();
107+
}
108+
100109
static void createCoroData(CIRGenFunction &cgf,
101110
CIRGenFunction::CGCoroInfo &curCoro,
102111
cir::CallOp coroId) {
@@ -302,11 +311,24 @@ emitSuspendExpression(CIRGenFunction &cgf, CGCoroData &coro,
302311
builder, cgf.getLoc(s.getSourceRange()), kind,
303312
/*readyBuilder=*/
304313
[&](mlir::OpBuilder &b, mlir::Location loc) {
305-
builder.createCondition(
306-
cgf.createDummyValue(loc, cgf.getContext().BoolTy));
314+
Expr *condExpr = s.getReadyExpr()->IgnoreParens();
315+
builder.createCondition(cgf.evaluateExprAsBool(condExpr));
307316
},
308317
/*suspendBuilder=*/
309318
[&](mlir::OpBuilder &b, mlir::Location loc) {
319+
// Note that differently from LLVM codegen we do not emit coro.save
320+
// and coro.suspend here, that should be done as part of lowering this
321+
// to LLVM dialect (or some other MLIR dialect)
322+
323+
// A invalid suspendRet indicates "void returning await_suspend"
324+
mlir::Value suspendRet = cgf.emitScalarExpr(s.getSuspendExpr());
325+
326+
// Veto suspension if requested by bool returning await_suspend.
327+
if (suspendRet) {
328+
cgf.cgm.errorNYI("Veto await_suspend");
329+
}
330+
331+
// Signals the parent that execution flows to next region.
310332
cir::YieldOp::create(builder, loc);
311333
},
312334
/*resumeBuilder=*/

clang/lib/CIR/CodeGen/CIRGenFunction.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,6 +1418,7 @@ class CIRGenFunction : public CIRGenTypeCache {
14181418
cir::CallOp emitCoroAllocBuiltinCall(mlir::Location loc);
14191419
cir::CallOp emitCoroBeginBuiltinCall(mlir::Location loc,
14201420
mlir::Value coroframeAddr);
1421+
RValue emitCoroutineFrame();
14211422

14221423
void emitDestroy(Address addr, QualType type, Destroyer *destroyer);
14231424

0 commit comments

Comments
 (0)