Skip to content

Commit 9b92b1f

Browse files
committed
Merge branch 'main' into mlir_avoid-OpenMPIRBuilder.h
2 parents 783ed83 + 10d7352 commit 9b92b1f

File tree

56 files changed

+2028
-1887
lines changed

Some content is hidden

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

56 files changed

+2028
-1887
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/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/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/lib/Driver/ToolChains/ROCm.h renamed to clang/include/clang/Driver/RocmInstallationDetector.h

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
1-
//===--- ROCm.h - ROCm installation detector --------------------*- C++ -*-===//
1+
//===-- RocmInstallationDetector.h - ROCm Instalation Detector --*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ROCM_H
10-
#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ROCM_H
9+
#ifndef LLVM_CLANG_DRIVER_ROCMINSTALLATIONDETECTOR_H
10+
#define LLVM_CLANG_DRIVER_ROCMINSTALLATIONDETECTOR_H
1111

12-
#include "clang/Basic/Cuda.h"
13-
#include "clang/Basic/LLVM.h"
14-
#include "clang/Driver/CommonArgs.h"
1512
#include "clang/Driver/Driver.h"
16-
#include "clang/Driver/Options.h"
17-
#include "clang/Driver/SanitizerArgs.h"
18-
#include "llvm/ADT/SmallString.h"
19-
#include "llvm/ADT/StringMap.h"
20-
#include "llvm/Option/ArgList.h"
21-
#include "llvm/Support/VersionTuple.h"
22-
#include "llvm/TargetParser/TargetParser.h"
23-
#include "llvm/TargetParser/Triple.h"
2413

2514
namespace clang {
2615
namespace driver {
@@ -308,7 +297,7 @@ class RocmInstallationDetector {
308297
StringRef getHIPVersion() const { return DetectedVersion; }
309298
};
310299

311-
} // end namespace driver
312-
} // end namespace clang
300+
} // namespace driver
301+
} // namespace clang
313302

314-
#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ROCM_H
303+
#endif // LLVM_CLANG_DRIVER_ROCMINSTALLATIONDETECTOR_H
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//===-- SyclInstallationDetector.h - SYCL 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_SYCLINSTALLATIONDETECTOR_H
10+
#define LLVM_CLANG_DRIVER_SYCLINSTALLATIONDETECTOR_H
11+
12+
#include "clang/Driver/Driver.h"
13+
14+
namespace clang {
15+
namespace driver {
16+
17+
class SYCLInstallationDetector {
18+
public:
19+
SYCLInstallationDetector(const Driver &D, const llvm::Triple &HostTriple,
20+
const llvm::opt::ArgList &Args);
21+
22+
void addSYCLIncludeArgs(const llvm::opt::ArgList &DriverArgs,
23+
llvm::opt::ArgStringList &CC1Args) const;
24+
};
25+
26+
} // namespace driver
27+
} // namespace clang
28+
29+
#endif // LLVM_CLANG_DRIVER_SYCLINSTALLATIONDETECTOR_H

clang/lib/Driver/ToolChains/AMDGPU.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_AMDGPU_H
1111

1212
#include "Gnu.h"
13-
#include "ROCm.h"
1413
#include "clang/Basic/TargetID.h"
1514
#include "clang/Driver/Options.h"
1615
#include "clang/Driver/Tool.h"

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "Arch/SystemZ.h"
1717
#include "Hexagon.h"
1818
#include "PS4CPU.h"
19+
#include "ToolChains/Cuda.h"
1920
#include "clang/Basic/CLWarnings.h"
2021
#include "clang/Basic/CodeGenOptions.h"
2122
#include "clang/Basic/HeaderInclude.h"

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "Hexagon.h"
2424
#include "MSP430.h"
2525
#include "Solaris.h"
26+
#include "ToolChains/Cuda.h"
2627
#include "clang/Basic/CodeGenOptions.h"
2728
#include "clang/Config/config.h"
2829
#include "clang/Driver/Action.h"

0 commit comments

Comments
 (0)