Skip to content

Commit 9f88520

Browse files
committed
Merge remote-tracking branch 'llvm_be_very_careful/main' into corentin/use_normalization_for_satisfaction
2 parents d283646 + a7016c4 commit 9f88520

File tree

371 files changed

+14527
-2869
lines changed

Some content is hidden

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

371 files changed

+14527
-2869
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
BasedOnStyle: LLVM
2+
LineEnding: LF

clang-tools-extra/clang-include-fixer/IncludeFixer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ bool IncludeFixerActionFactory::runInvocation(
9696
// diagnostics here.
9797
Compiler.createDiagnostics(new clang::IgnoringDiagConsumer,
9898
/*ShouldOwnClient=*/true);
99-
Compiler.createSourceManager(*Files);
99+
Compiler.createSourceManager();
100100

101101
// We abort on fatal errors so don't let a large number of errors become
102102
// fatal. A missing #include can cause thousands of errors.

clang-tools-extra/include-cleaner/unittests/RecordTest.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -649,11 +649,12 @@ TEST_F(PragmaIncludeTest, ExportInUnnamedBuffer) {
649649
Clang->createVirtualFileSystem(VFS);
650650
Clang->createDiagnostics();
651651

652-
auto *FM = Clang->createFileManager();
652+
Clang->createFileManager();
653+
FileManager &FM = Clang->getFileManager();
653654
ASSERT_TRUE(Clang->ExecuteAction(*Inputs.MakeAction()));
654655
EXPECT_THAT(
655-
PI.getExporters(llvm::cantFail(FM->getFileRef("foo.h")), *FM),
656-
testing::ElementsAre(llvm::cantFail(FM->getFileRef("exporter.h"))));
656+
PI.getExporters(llvm::cantFail(FM.getFileRef("foo.h")), FM),
657+
testing::ElementsAre(llvm::cantFail(FM.getFileRef("exporter.h"))));
657658
}
658659

