Skip to content

Commit ddb0fcb

Browse files
committed
Merge branch 'main' of https://github.com/llvm/llvm-project into fix/111854
2 parents 93ccc0d + 8c4bc1e commit ddb0fcb

File tree

262 files changed

+9965
-4672
lines changed

Some content is hidden

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

262 files changed

+9965
-4672
lines changed

clang-tools-extra/modularize/CoverageChecker.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,9 @@ bool CoverageChecker::collectModuleHeaders(const Module &Mod) {
223223
return false;
224224
}
225225

226-
for (auto &HeaderKind : Mod.Headers)
227-
for (auto &Header : HeaderKind)
228-
ModuleMapHeadersSet.insert(
229-
ModularizeUtilities::getCanonicalPath(Header.Entry.getName()));
226+
for (const auto &Header : Mod.getAllHeaders())
227+
ModuleMapHeadersSet.insert(
228+
ModularizeUtilities::getCanonicalPath(Header.Entry.getName()));
230229

231230
for (auto *Submodule : Mod.submodules())
232231
collectModuleHeaders(*Submodule);

clang-tools-extra/modularize/ModularizeUtilities.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ bool ModularizeUtilities::collectModuleHeaders(const clang::Module &Mod) {
358358
} else if (std::optional<clang::Module::DirectoryName> UmbrellaDir =
359359
Mod.getUmbrellaDirAsWritten()) {
360360
// If there normal headers, assume these are umbrellas and skip collection.
361-
if (Mod.Headers->size() == 0) {
361+
if (Mod.getHeaders(Module::HK_Normal).empty()) {
362362
// Collect headers in umbrella directory.
363363
if (!collectUmbrellaHeaders(UmbrellaDir->Entry.getName(),
364364
UmbrellaDependents))
@@ -371,16 +371,8 @@ bool ModularizeUtilities::collectModuleHeaders(const clang::Module &Mod) {
371371
// modules or because they are meant to be included by another header,
372372
// and thus should be ignored by modularize.
373373

374-
int NormalHeaderCount = Mod.Headers[clang::Module::HK_Normal].size();
375-
376-
for (int Index = 0; Index < NormalHeaderCount; ++Index) {
377-
DependentsVector NormalDependents;
378-
// Collect normal header.
379-
const clang::Module::Header &Header(
380-
Mod.Headers[clang::Module::HK_Normal][Index]);
381-
std::string HeaderPath = getCanonicalPath(Header.Entry.getName());
382-
HeaderFileNames.push_back(HeaderPath);
383-
}
374+
for (const auto &Header : Mod.getHeaders(clang::Module::HK_Normal))
375+
HeaderFileNames.push_back(getCanonicalPath(Header.Entry.getName()));
384376

385377
int MissingCountThisModule = Mod.MissingHeaders.size();
386378

clang/docs/ReleaseNotes.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,15 @@ C++ Specific Potentially Breaking Changes
133133
// Fixed version:
134134
unsigned operator""_udl_name(unsigned long long);
135135

136+
- Clang will now produce an error diagnostic when [[clang::lifetimebound]] is
137+
applied on a parameter of a function that returns void. This was previously
138+
ignored and had no effect. (#GH107556)
139+
140+
.. code-block:: c++
141+
142+
// Now diagnoses with an error.
143+
void f(int& i [[clang::lifetimebound]]);
144+
136145
ABI Changes in This Version
137146
---------------------------
138147

@@ -302,6 +311,11 @@ Modified Compiler Flags
302311
the ``promoted`` algorithm for complex division when possible rather than the
303312
less basic (limited range) algorithm.
304313

314+
- The ``-fveclib`` option has been updated to enable ``-fno-math-errno`` for
315+
``-fveclib=ArmPL`` and ``-fveclib=SLEEF``. This gives Clang more opportunities
316+
to utilize these vector libraries. The behavior for all other vector function
317+
libraries remains unchanged.
318+
305319
Removed Compiler Flags
306320
-------------------------
307321

@@ -424,6 +438,8 @@ Improvements to Clang's diagnostics
424438
name was a reserved name, which we improperly allowed to suppress the
425439
diagnostic.
426440

441+
- Clang now diagnoses ``[[deprecated]]`` attribute usage on local variables (#GH90073).
442+
427443
Improvements to Clang's time-trace
428444
----------------------------------
429445

clang/include/clang/Analysis/FlowSensitive/NoopLattice.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#define LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_NOOP_LATTICE_H
1515

1616
#include "clang/Analysis/FlowSensitive/DataflowLattice.h"
17+
#include "clang/Support/Compiler.h"
1718
#include "llvm/ADT/Any.h"
1819
#include <ostream>
1920

clang/include/clang/Basic/AArch64SVEACLETypes.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
AARCH64_VECTOR_TYPE(Name, MangledName, Id, SingletonId)
108108
#endif
109109

110-
111110
//===- Vector point types -----------------------------------------------===//
112111

113112
SVE_VECTOR_TYPE_INT("__SVInt8_t", "__SVInt8_t", SveInt8, SveInt8Ty, 16, 8, 1, true)
@@ -201,6 +200,7 @@ SVE_PREDICATE_TYPE_ALL("__clang_svboolx4_t", "svboolx4_t", SveBoolx4, SveBoolx4T
201200

202201
SVE_OPAQUE_TYPE("__SVCount_t", "__SVCount_t", SveCount, SveCountTy)
203202

203+
AARCH64_VECTOR_TYPE_MFLOAT("__MFloat8_t", "__MFloat8_t", MFloat8, MFloat8Ty, 1, 8, 1)
204204
AARCH64_VECTOR_TYPE_MFLOAT("__MFloat8x8_t", "__MFloat8x8_t", MFloat8x8, MFloat8x8Ty, 8, 8, 1)
205205
AARCH64_VECTOR_TYPE_MFLOAT("__MFloat8x16_t", "__MFloat8x16_t", MFloat8x16, MFloat8x16Ty, 16, 8, 1)
206206

clang/include/clang/Basic/AMDGPUTypes.def

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@
1515
AMDGPU_TYPE(Name, Id, SingletonId, Width, Align)
1616
#endif
1717

18+
#ifndef AMDGPU_NAMED_BARRIER_TYPE
19+
#define AMDGPU_NAMED_BARRIER_TYPE(Name, Id, SingletonId, Width, Align, Scope) \
20+
AMDGPU_TYPE(Name, Id, SingletonId, Width, Align)
21+
#endif
22+
1823
AMDGPU_OPAQUE_PTR_TYPE("__amdgpu_buffer_rsrc_t", AMDGPUBufferRsrc, AMDGPUBufferRsrcTy, 128, 128, 8)
1924

25+
AMDGPU_NAMED_BARRIER_TYPE("__amdgpu_named_workgroup_barrier_t", AMDGPUNamedWorkgroupBarrier, AMDGPUNamedWorkgroupBarrierTy, 128, 32, 0)
26+
2027
#undef AMDGPU_TYPE
2128
#undef AMDGPU_OPAQUE_PTR_TYPE
29+
#undef AMDGPU_NAMED_BARRIER_TYPE

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ CODEGENOPT(XRayIgnoreLoops , 1, 0)
136136
///< Emit the XRay function index section.
137137
CODEGENOPT(XRayFunctionIndex , 1, 1)
138138

139+
///< Set when -fxray-shared is enabled
140+
CODEGENOPT(XRayShared , 1, 0)
139141

140142
///< Set the minimum number of instructions in a function to determine selective
141143
///< XRay instrumentation.

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10097,6 +10097,9 @@ def err_lifetimebound_no_object_param : Error<
1009710097
def err_lifetimebound_ctor_dtor : Error<
1009810098
"'lifetimebound' attribute cannot be applied to a "
1009910099
"%select{constructor|destructor}0">;
10100+
def err_lifetimebound_void_return_type : Error<
10101+
"'lifetimebound' attribute cannot be applied to a parameter of a function "
10102+
"that returns void">;
1010010103

1010110104
// CHECK: returning address/reference of stack memory
1010210105
def warn_ret_stack_addr_ref : Warning<

clang/include/clang/Basic/Module.h

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,6 @@ class alignas(8) Module {
253253
HK_PrivateTextual,
254254
HK_Excluded
255255
};
256-
static const int NumHeaderKinds = HK_Excluded + 1;
257-
258256
/// Information about a header directive as found in the module map
259257
/// file.
260258
struct Header {
@@ -263,17 +261,36 @@ class alignas(8) Module {
263261
FileEntryRef Entry;
264262
};
265263

266-
/// Information about a directory name as found in the module map
267-
/// file.
264+
private:
265+
static const int NumHeaderKinds = HK_Excluded + 1;
266+
// The begin index for a HeaderKind also acts the end index of HeaderKind - 1.
267+
// The extra element at the end acts as the end index of the last HeaderKind.
268+
unsigned HeaderKindBeginIndex[NumHeaderKinds + 1] = {};
269+
SmallVector<Header, 2> HeadersStorage;
270+
271+
public:
272+
ArrayRef<Header> getAllHeaders() const { return HeadersStorage; }
273+
ArrayRef<Header> getHeaders(HeaderKind HK) const {
274+
assert(HK < NumHeaderKinds && "Invalid Module::HeaderKind");
275+
auto BeginIt = HeadersStorage.begin() + HeaderKindBeginIndex[HK];
276+
auto EndIt = HeadersStorage.begin() + HeaderKindBeginIndex[HK + 1];
277+
return {BeginIt, EndIt};
278+
}
279+
void addHeader(HeaderKind HK, Header H) {
280+
assert(HK < NumHeaderKinds && "Invalid Module::HeaderKind");
281+
auto EndIt = HeadersStorage.begin() + HeaderKindBeginIndex[HK + 1];
282+
HeadersStorage.insert(EndIt, std::move(H));
283+
for (unsigned HKI = HK + 1; HKI != NumHeaderKinds + 1; ++HKI)
284+
++HeaderKindBeginIndex[HKI];
285+
}
286+
287+
/// Information about a directory name as found in the module map file.
268288
struct DirectoryName {
269289
std::string NameAsWritten;
270290
std::string PathRelativeToRootModuleDirectory;
271291
DirectoryEntryRef Entry;
272292
};
273293

274-
/// The headers that are part of this module.
275-
SmallVector<Header, 2> Headers[5];
276-
277294
/// Stored information about a header directive that was found in the
278295
/// module map file but has not been resolved to a file.
279296
struct UnresolvedHeaderDirective {

clang/include/clang/Driver/Options.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2948,6 +2948,11 @@ def fxray_selected_function_group :
29482948
HelpText<"When using -fxray-function-groups, select which group of functions to instrument. Valid range is 0 to fxray-function-groups - 1">,
29492949
MarshallingInfoInt<CodeGenOpts<"XRaySelectedFunctionGroup">, "0">;
29502950

2951+
defm xray_shared : BoolFOption<"xray-shared",
2952+
CodeGenOpts<"XRayShared">, DefaultFalse,
2953+
PosFlag<SetTrue, [], [ClangOption, CC1Option],
2954+
"Enable shared library instrumentation with XRay">,
2955+
NegFlag<SetFalse>>;
29512956

29522957
defm fine_grained_bitfield_accesses : BoolOption<"f", "fine-grained-bitfield-accesses",
29532958
CodeGenOpts<"FineGrainedBitfieldAccesses">, DefaultFalse,

0 commit comments

Comments
 (0)