Skip to content

Commit 957b617

Browse files
authored
Merge branch 'main' into bundle-break-phyreg-liveness
2 parents fb35271 + a8d0ae3 commit 957b617

File tree

674 files changed

+29115
-16987
lines changed

Some content is hidden

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

674 files changed

+29115
-16987
lines changed

bolt/lib/Core/Relocation.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,15 +1018,15 @@ void Relocation::print(raw_ostream &OS) const {
10181018
OS << "RType:" << Twine::utohexstr(Type);
10191019
break;
10201020

1021-
case Triple::aarch64:
1021+
case Triple::aarch64: {
10221022
static const char *const AArch64RelocNames[] = {
10231023
#define ELF_RELOC(name, value) #name,
10241024
#include "llvm/BinaryFormat/ELFRelocs/AArch64.def"
10251025
#undef ELF_RELOC
10261026
};
10271027
assert(Type < ArrayRef(AArch64RelocNames).size());
10281028
OS << AArch64RelocNames[Type];
1029-
break;
1029+
} break;
10301030

10311031
case Triple::riscv64:
10321032
// RISC-V relocations are not sequentially numbered so we cannot use an
@@ -1043,15 +1043,15 @@ void Relocation::print(raw_ostream &OS) const {
10431043
}
10441044
break;
10451045

1046-
case Triple::x86_64:
1046+
case Triple::x86_64: {
10471047
static const char *const X86RelocNames[] = {
10481048
#define ELF_RELOC(name, value) #name,
10491049
#include "llvm/BinaryFormat/ELFRelocs/x86_64.def"
10501050
#undef ELF_RELOC
10511051
};
10521052
assert(Type < ArrayRef(X86RelocNames).size());
10531053
OS << X86RelocNames[Type];
1054-
break;
1054+
} break;
10551055
}
10561056
OS << ", 0x" << Twine::utohexstr(Offset);
10571057
if (Symbol) {

clang-tools-extra/clangd/FindSymbols.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "SourceCode.h"
1515
#include "index/Index.h"
1616
#include "support/Logger.h"
17+
#include "clang/AST/DeclFriend.h"
1718
#include "clang/AST/DeclTemplate.h"
1819
#include "clang/Index/IndexSymbol.h"
1920
#include "llvm/ADT/ArrayRef.h"
@@ -391,6 +392,17 @@ class DocumentOutline {
391392
D = TD;
392393
}
393394

395+
// FriendDecls don't act as DeclContexts, but they might wrap a function
396+
// definition that won't be visible through other means in the AST. Hence
397+
// unwrap it here instead.
398+
if (auto *Friend = llvm::dyn_cast<FriendDecl>(D)) {
399+
if (auto *Func =
400+
llvm::dyn_cast_or_null<FunctionDecl>(Friend->getFriendDecl())) {
401+
if (Func->isThisDeclarationADefinition())
402+
D = Func;
403+
}
404+
}
405+
394406
VisitKind Visit = shouldVisit(D);
395407
if (Visit == VisitKind::No)
396408
return;

clang-tools-extra/clangd/unittests/FindSymbolsTests.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ TEST(DocumentSymbols, BasicSymbols) {
335335
Foo(int a) {}
336336
void $decl[[f]]();
337337
friend void f1();
338+
friend void f2() {}
338339
friend class Friend;
339340
Foo& operator=(const Foo&);
340341
~Foo();
@@ -346,7 +347,7 @@ TEST(DocumentSymbols, BasicSymbols) {
346347
};
347348
348349
void f1();
349-
inline void f2() {}
350+
void f2();
350351
static const int KInt = 2;
351352
const char* kStr = "123";
352353
@@ -386,6 +387,8 @@ TEST(DocumentSymbols, BasicSymbols) {
386387
withDetail("(int)"), children()),
387388
AllOf(withName("f"), withKind(SymbolKind::Method),
388389
withDetail("void ()"), children()),
390+
AllOf(withName("f2"), withKind(SymbolKind::Function),
391+
withDetail("void ()"), children()),
389392
AllOf(withName("operator="), withKind(SymbolKind::Method),
390393
withDetail("Foo &(const Foo &)"), children()),
391394
AllOf(withName("~Foo"), withKind(SymbolKind::Constructor),

clang/include/clang/AST/ASTContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1818,7 +1818,7 @@ class ASTContext : public RefCountedBase<ASTContext> {
18181818
NumPositiveBits = std::max({NumPositiveBits, ActiveBits, 1u});
18191819
} else {
18201820
NumNegativeBits =
1821-
std::max(NumNegativeBits, (unsigned)InitVal.getSignificantBits());
1821+
std::max(NumNegativeBits, InitVal.getSignificantBits());
18221822
}
18231823

18241824
MembersRepresentableByInt &= isRepresentableIntegerValue(InitVal, IntTy);

clang/include/clang/AST/Expr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "clang/AST/APNumericStorage.h"
1717
#include "clang/AST/APValue.h"
1818
#include "clang/AST/ASTVector.h"
19-
#include "clang/AST/Attr.h"
2019
#include "clang/AST/ComputeDependence.h"
2120
#include "clang/AST/Decl.h"
2221
#include "clang/AST/DeclAccessPair.h"
@@ -58,6 +57,7 @@ namespace clang {
5857
class StringLiteral;
5958
class TargetInfo;
6059
class ValueDecl;
60+
class WarnUnusedResultAttr;
6161

6262
/// A simple array of base specifiers.
6363
typedef SmallVector<CXXBaseSpecifier*, 4> CXXCastPath;

clang/include/clang/Basic/BuiltinsAMDGPU.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ TARGET_BUILTIN(__builtin_amdgcn_exp2_bf16, "yy", "nc", "bf16-trans-insts")
697697
TARGET_BUILTIN(__builtin_amdgcn_sin_bf16, "yy", "nc", "bf16-trans-insts")
698698
TARGET_BUILTIN(__builtin_amdgcn_cos_bf16, "yy", "nc", "bf16-trans-insts")
699699

700+
TARGET_BUILTIN(__builtin_amdgcn_cvt_sr_pk_bf16_f32, "V2yffi", "nc", "bf16-cvt-insts")
700701
TARGET_BUILTIN(__builtin_amdgcn_cvt_f16_fp8, "hiIi", "nc", "gfx1250-insts")
701702
TARGET_BUILTIN(__builtin_amdgcn_cvt_f16_bf8, "hiIi", "nc", "gfx1250-insts")
702703
TARGET_BUILTIN(__builtin_amdgcn_cvt_pk_f16_fp8, "V2hs", "nc", "gfx1250-insts")

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,10 +1812,7 @@ def note_unsatisfied_trait_reason
18121812
"%DeletedAssign{has a deleted %select{copy|move}1 "
18131813
"assignment operator}|"
18141814
"%UnionWithUserDeclaredSMF{is a union with a user-declared "
1815-
"%sub{select_special_member_kind}1}|"
1816-
"%FunctionType{is a function type}|"
1817-
"%CVVoidType{is a cv void type}|"
1818-
"%IncompleteArrayType{is an incomplete array type}"
1815+
"%sub{select_special_member_kind}1}"
18191816
"}0">;
18201817

18211818
def warn_consteval_if_always_true : Warning<
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
//===-- CudaInstallationDetector.h - Cuda Instalation Detector --*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_CLANG_DRIVER_CUDAINSTALLATIONDETECTOR_H
10+
#define LLVM_CLANG_DRIVER_CUDAINSTALLATIONDETECTOR_H
11+
12+
#include "clang/Basic/Cuda.h"
13+
#include "clang/Driver/Driver.h"
14+
#include <bitset>
15+
16+
namespace clang {
17+
namespace driver {
18+
19+
/// A class to find a viable CUDA installation
20+
class CudaInstallationDetector {
21+
private:
22+
const Driver &D;
23+
bool IsValid = false;
24+
CudaVersion Version = CudaVersion::UNKNOWN;
25+
std::string InstallPath;
26+
std::string BinPath;
27+
std::string LibDevicePath;
28+
std::string IncludePath;
29+
llvm::StringMap<std::string> LibDeviceMap;
30+
31+
// CUDA architectures for which we have raised an error in
32+
// CheckCudaVersionSupportsArch.
33+
mutable std::bitset<(int)OffloadArch::LAST> ArchsWithBadVersion;
34+
35+
public:
36+
CudaInstallationDetector(const Driver &D, const llvm::Triple &HostTriple,
37+
const llvm::opt::ArgList &Args);
38+
39+
void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs,
40+
llvm::opt::ArgStringList &CC1Args) const;
41+
42+
/// Emit an error if Version does not support the given Arch.
43+
///
44+
/// If either Version or Arch is unknown, does not emit an error. Emits at
45+
/// most one error per Arch.
46+
void CheckCudaVersionSupportsArch(OffloadArch Arch) const;
47+
48+
/// Check whether we detected a valid Cuda install.
49+
bool isValid() const { return IsValid; }
50+
/// Print information about the detected CUDA installation.
51+
void print(raw_ostream &OS) const;
52+
53+
/// Get the detected Cuda install's version.
54+
CudaVersion version() const {
55+
return Version == CudaVersion::NEW ? CudaVersion::PARTIALLY_SUPPORTED
56+
: Version;
57+
}
58+
/// Get the detected Cuda installation path.
59+
StringRef getInstallPath() const { return InstallPath; }
60+
/// Get the detected path to Cuda's bin directory.
61+
StringRef getBinPath() const { return BinPath; }
62+
/// Get the detected Cuda Include path.
63+
StringRef getIncludePath() const { return IncludePath; }
64+
/// Get the detected Cuda device library path.
65+
StringRef getLibDevicePath() const { return LibDevicePath; }
66+
/// Get libdevice file for given architecture
67+
std::string getLibDeviceFile(StringRef Gpu) const {
68+
return LibDeviceMap.lookup(Gpu);
69+
}
70+
void WarnIfUnsupportedVersion() const;
71+
};
72+
73+
} // namespace driver
74+
} // namespace clang
75+
76+
#endif // LLVM_CLANG_DRIVER_CUDAINSTALLATIONDETECTOR_H

clang/lib/Driver/ToolChains/LazyDetector.h renamed to clang/include/clang/Driver/LazyDetector.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_LAZYDETECTOR_H
10-
#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_LAZYDETECTOR_H
9+
#ifndef LLVM_CLANG_DRIVER_LAZYDETECTOR_H
10+
#define LLVM_CLANG_DRIVER_LAZYDETECTOR_H
1111

1212
#include "clang/Driver/Tool.h"
1313
#include "clang/Driver/ToolChain.h"
@@ -42,4 +42,4 @@ template <class T> class LazyDetector {
4242

4343
} // end namespace clang
4444

45-
#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_LAZYDETECTOR_H
45+
#endif // LLVM_CLANG_DRIVER_LAZYDETECTOR_H

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5312,6 +5312,8 @@ def mextended_const : Flag<["-"], "mextended-const">, Group<m_wasm_Features_Grou
53125312
def mno_extended_const : Flag<["-"], "mno-extended-const">, Group<m_wasm_Features_Group>;
53135313
def mfp16 : Flag<["-"], "mfp16">, Group<m_wasm_Features_Group>;
53145314
def mno_fp16 : Flag<["-"], "mno-fp16">, Group<m_wasm_Features_Group>;
5315+
def mgc : Flag<["-"], "mgc">, Group<m_wasm_Features_Group>;
5316+
def mno_gc : Flag<["-"], "mno-gc">, Group<m_wasm_Features_Group>;
53155317
def mmultimemory : Flag<["-"], "mmultimemory">, Group<m_wasm_Features_Group>;
53165318
def mno_multimemory : Flag<["-"], "mno-multimemory">, Group<m_wasm_Features_Group>;
53175319
def mmultivalue : Flag<["-"], "mmultivalue">, Group<m_wasm_Features_Group>;

0 commit comments

Comments
 (0)