Skip to content

Commit 026b433

Browse files
committed
Merge from '"main"' to '"sycl-web"' (1 commits)
CONFLICT (content): Merge conflict in clang/test/CodeGenSYCL/address-space-deduction.cpp
2 parents 2a1040d + 393581d commit 026b433

File tree

389 files changed

+10416
-4594
lines changed

Some content is hidden

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

389 files changed

+10416
-4594
lines changed

clang/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ if (CLANG_ENABLE_BOOTSTRAP)
642642
# adding lld to clang-bootstrap-deps without having it enabled in
643643
# LLVM_ENABLE_PROJECTS just generates a cryptic error message.
644644
if (NOT "lld" IN_LIST LLVM_ENABLE_PROJECTS)
645-
message(FATAL_ERROR "LLD is enabled in the boostrap build, but lld is not in LLVM_ENABLE_PROJECTS")
645+
message(FATAL_ERROR "LLD is enabled in the bootstrap build, but lld is not in LLVM_ENABLE_PROJECTS")
646646
endif()
647647
add_dependencies(clang-bootstrap-deps lld)
648648
endif()

clang/cmake/caches/Fuchsia-stage2.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ foreach(target aarch64-unknown-linux-gnu;armv7-unknown-linux-gnueabihf;i386-unkn
136136
set(RUNTIMES_${target}_SANITIZER_CXX_ABI_INTREE ON CACHE BOOL "")
137137
set(RUNTIMES_${target}_COMPILER_RT_TEST_COMPILER_CFLAGS "--unwindlib=libunwind -static-libgcc" CACHE STRING "")
138138
set(RUNTIMES_${target}_SANITIZER_COMMON_TEST_TARGET_CFLAGS "--unwindlib=libunwind -static-libgcc" CACHE STRING "")
139-
set(RUNTIMES_${target}_TSAN_TEST_TARGET_CFLAGS "--unwindlib=libunwind" CACHE STRING "")
139+
set(RUNTIMES_${target}_TSAN_TEST_TARGET_CFLAGS "--unwindlib=libunwind -static-libgcc" CACHE STRING "")
140140
set(RUNTIMES_${target}_LLVM_TOOLS_DIR "${CMAKE_BINARY_DIR}/bin" CACHE BOOL "")
141141
set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
142142

clang/include/clang/AST/Attr.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,7 @@ struct ParsedTargetAttr {
375375

376376
inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
377377
const Attr *At) {
378-
DB.AddTaggedVal(reinterpret_cast<intptr_t>(At),
379-
DiagnosticsEngine::ak_attr);
378+
DB.AddTaggedVal(reinterpret_cast<uint64_t>(At), DiagnosticsEngine::ak_attr);
380379
return DB;
381380
}
382381
} // end namespace clang

