Skip to content

Commit 3cef20c

Browse files
authored
Merge pull request #260 from Xilinx/bump_to_972f65a8
2 parents 6883373 + 4291ba3 commit 3cef20c

File tree

253 files changed

+2312
-1366
lines changed

Some content is hidden

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

253 files changed

+2312
-1366
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ Modified Compiler Flags
193193
``-Wreturn-type``, and moved some of the diagnostics previously controlled by
194194
``-Wreturn-type`` under this new flag. Fixes #GH72116.
195195

196+
- Added ``-Wcast-function-type`` as a warning enabled by ``-Wextra``. #GH76872
197+
196198
Removed Compiler Flags
197199
-------------------------
198200

@@ -210,6 +212,13 @@ Attribute Changes in Clang
210212
and each must be a positive integer when provided. The parameter ``x`` is required, while ``y`` and
211213
``z`` are optional with default value of 1.
212214

215+
- The ``swiftasynccc`` attribute is now considered to be a Clang extension
216+
rather than a language standard feature. Please use
217+
``__has_extension(swiftasynccc)`` to check the availability of this attribute
218+
for the target platform instead of ``__has_feature(swiftasynccc)``. Also,
219+
added a new extension query ``__has_extension(swiftcc)`` corresponding to the
220+
``__attribute__((swiftcc))`` attribute.
221+
213222
Improvements to Clang's diagnostics
214223
-----------------------------------
215224
- Clang now applies syntax highlighting to the code snippets it

clang/include/clang/AST/Expr.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3562,6 +3562,18 @@ class CastExpr : public Expr {
35623562
path_const_iterator path_begin() const { return path_buffer(); }
35633563
path_const_iterator path_end() const { return path_buffer() + path_size(); }
35643564

3565+
/// Path through the class hierarchy taken by casts between base and derived
3566+
/// classes (see implementation of `CastConsistency()` for a full list of
3567+
/// cast kinds that have a path).
3568+
///
3569+
/// For each derived-to-base edge in the path, the path contains a
3570+
/// `CXXBaseSpecifier` for the base class of that edge; the entries are
3571+
/// ordered from derived class to base class.
3572+
///
3573+
/// For example, given classes `Base`, `Intermediate : public Base` and
3574+
/// `Derived : public Intermediate`, the path for a cast from `Derived *` to
3575+
/// `Base *` contains two entries: One for `Intermediate`, and one for `Base`,
3576+
/// in that order.
35653577
llvm::iterator_range<path_iterator> path() {
35663578
return llvm::make_range(path_begin(), path_end());
35673579
}

clang/include/clang/Basic/AttrDocs.td

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5137,10 +5137,11 @@ that does not. A single parameter may not have multiple ABI treatment
51375137
attributes.
51385138

51395139
Support for this feature is target-dependent, although it should be
5140-
supported on every target that Swift supports. Query for this support
5141-
with ``__has_attribute(swiftcall)``. This implies support for the
5142-
``swift_context``, ``swift_error_result``, and ``swift_indirect_result``
5143-
attributes.
5140+
supported on every target that Swift supports. Query for this attribute
5141+
with ``__has_attribute(swiftcall)``. Query if the target supports the
5142+
calling convention with ``__has_extension(swiftcc)``. This implies
5143+
support for the ``swift_context``, ``swift_error_result``, and
5144+
``swift_indirect_result`` attributes.
51445145
}];
51455146
}
51465147

@@ -5187,6 +5188,10 @@ the following:
51875188
semantically be performed after a guaranteed tail call, such as the
51885189
non-trivial destruction of a local variable or temporary,
51895190
then the program is ill-formed.
5191+
5192+
Query for this attribute with ``__has_attribute(swiftasynccall)``. Query if
5193+
the target supports the calling convention with
5194+
``__has_extension(swiftasynccc)``.
51905195
}];
51915196
}
51925197

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,7 @@ def Extra : DiagGroup<"extra", [
10381038
EmptyInitStatement,
10391039
StringConcatation,
10401040
FUseLdPath,
1041+
CastFunctionType,
10411042
]>;
10421043

