Skip to content

Commit d58fefc

Browse files
authored
Merge branch 'main' into users/makslevental/fix-again-again
2 parents 4873f15 + 2e489f7 commit d58fefc

File tree

774 files changed

+23042
-12777
lines changed

Some content is hidden

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

774 files changed

+23042
-12777
lines changed

.github/workflows/bazel-checks.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ jobs:
3333
3434
bazel-build:
3535
name: "Bazel Build/Test"
36-
runs-on: llvm-premerge-linux-runners
36+
# Only run on US Central workers so we only have to keep one cache warm as
37+
# the cache buckets are per cluster.
38+
runs-on:
39+
group: llvm-premerge-cluster-us-central
40+
labels: llvm-premerge-linux-runners
3741
if: github.repository == 'llvm/llvm-project'
3842
steps:
3943
- name: Fetch LLVM sources
@@ -44,7 +48,7 @@ jobs:
4448
- name: Setup System Dependencies
4549
run: |
4650
sudo apt-get update
47-
sudo apt-get install -y libmpfr-dev libpfm4-dev
51+
sudo apt-get install -y libmpfr-dev libpfm4-dev m4 libedit-dev
4852
sudo curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-amd64.deb > /tmp/bazelisk.deb
4953
sudo apt-get install -y /tmp/bazelisk.deb
5054
rm /tmp/bazelisk.deb
@@ -54,4 +58,4 @@ jobs:
5458
bazelisk test --config=ci --sandbox_base="" \
5559
--remote_cache=https://storage.googleapis.com/$CACHE_GCS_BUCKET-bazel \
5660
--google_default_credentials \
57-
@llvm-project//llvm/unittests:adt_tests
61+
@llvm-project//... //...

.github/workflows/release-binaries.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,6 @@ jobs:
191191
- name: Install Ninja
192192
uses: llvm/actions/install-ninja@42d80571b13f4599bbefbc7189728b64723c7f78 # main
193193

194-
- name: Setup Windows
195-
if: startsWith(runner.os, 'Windows')
196-
uses: llvm/actions/setup-windows@42d80571b13f4599bbefbc7189728b64723c7f78 # main
197-
with:
198-
arch: amd64
199-
200194
- name: Set Build Prefix
201195
id: setup-stage
202196
shell: bash

clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,12 @@ void AvoidCStyleCastsCheck::check(const MatchFinder::MatchResult &Result) {
269269
return;
270270
}
271271
break;
272+
case CK_BaseToDerived:
273+
if (!needsConstCast(SourceType, DestType)) {
274+
ReplaceWithNamedCast("static_cast");
275+
return;
276+
}
277+
break;
272278
default:
273279
break;
274280
}

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,10 @@ Changes in existing checks
402402
adding an option to allow pointer arithmetic via prefix/postfix increment or
403403
decrement operators.
404404

405+
- Improved :doc:`google-readability-casting
406+
<clang-tidy/checks/google/readability-casting>` check by adding fix-it
407+
notes for downcasts.
408+
405409
- Improved :doc:`llvm-prefer-isa-or-dyn-cast-in-conditionals
406410
<clang-tidy/checks/llvm/prefer-isa-or-dyn-cast-in-conditionals>` check:
407411