659660
TEST_F(PragmaIncludeTest, OutlivesFMAndSM) {

clang/.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
BasedOnStyle: LLVM
2+
LineEnding: LF

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,6 @@ Non-comprehensive list of changes in this release
250250

251251
- ``__builtin_assume_dereferenceable`` now accepts non-constant size operands.
252252

253-
- Fixed a crash when the second argument to ``__builtin_assume_aligned`` was not constant (#GH161314)
254-
255253
New Compiler Flags
256254
------------------
257255
- New option ``-fno-sanitize-debug-trap-reasons`` added to disable emitting trap reasons into the debug info when compiling with trapping UBSan (e.g. ``-fsanitize-trap=undefined``).
@@ -441,6 +439,7 @@ Bug Fixes to C++ Support
441439
- Fix the result of `__builtin_is_implicit_lifetime` for types with a user-provided constructor. (#GH160610)
442440
- Correctly deduce return types in ``decltype`` expressions. (#GH160497) (#GH56652) (#GH116319) (#GH161196)
443441
- Fixed a crash in the pre-C++23 warning for attributes before a lambda declarator (#GH161070).
442+
- Fix a crash when attempting to deduce a deduction guide from a non deducible template template parameter. (#130604)
444443

445444
Bug Fixes to AST Handling
446445
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -449,6 +448,7 @@ Bug Fixes to AST Handling
449448
legal representation. This is fixed because ElaboratedTypes don't exist anymore. (#GH43179) (#GH68670) (#GH92757)
450449
- Fix unrecognized html tag causing undesirable comment lexing (#GH152944)
451450
- Fix comment lexing of special command names (#GH152943)
451+
- Use `extern` as a hint to continue parsing when recovering from a malformed declaration.
452452

453453
Miscellaneous Bug Fixes
454454
^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/AST/OpenACCClause.h

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -840,14 +840,13 @@ class OpenACCClauseWithVarList : public OpenACCClauseWithExprs {
840840
// alloca at the level of the base, and the init at the element level.
841841
struct OpenACCPrivateRecipe {
842842
VarDecl *AllocaDecl;
843-
Expr *InitExpr;
844843

845-
OpenACCPrivateRecipe(VarDecl *A, Expr *I) : AllocaDecl(A), InitExpr(I) {}
844+
OpenACCPrivateRecipe(VarDecl *A) : AllocaDecl(A) {}
846845

847846
bool isSet() const { return AllocaDecl; }
848847

849848
static OpenACCPrivateRecipe Empty() {
850-
return OpenACCPrivateRecipe(nullptr, nullptr);
849+
return OpenACCPrivateRecipe(/*AllocaDecl=*/nullptr);
851850
}
852851
};
853852

@@ -899,18 +898,17 @@ class OpenACCPrivateClause final
899898
// InitFromTemporary is the 'temp' declaration we put in to be 'copied from'.
900899
struct OpenACCFirstPrivateRecipe {
901900
VarDecl *AllocaDecl;
902-
Expr *InitExpr;
903901
VarDecl *InitFromTemporary;
904-
OpenACCFirstPrivateRecipe(VarDecl *A, Expr *I, VarDecl *T)
905-
: AllocaDecl(A), InitExpr(I), InitFromTemporary(T) {
906-
assert(!AllocaDecl || AllocaDecl->getInit() == nullptr);
902+
OpenACCFirstPrivateRecipe(VarDecl *A, VarDecl *T)
903+
: AllocaDecl(A), InitFromTemporary(T) {
907904
assert(!InitFromTemporary || InitFromTemporary->getInit() == nullptr);
908905
}
909906

910907
bool isSet() const { return AllocaDecl; }
911908

912909
static OpenACCFirstPrivateRecipe Empty() {
913-
return OpenACCFirstPrivateRecipe(nullptr, nullptr, nullptr);
910+
return OpenACCFirstPrivateRecipe(/*AllocaDecl=*/nullptr,
911+
/*InitFromTemporary=*/nullptr);
914912
}
915913
};
916914

@@ -1282,16 +1280,13 @@ class OpenACCCreateClause final
12821280
// 'main' declaration used for initializaiton, which is fixed.
12831281
struct OpenACCReductionRecipe {
12841282
VarDecl *AllocaDecl;
1285-
Expr *InitExpr;
12861283
// TODO: OpenACC: this should eventually have the operations here too.
12871284

1288-
OpenACCReductionRecipe(VarDecl *A, Expr *I) : AllocaDecl(A), InitExpr(I) {
1289-
assert(!AllocaDecl || AllocaDecl->getInit() == nullptr);
1290-
}
1285+
OpenACCReductionRecipe(VarDecl *A) : AllocaDecl(A) {}
12911286

12921287
bool isSet() const { return AllocaDecl; }
12931288
static OpenACCReductionRecipe Empty() {
1294-
return OpenACCReductionRecipe(nullptr, nullptr);
1289+
return OpenACCReductionRecipe(/*AllocaDecl=*/nullptr);
12951290
}
12961291
};
12971292

clang/include/clang/AST/TypeBase.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6702,15 +6702,21 @@ class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode {
67026702
LLVM_PREFERRED_TYPE(bool)
67036703
uint8_t RawBuffer : 1;
67046704

6705+
LLVM_PREFERRED_TYPE(bool)
6706+
uint8_t IsCounter : 1;
6707+
67056708
Attributes(llvm::dxil::ResourceClass ResourceClass, bool IsROV = false,
6706-
bool RawBuffer = false)
6707-
: ResourceClass(ResourceClass), IsROV(IsROV), RawBuffer(RawBuffer) {}
6709+
bool RawBuffer = false, bool IsCounter = false)
6710+
: ResourceClass(ResourceClass), IsROV(IsROV), RawBuffer(RawBuffer),
6711+
IsCounter(IsCounter) {}
67086712

6709-
Attributes() : Attributes(llvm::dxil::ResourceClass::UAV, false, false) {}
6713+
Attributes()
6714+
: Attributes(llvm::dxil::ResourceClass::UAV, false, false, false) {}
67106715

67116716
friend bool operator==(const Attributes &LHS, const Attributes &RHS) {
6712-
return std::tie(LHS.ResourceClass, LHS.IsROV, LHS.RawBuffer) ==
6713-
std::tie(RHS.ResourceClass, RHS.IsROV, RHS.RawBuffer);
6717+
return std::tie(LHS.ResourceClass, LHS.IsROV, LHS.RawBuffer,
6718+
LHS.IsCounter) == std::tie(RHS.ResourceClass, RHS.IsROV,
6719+
RHS.RawBuffer, RHS.IsCounter);
67146720
}
67156721
friend bool operator!=(const Attributes &LHS, const Attributes &RHS) {
67166722
return !(LHS == RHS);
@@ -6751,6 +6757,7 @@ class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode {
67516757
ID.AddInteger(static_cast<uint32_t>(Attrs.ResourceClass));
67526758
ID.AddBoolean(Attrs.IsROV);
67536759
ID.AddBoolean(Attrs.RawBuffer);
6760+
ID.AddBoolean(Attrs.IsCounter);
67546761
}
67556762

67566763
static bool classof(const Type *T) {

clang/include/clang/AST/TypeProperties.td

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,14 +662,17 @@ let Class = HLSLAttributedResourceType in {
662662
def : Property<"rawBuffer", Bool> {
663663
let Read = [{ node->getAttrs().RawBuffer }];
664664
}
665+
def : Property<"isCounter", Bool> {
666+
let Read = [{ node->getAttrs().IsCounter }];
667+
}
665668
def : Property<"wrappedTy", QualType> {
666669
let Read = [{ node->getWrappedType() }];
667670
}
668671
def : Property<"containedTy", QualType> {
669672
let Read = [{ node->getContainedType() }];
670673
}
671674
def : Creator<[{
672-
HLSLAttributedResourceType::Attributes attrs(static_cast<llvm::dxil::ResourceClass>(resClass), isROV, rawBuffer);
675+
HLSLAttributedResourceType::Attributes attrs(static_cast<llvm::dxil::ResourceClass>(resClass), isROV, rawBuffer, isCounter);
673676
return ctx.getHLSLAttributedResourceType(wrappedTy, containedTy, attrs);
674677
}]>;
675678
}

clang/include/clang/Analysis/CFG.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,7 @@ class CFG {
12511251
bool MarkElidedCXXConstructors = false;
12521252
bool AddVirtualBaseBranches = false;
12531253
bool OmitImplicitValueInitializers = false;
1254+
bool AssumeReachableDefaultInSwitchStatements = false;
12541255

12551256
BuildOptions() = default;
12561257

clang/include/clang/Basic/Attr.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5074,6 +5074,12 @@ def HLSLRawBuffer : TypeAttr {
50745074
let Documentation = [InternalOnly];
50755075
}
50765076

5077+
def HLSLIsCounter : TypeAttr {
5078+
let Spellings = [CXX11<"hlsl", "is_counter">];
5079+
let LangOpts = [HLSL];
5080+
let Documentation = [InternalOnly];
5081+
}
5082+
50775083
def HLSLGroupSharedAddressSpace : TypeAttr {
50785084
let Spellings = [CustomKeyword<"groupshared">];
50795085
let Subjects = SubjectList<[Var]>;

0 commit comments

Comments
 (0)