Skip to content

Commit a7f55bd

Browse files
authored
Merge branch 'main' into dag-abd-valuetracking
2 parents abc561d + d575f80 commit a7f55bd

File tree

585 files changed

+12394
-9893
lines changed

Some content is hidden

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

585 files changed

+12394
-9893
lines changed

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "bolt/Core/MCPlusBuilder.h"
2323
#include "llvm/BinaryFormat/ELF.h"
2424
#include "llvm/MC/MCContext.h"
25-
#include "llvm/MC/MCFixupKindInfo.h"
2625
#include "llvm/MC/MCInstBuilder.h"
2726
#include "llvm/MC/MCInstrInfo.h"
2827
#include "llvm/MC/MCRegister.h"
@@ -2557,7 +2556,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
25572556
else if (Fixup.getKind() ==
25582557
MCFixupKind(AArch64::fixup_aarch64_pcrel_branch26))
25592558
RelType = ELF::R_AARCH64_JUMP26;
2560-
else if (FKI.Flags & MCFixupKindInfo::FKF_IsPCRel) {
2559+
else if (Fixup.isPCRel()) {
25612560
switch (FKI.TargetSize) {
25622561
default:
25632562
return std::nullopt;

bolt/lib/Target/X86/X86MCPlusBuilder.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "bolt/Core/MCPlusBuilder.h"
1919
#include "llvm/BinaryFormat/ELF.h"
2020
#include "llvm/MC/MCContext.h"
21-
#include "llvm/MC/MCFixupKindInfo.h"
2221
#include "llvm/MC/MCInst.h"
2322
#include "llvm/MC/MCInstBuilder.h"
2423
#include "llvm/MC/MCInstrInfo.h"
@@ -2444,7 +2443,7 @@ class X86MCPlusBuilder : public MCPlusBuilder {
24442443
const uint64_t RelOffset = Fixup.getOffset();
24452444

24462445
uint32_t RelType;
2447-
if (FKI.Flags & MCFixupKindInfo::FKF_IsPCRel) {
2446+
if (Fixup.isPCRel()) {
24482447
switch (FKI.TargetSize) {
24492448
default:
24502449
return std::nullopt;

clang-tools-extra/clangd/InlayHints.cpp

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include "llvm/ADT/StringExtras.h"
3434
#include "llvm/ADT/StringRef.h"
3535
#include "llvm/ADT/Twine.h"
36-
#include "llvm/ADT/identity.h"
3736
#include "llvm/Support/Casting.h"
3837
#include "llvm/Support/ErrorHandling.h"
3938
#include "llvm/Support/FormatVariadic.h"
@@ -339,53 +338,6 @@ QualType maybeDesugar(ASTContext &AST, QualType QT) {
339338
return QT;
340339
}
341340

342-
// Given a callee expression `Fn`, if the call is through a function pointer,
343-
// try to find the declaration of the corresponding function pointer type,
344-
// so that we can recover argument names from it.
345-
// FIXME: This function is mostly duplicated in SemaCodeComplete.cpp; unify.
346-
static FunctionProtoTypeLoc getPrototypeLoc(Expr *Fn) {
347-
TypeLoc Target;
348-
Expr *NakedFn = Fn->IgnoreParenCasts();
349-
if (const auto *T = NakedFn->getType().getTypePtr()->getAs<TypedefType>()) {
350-
Target = T->getDecl()->getTypeSourceInfo()->getTypeLoc();
351-
} else if (const auto *DR = dyn_cast<DeclRefExpr>(NakedFn)) {
352-
const auto *D = DR->getDecl();
353-
if (const auto *const VD = dyn_cast<VarDecl>(D)) {
354-
Target = VD->getTypeSourceInfo()->getTypeLoc();
355-
}
356-
}
357-
358-
if (!Target)
359-
return {};
360-
361-
// Unwrap types that may be wrapping the function type
362-
while (true) {
363-
if (auto P = Target.getAs<PointerTypeLoc>()) {
364-
Target = P.getPointeeLoc();
365-
continue;
366-
}
367-
if (auto A = Target.getAs<AttributedTypeLoc>()) {
368-
Target = A.getModifiedLoc();
369-
continue;
370-
}
371-
if (auto P = Target.getAs<ParenTypeLoc>()) {
372-
Target = P.getInnerLoc();
373-
continue;
374-
}
375-
break;
376-
}
377-
378-
if (auto F = Target.getAs<FunctionProtoTypeLoc>()) {
379-
// In some edge cases the AST can contain a "trivial" FunctionProtoTypeLoc
380-
// which has null parameters. Avoid these as they don't contain useful
381-
// information.
382-
if (llvm::all_of(F.getParams(), llvm::identity<ParmVarDecl *>()))
383-
return F;
384-
}
385-
386-
return {};
387-
}
388-
389341
ArrayRef<const ParmVarDecl *>
390342
maybeDropCxxExplicitObjectParameters(ArrayRef<const ParmVarDecl *> Params) {
391343
if (!Params.empty() && Params.front()->isExplicitObjectParameter())
@@ -514,7 +466,8 @@ class InlayHintVisitor : public RecursiveASTVisitor<InlayHintVisitor> {
514466
Callee.Decl = FD;
515467
else if (const auto *FTD = dyn_cast<FunctionTemplateDecl>(CalleeDecls[0]))
516468
Callee.Decl = FTD->getTemplatedDecl();
517-
else if (FunctionProtoTypeLoc Loc = getPrototypeLoc(E->getCallee()))
469+
else if (FunctionProtoTypeLoc Loc =
470+
Resolver->getFunctionProtoTypeLoc(E->getCallee()))
518471
Callee.Loc = Loc;
519472
else
520473
return true;

clang/docs/DebuggingCoroutines.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ suspension point.
221221
Line 45 of "llvm-example.cpp" starts at address 0x201b <_ZL9coro_taski.destroy+555> and ends at 0x2046 <_ZL9coro_taski.destroy+598>.
222222
Line 45 of "llvm-example.cpp" starts at address 0x253b <_ZL9coro_taski.cleanup+555> and ends at 0x2566 <_ZL9coro_taski.cleanup+598>.
223223

224-
LLDB does not support looking up labels. Furthmore, those labels are only emitted
224+
LLDB does not support looking up labels. Furthermore, those labels are only emitted
225225
starting with clang 21.0.
226226

227227
For simple cases, you might still be able to guess the suspension point correctly.

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,8 @@ Bug Fixes to C++ Support
899899
- Fixed a crash when constant evaluating some explicit object member assignment operators. (#GH142835)
900900
- Fixed an access checking bug when substituting into concepts (#GH115838)
901901
- Fix a bug where private access specifier of overloaded function not respected. (#GH107629)
902+
- Correctly handle allocations in the condition of a ``if constexpr``.(#GH120197) (#GH134820)
903+
- Fixed a crash when handling invalid member using-declaration in C++20+ mode. (#GH63254)
902904

903905
Bug Fixes to AST Handling
904906
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/ASTMatchers/ASTMatchers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6519,11 +6519,11 @@ AST_POLYMORPHIC_MATCHER(
65196519
/// Given
65206520
/// \code
65216521
/// void a(int);
6522-
/// void b(long);
6522+
/// void b(unsigned long);
65236523
/// void c(double);
65246524
/// \endcode
65256525
/// functionDecl(hasAnyParameter(hasType(isInteger())))
6526-
/// matches "a(int)", "b(long)", but not "c(double)".
6526+
/// matches "a(int)", "b(unsigned long)", but not "c(double)".
65276527
AST_MATCHER(QualType, isInteger) {
65286528
return Node->isIntegerType();
65296529
}

clang/include/clang/Basic/SourceManager.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,8 @@ class SourceManager : public RefCountedBase<SourceManager> {
767767
/// LastFileIDLookup records the last FileID looked up or created, because it
768768
/// is very common to look up many tokens from the same file.
769769
mutable FileID LastFileIDLookup;
770+
mutable SourceLocation::UIntTy LastLookupStartOffset;
771+
mutable SourceLocation::UIntTy LastLookupEndOffset; // exclude
770772

771773
/// Holds information for \#line directives.
772774
///
@@ -1901,9 +1903,8 @@ class SourceManager : public RefCountedBase<SourceManager> {
19011903

19021904
FileID getFileID(SourceLocation::UIntTy SLocOffset) const {
19031905
// If our one-entry cache covers this offset, just return it.
1904-
if (isOffsetInFileID(LastFileIDLookup, SLocOffset))
1906+
if (SLocOffset >= LastLookupStartOffset && SLocOffset < LastLookupEndOffset)
19051907
return LastFileIDLookup;
1906-
19071908
return getFileIDSlow(SLocOffset);
19081909
}
19091910

clang/include/clang/Driver/Options.td

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1138,6 +1138,10 @@ def fno_convergent_functions : Flag<["-"], "fno-convergent-functions">,
11381138

11391139
// Common offloading options
11401140
let Group = offload_Group in {
1141+
def offload_targets_EQ : CommaJoined<["--"], "offload-targets=">,
1142+
Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
1143+
HelpText<"Specify a list of target architectures to use for offloading.">;
1144+
11411145
def offload_arch_EQ : CommaJoined<["--"], "offload-arch=">,
11421146
Visibility<[ClangOption, FlangOption]>,
11431147
HelpText<"Specify an offloading device architecture for CUDA, HIP, or OpenMP. (e.g. sm_35). "
@@ -3681,7 +3685,7 @@ def fopenmp_use_tls : Flag<["-"], "fopenmp-use-tls">, Group<f_Group>,
36813685
Flags<[NoArgumentUnused, HelpHidden]>;
36823686
def fnoopenmp_use_tls : Flag<["-"], "fnoopenmp-use-tls">, Group<f_Group>,
36833687
Flags<[NoArgumentUnused, HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
3684-
def fopenmp_targets_EQ : CommaJoined<["-"], "fopenmp-targets=">,
3688+
def fopenmp_targets_EQ : CommaJoined<["-"], "fopenmp-targets=">, Alias<offload_targets_EQ>,
36853689
Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
36863690
HelpText<"Specify comma-separated list of triples OpenMP offloading targets to be supported">;
36873691
def fopenmp_relocatable_target : Flag<["-"], "fopenmp-relocatable-target">,

clang/include/clang/Parse/ParseHLSLRootSignature.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ namespace hlsl {
2727

2828
class RootSignatureParser {
2929
public:
30-
RootSignatureParser(SmallVector<llvm::hlsl::rootsig::RootElement> &Elements,
30+
RootSignatureParser(llvm::dxbc::RootSignatureVersion Version,
31+
SmallVector<llvm::hlsl::rootsig::RootElement> &Elements,
3132
RootSignatureLexer &Lexer, clang::Preprocessor &PP);
3233

3334
/// Consumes tokens from the Lexer and constructs the in-memory
@@ -187,6 +188,7 @@ class RootSignatureParser {
187188
bool tryConsumeExpectedToken(ArrayRef<RootSignatureToken::Kind> Expected);
188189

189190
private:
191+
llvm::dxbc::RootSignatureVersion Version;
190192
SmallVector<llvm::hlsl::rootsig::RootElement> &Elements;
191193
RootSignatureLexer &Lexer;
192194

clang/include/clang/Sema/HeuristicResolver.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class CXXBasePath;
2020
class CXXDependentScopeMemberExpr;
2121
class DeclarationName;
2222
class DependentScopeDeclRefExpr;
23+
class FunctionProtoTypeLoc;
2324
class NamedDecl;
2425
class Type;
2526
class UnresolvedUsingValueDecl;
@@ -93,6 +94,12 @@ class HeuristicResolver {
9394
// during simplification, and the operation fails if no pointer type is found.
9495
QualType simplifyType(QualType Type, const Expr *E, bool UnwrapPointer);
9596

97+
// Given an expression `Fn` representing the callee in a function call,
98+
// if the call is through a function pointer, try to find the declaration of
99+
// the corresponding function pointer type, so that we can recover argument
100+
// names from it.
101+
FunctionProtoTypeLoc getFunctionProtoTypeLoc(const Expr *Fn) const;
102+
96103
private:
97104
ASTContext &Ctx;
98105
};

0 commit comments

Comments
 (0)