clang-tools-extra/test/clang-tidy/checkers/google/readability-casting.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,11 @@ void f(int a, double b, const char *cpc, const void *cpv, X *pX) {
102102
// CHECK-FIXES: b1 = static_cast<int>(b);
103103

104104
Y *pB = (Y*)pX;
105-
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: {{.*}}; use static_cast/const_cast/reinterpret_cast [
105+
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: {{.*}}; use static_cast {{.*}}
106+
// CHECK-FIXES: Y *pB = static_cast<Y*>(pX);
106107
Y &rB = (Y&)*pX;
107-
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: {{.*}}; use static_cast/const_cast/reinterpret_cast [
108+
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: {{.*}}; use static_cast {{.*}}
109+
// CHECK-FIXES: Y &rB = static_cast<Y&>(*pX);
108110

109111
const char *pc3 = (const char*)cpv;
110112
// CHECK-MESSAGES: :[[@LINE-1]]:21: warning: {{.*}}; use static_cast [

clang/include/clang/AST/Decl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2335,7 +2335,7 @@ class FunctionDecl : public DeclaratorDecl,
23352335
}
23362336

23372337
void setDefaultedOrDeletedInfo(DefaultedOrDeletedFunctionInfo *Info);
2338-
DefaultedOrDeletedFunctionInfo *getDefalutedOrDeletedInfo() const;
2338+
DefaultedOrDeletedFunctionInfo *getDefaultedOrDeletedInfo() const;
23392339

23402340
/// Whether this function is variadic.
23412341
bool isVariadic() const;

clang/include/clang/Analysis/Analyses/LifetimeSafety/FactsGenerator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class FactsGenerator : public ConstStmtVisitor<FactsGenerator> {
4343
void VisitUnaryOperator(const UnaryOperator *UO);
4444
void VisitReturnStmt(const ReturnStmt *RS);
4545
void VisitBinaryOperator(const BinaryOperator *BO);
46+
void VisitConditionalOperator(const ConditionalOperator *CO);
4647
void VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *OCE);
4748
void VisitCXXFunctionalCastExpr(const CXXFunctionalCastExpr *FCE);
4849
void VisitInitListExpr(const InitListExpr *ILE);

clang/include/clang/CIR/MissingFeatures.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ struct MissingFeatures {
153153
static bool coroEndBuiltinCall() { return false; }
154154
static bool coroutineFrame() { return false; }
155155
static bool emitBodyAndFallthrough() { return false; }
156+
static bool coroOutsideFrameMD() { return false; }
156157

157158
// Various handling of deferred processing in CIRGenModule.
158159
static bool cgmRelease() { return false; }
@@ -298,6 +299,7 @@ struct MissingFeatures {
298299
static bool opTBAA() { return false; }
299300
static bool peepholeProtection() { return false; }
300301
static bool pgoUse() { return false; }
302+
static bool pointerAuthentication() { return false; }
301303
static bool pointerOverflowSanitizer() { return false; }
302304
static bool preservedAccessIndexRegion() { return false; }
303305
static bool requiresCleanups() { return false; }

clang/include/clang/Frontend/CompilerInvocation.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ class CompilerInvocationBase {
147147
}
148148
/// @}
149149

150+
/// Visitation.
151+
/// @{
152+
/// Visits paths stored in the invocation. The callback may return true to
153+
/// short-circuit the visitation, or return false to continue visiting.
154+
void visitPaths(llvm::function_ref<bool(StringRef)> Callback) const;
155+
/// @}
156+
150157
/// Command line generation.
151158
/// @{
152159
using StringAllocator = llvm::function_ref<const char *(const Twine &)>;
@@ -181,6 +188,12 @@ class CompilerInvocationBase {
181188
/// This is a (less-efficient) wrapper over generateCC1CommandLine().
182189
std::vector<std::string> getCC1CommandLine() const;
183190

191+
protected:
192+
/// Visits paths stored in the invocation. This is generally unsafe to call
193+
/// directly, and each sub-class need to ensure calling this doesn't violate
194+
/// its invariants.
195+
void visitPathsImpl(llvm::function_ref<bool(std::string &)> Predicate);
196+
184197
private:
185198
/// Generate command line options from DiagnosticOptions.
186199
static void GenerateDiagnosticArgs(const DiagnosticOptions &Opts,

clang/include/clang/Frontend/FrontendOptions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ class FrontendInputFile {
241241
/// Whether we're dealing with a 'system' input (vs. a 'user' input).
242242
bool IsSystem = false;
243243

244+
friend class CompilerInvocationBase;
245+
244246
public:
245247
FrontendInputFile() = default;
246248
FrontendInputFile(StringRef File, InputKind Kind, bool IsSystem = false)

0 commit comments

Comments
 (0)