10431044
def Most : DiagGroup<"most", [

clang/include/clang/Basic/Features.def

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ FEATURE(thread_sanitizer, LangOpts.Sanitize.has(SanitizerKind::Thread))
102102
FEATURE(dataflow_sanitizer, LangOpts.Sanitize.has(SanitizerKind::DataFlow))
103103
FEATURE(scudo, LangOpts.Sanitize.hasOneOf(SanitizerKind::Scudo))
104104
FEATURE(ptrauth_intrinsics, LangOpts.PointerAuthIntrinsics)
105-
FEATURE(swiftasynccc,
105+
EXTENSION(swiftcc,
106+
PP.getTargetInfo().checkCallingConvention(CC_Swift) ==
107+
clang::TargetInfo::CCCR_OK)
108+
EXTENSION(swiftasynccc,
106109
PP.getTargetInfo().checkCallingConvention(CC_SwiftAsync) ==
107110
clang::TargetInfo::CCCR_OK)
108111
FEATURE(pragma_stdc_cx_limited_range, true)

clang/include/clang/InstallAPI/DylibVerifier.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ class DylibVerifier {
128128
/// Find matching dylib slice for target triple that is being parsed.
129129
void assignSlice(const Target &T);
130130

131+
/// Gather annotations for symbol for error reporting.
132+
std::string getAnnotatedName(const Record *R, SymbolContext &SymCtx,
133+
bool ValidSourceLoc = true);
134+
131135
// Symbols in dylib.
132136
llvm::MachO::Records Dylib;
133137

clang/include/clang/InstallAPI/MachO.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@
2626
using SymbolFlags = llvm::MachO::SymbolFlags;
2727
using RecordLinkage = llvm::MachO::RecordLinkage;
2828
using Record = llvm::MachO::Record;
29+
using EncodeKind = llvm::MachO::EncodeKind;
2930
using GlobalRecord = llvm::MachO::GlobalRecord;
3031
using ObjCContainerRecord = llvm::MachO::ObjCContainerRecord;
3132
using ObjCInterfaceRecord = llvm::MachO::ObjCInterfaceRecord;
3233
using ObjCCategoryRecord = llvm::MachO::ObjCCategoryRecord;
3334
using ObjCIVarRecord = llvm::MachO::ObjCIVarRecord;
35+
using ObjCIFSymbolKind = llvm::MachO::ObjCIFSymbolKind;
3436
using Records = llvm::MachO::Records;
3537
using RecordsSlice = llvm::MachO::RecordsSlice;
3638
using BinaryAttrs = llvm::MachO::RecordsSlice::BinaryAttrs;

clang/lib/Driver/Driver.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4645,13 +4645,17 @@ Action *Driver::BuildOffloadingActions(Compilation &C,
46454645
}
46464646
}
46474647

4648+
// HIP code in non-RDC mode will bundle the output if it invoked the linker.
4649+
bool ShouldBundleHIP =
4650+
C.isOffloadingHostKind(Action::OFK_HIP) &&
4651+
Args.hasFlag(options::OPT_gpu_bundle_output,
4652+
options::OPT_no_gpu_bundle_output, true) &&
4653+
!Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc, false) &&
4654+
!llvm::any_of(OffloadActions,
4655+
[](Action *A) { return A->getType() != types::TY_Image; });
4656+
46484657
// All kinds exit now in device-only mode except for non-RDC mode HIP.
4649-
if (offloadDeviceOnly() &&
4650-
(getFinalPhase(Args) == phases::Preprocess ||
4651-
!C.isOffloadingHostKind(Action::OFK_HIP) ||
4652-
!Args.hasFlag(options::OPT_gpu_bundle_output,
4653-
options::OPT_no_gpu_bundle_output, true) ||
4654-
Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc, false)))
4658+
if (offloadDeviceOnly() && !ShouldBundleHIP)
46554659
return C.MakeAction<OffloadAction>(DDeps, types::TY_Nothing);
46564660

46574661
if (OffloadActions.empty())

0 commit comments

Comments
 (0)