clang/include/clang/AST/Decl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4590,7 +4590,7 @@ class EmptyDecl : public Decl {
45904590
/// into a diagnostic with <<.
45914591
inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &PD,
45924592
const NamedDecl *ND) {
4593-
PD.AddTaggedVal(reinterpret_cast<intptr_t>(ND),
4593+
PD.AddTaggedVal(reinterpret_cast<uint64_t>(ND),
45944594
DiagnosticsEngine::ak_nameddecl);
45954595
return PD;
45964596
}

clang/include/clang/AST/NestedNameSpecifier.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ class NestedNameSpecifierLocBuilder {
521521
/// NestedNameSpecifiers into a diagnostic with <<.
522522
inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
523523
NestedNameSpecifier *NNS) {
524-
DB.AddTaggedVal(reinterpret_cast<intptr_t>(NNS),
524+
DB.AddTaggedVal(reinterpret_cast<uint64_t>(NNS),
525525
DiagnosticsEngine::ak_nestednamespec);
526526
return DB;
527527
}

clang/include/clang/AST/StmtOpenMP.h

Lines changed: 61 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -889,22 +889,23 @@ class OMPLoopBasedDirective : public OMPExecutableDirective {
889889

890890
/// Calls the specified callback function for all the loops in \p CurStmt,
891891
/// from the outermost to the innermost.
892-
static bool doForAllLoops(Stmt *CurStmt, bool TryImperfectlyNestedLoops,
893-
unsigned NumLoops,
894-
llvm::function_ref<bool(unsigned, Stmt *)> Callback,
895-
llvm::function_ref<void(OMPLoopBasedDirective *)>
896-
OnTransformationCallback);
892+
static bool
893+
doForAllLoops(Stmt *CurStmt, bool TryImperfectlyNestedLoops,
894+
unsigned NumLoops,
895+
llvm::function_ref<bool(unsigned, Stmt *)> Callback,
896+
llvm::function_ref<void(OMPLoopTransformationDirective *)>
897+
OnTransformationCallback);
897898
static bool
898899
doForAllLoops(const Stmt *CurStmt, bool TryImperfectlyNestedLoops,
899900
unsigned NumLoops,
900901
llvm::function_ref<bool(unsigned, const Stmt *)> Callback,
901-
llvm::function_ref<void(const OMPLoopBasedDirective *)>
902+
llvm::function_ref<void(const OMPLoopTransformationDirective *)>
902903
OnTransformationCallback) {
903904
auto &&NewCallback = [Callback](unsigned Cnt, Stmt *CurStmt) {
904905
return Callback(Cnt, CurStmt);
905906
};
906907
auto &&NewTransformCb =
907-
[OnTransformationCallback](OMPLoopBasedDirective *A) {
908+
[OnTransformationCallback](OMPLoopTransformationDirective *A) {
908909
OnTransformationCallback(A);
909910
};
910911
return doForAllLoops(const_cast<Stmt *>(CurStmt), TryImperfectlyNestedLoops,
@@ -917,7 +918,7 @@ class OMPLoopBasedDirective : public OMPExecutableDirective {
917918
doForAllLoops(Stmt *CurStmt, bool TryImperfectlyNestedLoops,
918919
unsigned NumLoops,
919920
llvm::function_ref<bool(unsigned, Stmt *)> Callback) {
920-
auto &&TransformCb = [](OMPLoopBasedDirective *) {};
921+
auto &&TransformCb = [](OMPLoopTransformationDirective *) {};
921922
return doForAllLoops(CurStmt, TryImperfectlyNestedLoops, NumLoops, Callback,
922923
TransformCb);
923924
}
@@ -954,6 +955,47 @@ class OMPLoopBasedDirective : public OMPExecutableDirective {
954955
}
955956
};
956957

958+
/// The base class for all loop transformation directives.
959+
class OMPLoopTransformationDirective : public OMPLoopBasedDirective {
960+
friend class ASTStmtReader;
961+
962+
/// Number of loops generated by this loop transformation.
963+
unsigned NumGeneratedLoops = 0;
964+
965+
protected:
966+
explicit OMPLoopTransformationDirective(StmtClass SC,
967+
OpenMPDirectiveKind Kind,
968+
SourceLocation StartLoc,
969+
SourceLocation EndLoc,
970+
unsigned NumAssociatedLoops)
971+
: OMPLoopBasedDirective(SC, Kind, StartLoc, EndLoc, NumAssociatedLoops) {}
972+
973+
/// Set the number of loops generated by this loop transformation.
974+
void setNumGeneratedLoops(unsigned Num) { NumGeneratedLoops = Num; }
975+
976+
public:
977+
/// Return the number of associated (consumed) loops.
978+
unsigned getNumAssociatedLoops() const { return getLoopsNumber(); }
979+
980+
/// Return the number of loops generated by this loop transformation.
981+
unsigned getNumGeneratedLoops() { return NumGeneratedLoops; }
982+
983+
/// Get the de-sugared statements after after the loop transformation.
984+
///
985+
/// Might be nullptr if either the directive generates no loops and is handled
986+
/// directly in CodeGen, or resolving a template-dependence context is
987+
/// required.
988+
Stmt *getTransformedStmt() const;
989+
990+
/// Return preinits statement.
991+
Stmt *getPreInits() const;
992+
993+
static bool classof(const Stmt *T) {
994+
return T->getStmtClass() == OMPTileDirectiveClass ||
995+
T->getStmtClass() == OMPUnrollDirectiveClass;
996+
}
997+
};
998+
957999
/// This is a common base class for loop directives ('omp simd', 'omp
9581000
/// for', 'omp for simd' etc.). It is responsible for the loop code generation.
9591001
///
@@ -5011,7 +5053,7 @@ class OMPTargetTeamsDistributeSimdDirective final : public OMPLoopDirective {
50115053
};
50125054

50135055
/// This represents the '#pragma omp tile' loop transformation directive.
5014-
class OMPTileDirective final : public OMPLoopBasedDirective {
5056+
class OMPTileDirective final : public OMPLoopTransformationDirective {
50155057
friend class ASTStmtReader;
50165058
friend class OMPExecutableDirective;
50175059

@@ -5023,8 +5065,11 @@ class OMPTileDirective final : public OMPLoopBasedDirective {
50235065

50245066
explicit OMPTileDirective(SourceLocation StartLoc, SourceLocation EndLoc,
50255067
unsigned NumLoops)
5026-
: OMPLoopBasedDirective(OMPTileDirectiveClass, llvm::omp::OMPD_tile,
5027-
StartLoc, EndLoc, NumLoops) {}
5068+
: OMPLoopTransformationDirective(OMPTileDirectiveClass,
5069+
llvm::omp::OMPD_tile, StartLoc, EndLoc,
5070+
NumLoops) {
5071+
setNumGeneratedLoops(3 * NumLoops);
5072+
}
50285073

50295074
void setPreInits(Stmt *PreInits) {
50305075
Data->getChildren()[PreInitsOffset] = PreInits;
@@ -5061,8 +5106,6 @@ class OMPTileDirective final : public OMPLoopBasedDirective {
50615106
static OMPTileDirective *CreateEmpty(const ASTContext &C, unsigned NumClauses,
50625107
unsigned NumLoops);
50635108

5064-
unsigned getNumAssociatedLoops() const { return getLoopsNumber(); }
5065-
50665109
/// Gets/sets the associated loops after tiling.
50675110
///
50685111
/// This is in de-sugared format stored as a CompoundStmt.
@@ -5092,7 +5135,7 @@ class OMPTileDirective final : public OMPLoopBasedDirective {
50925135
/// #pragma omp unroll
50935136
/// for (int i = 0; i < 64; ++i)
50945137
/// \endcode
5095-
class OMPUnrollDirective final : public OMPLoopBasedDirective {
5138+
class OMPUnrollDirective final : public OMPLoopTransformationDirective {
50965139
friend class ASTStmtReader;
50975140
friend class OMPExecutableDirective;
50985141

@@ -5103,8 +5146,9 @@ class OMPUnrollDirective final : public OMPLoopBasedDirective {
51035146
};
51045147

51055148
explicit OMPUnrollDirective(SourceLocation StartLoc, SourceLocation EndLoc)
5106-
: OMPLoopBasedDirective(OMPUnrollDirectiveClass, llvm::omp::OMPD_unroll,
5107-
StartLoc, EndLoc, 1) {}
5149+
: OMPLoopTransformationDirective(OMPUnrollDirectiveClass,
5150+
llvm::omp::OMPD_unroll, StartLoc, EndLoc,
5151+
1) {}
51085152

51095153
/// Set the pre-init statements.
51105154
void setPreInits(Stmt *PreInits) {
@@ -5130,7 +5174,7 @@ class OMPUnrollDirective final : public OMPLoopBasedDirective {
51305174
static OMPUnrollDirective *
51315175
Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
51325176
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
5133-
Stmt *TransformedStmt, Stmt *PreInits);
5177+
unsigned NumGeneratedLoops, Stmt *TransformedStmt, Stmt *PreInits);
51345178

51355179
/// Build an empty '#pragma omp unroll' AST node for deserialization.
51365180
///

clang/include/clang/AST/Type.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7174,7 +7174,7 @@ inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &PD,
71747174
/// into a diagnostic with <<.
71757175
inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &PD,
71767176
QualType T) {
7177-
PD.AddTaggedVal(reinterpret_cast<intptr_t>(T.getAsOpaquePtr()),
7177+
PD.AddTaggedVal(reinterpret_cast<uint64_t>(T.getAsOpaquePtr()),
71787178
DiagnosticsEngine::ak_qualtype);
71797179
return PD;
71807180
}

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ CODEGENOPT(UniqueBasicBlockSectionNames, 1, 1) ///< Set for -funique-basic-block
5454
CODEGENOPT(EnableAIXExtendedAltivecABI, 1, 0) ///< Set for -mabi=vec-extabi. Enables the extended Altivec ABI on AIX.
5555
ENUM_CODEGENOPT(FramePointer, FramePointerKind, 2, FramePointerKind::None) /// frame-pointer: all,non-leaf,none
5656

57+
CODEGENOPT(ClearASTBeforeBackend , 1, 0) ///< Free the AST before running backend code generation. Only works with -disable-free.
5758
CODEGENOPT(DisableFree , 1, 0) ///< Don't free memory.
5859
CODEGENOPT(DiscardValueNames , 1, 0) ///< Discard Value Names from the IR (LLVMContext flag)
5960
CODEGENOPT(DisableLLVMPasses , 1, 0) ///< Don't run any LLVM IR passes to get

clang/include/clang/Basic/Diagnostic.h

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ struct DiagnosticStorage {
165165
/// The values for the various substitution positions.
166166
///
167167
/// This is used when the argument is not an std::string. The specific value
168-
/// is mangled into an intptr_t and the interpretation depends on exactly
168+
/// is mangled into an uint64_t and the interpretation depends on exactly
169169
/// what sort of argument kind it is.
170-
intptr_t DiagArgumentsVal[MaxArguments];
170+
uint64_t DiagArgumentsVal[MaxArguments];
171171

172172
/// The values for the various substitution positions that have
173173
/// string arguments.
@@ -1185,7 +1185,7 @@ class StreamingDiagnostic {
11851185
DiagStorage = nullptr;
11861186
}
11871187

1188-
void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const {
1188+
void AddTaggedVal(uint64_t V, DiagnosticsEngine::ArgumentKind Kind) const {
11891189
if (!DiagStorage)
11901190
DiagStorage = getStorage();
11911191

@@ -1408,6 +1408,12 @@ inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
14081408
return DB;
14091409
}
14101410

1411+
inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
1412+
int64_t I) {
1413+
DB.AddTaggedVal(I, DiagnosticsEngine::ak_sint);
1414+
return DB;
1415+
}
1416+
14111417
// We use enable_if here to prevent that this overload is selected for
14121418
// pointers or other arguments that are implicitly convertible to bool.
14131419
template <typename T>
@@ -1424,6 +1430,12 @@ inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
14241430
return DB;
14251431
}
14261432

1433+
inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
1434+
uint64_t I) {
1435+
DB.AddTaggedVal(I, DiagnosticsEngine::ak_uint);
1436+
return DB;
1437+
}
1438+
14271439
inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
14281440
tok::TokenKind I) {
14291441
DB.AddTaggedVal(static_cast<unsigned>(I), DiagnosticsEngine::ak_tokenkind);
@@ -1586,18 +1598,18 @@ class Diagnostic {
15861598

15871599
/// Return the specified signed integer argument.
15881600
/// \pre getArgKind(Idx) == DiagnosticsEngine::ak_sint
1589-
int getArgSInt(unsigned Idx) const {
1601+
int64_t getArgSInt(unsigned Idx) const {
15901602
assert(getArgKind(Idx) == DiagnosticsEngine::ak_sint &&
15911603
"invalid argument accessor!");
1592-
return (int)DiagObj->DiagStorage.DiagArgumentsVal[Idx];
1604+
return (int64_t)DiagObj->DiagStorage.DiagArgumentsVal[Idx];
15931605
}
15941606

15951607
/// Return the specified unsigned integer argument.
15961608
/// \pre getArgKind(Idx) == DiagnosticsEngine::ak_uint
1597-
unsigned getArgUInt(unsigned Idx) const {
1609+
uint64_t getArgUInt(unsigned Idx) const {
15981610
assert(getArgKind(Idx) == DiagnosticsEngine::ak_uint &&
15991611
"invalid argument accessor!");
1600-
return (unsigned)DiagObj->DiagStorage.DiagArgumentsVal[Idx];
1612+
return DiagObj->DiagStorage.DiagArgumentsVal[Idx];
16011613
}
16021614

16031615
/// Return the specified IdentifierInfo argument.
@@ -1611,7 +1623,7 @@ class Diagnostic {
16111623

16121624
/// Return the specified non-string argument in an opaque form.
16131625
/// \pre getArgKind(Idx) != DiagnosticsEngine::ak_std_string
1614-
intptr_t getRawArg(unsigned Idx) const {
1626+
uint64_t getRawArg(unsigned Idx) const {
16151627
assert(getArgKind(Idx) != DiagnosticsEngine::ak_std_string &&
16161628
"invalid argument accessor!");
16171629
return DiagObj->DiagStorage.DiagArgumentsVal[Idx];

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ def warn_reserved_extern_symbol: Warning<
424424
"identifier %0 is reserved because %select{"
425425
"<ERROR>|" // ReservedIdentifierStatus::NotReserved
426426
"it starts with '_' at global scope|"
427+
"it starts with '_' and has C language linkage|"
427428
"it starts with '__'|"
428429
"it starts with '_' followed by a capital letter|"
429430
"it contains '__'}1">,

0 commit comments

Comments
 (0)