Skip to content

[AutoBump] Merge with 31249e27 (Jan 14) (42) #513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 98 commits into from
Apr 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
f879da7
[mlir-cpu-runner] Pass --exclude-libs to linker when building runner …
andfau-amd Jan 14, 2025
30f9a4f
[OpenMP] codegen support for masked combined construct parallel maske…
chandraghale Jan 14, 2025
0d71b3e
[CodeGen] Remove unused argument from getCoveringSubRegIndexes. NFC. …
jayfoad Jan 14, 2025
d2d4c3b
[MLIR][OpenMP] LLVM IR translation of host_eval (#116052)
skatrak Jan 14, 2025
6c7a53b
[llvm] Add lifetimebound to llvm::sys::path::filename, etc. (#122890)
usx95 Jan 14, 2025
0bd098b
[X86] Fold VPERMV3(WIDEN(X),M,WIDEN(Y)) -> VPERMV(CONCAT(X,Y),M') iff…
RKSimon Jan 14, 2025
1393f4e
[MemCpyOpt] Use doesNotCapture() helper (NFC)
nikic Jan 14, 2025
428c876
[libc++] Stop copying headers to the build directory (#115380)
arichardson Jan 14, 2025
d8d30a9
Revert "[mlir-cpu-runner] Pass --exclude-libs to linker when building…
andfau-amd Jan 14, 2025
8fe11a2
[Flang][OpenMP] Lowering of host-evaluated clauses (#116219)
skatrak Jan 14, 2025
310c281
[flang][Driver] Preliminary support for -ftime-report (#122894)
macurtis-amd Jan 14, 2025
8f6867c
[Flang] Add triple requirement for failing tests, NFC (#122898)
skatrak Jan 14, 2025
c1de9b9
[clang][bytecode] Mark global decls with diagnostics invalid (#122895)
tbaederr Jan 14, 2025
f925e54
[VPlan] Fix mutating whilst iterating over users in EVL transform (#1…
lukel97 Jan 14, 2025
da9df6c
MachineVerifier: Check stack protector is top-most in frame (#122635)
guy-david Jan 14, 2025
5ec7ecd
[LLVM][AArch64] Add new feature +sme-mop4 and +sme-tmop (#121935)
CarolineConcatto Jan 14, 2025
2d760a1
[FunctionAttrs] Add test for initializes + byval (NFC)
nikic Jan 14, 2025
b6eb6a8
[FunctionAttrs] Use doesNotCapture()
nikic Jan 14, 2025
a53fa78
[clang-tidy][doc] fix incorrectly performance-unnecessary-copy-initia…
HerrCai0907 Jan 14, 2025
7900769
[llvm][Docs] Add a release note about the lldb DWARF indexing speedup…
labath Jan 14, 2025
5e26ff3
[AMDGPU][True16][MC] true16 for v_cmp_lt_f16 (#122499)
broxigarchen Jan 14, 2025
b1751fa
[lldb][Linux] Mark memory regions used for shadow stacks (#117861)
DavidSpickett Jan 14, 2025
438e2cc
[libc++] Make std::stable_sort constexpr friendly (#110320)
PaulXiCao Jan 14, 2025
e03c435
[libc++] Fix `tuple_cat` for element with unconstrained constructor (…
frederick-vs-ja Jan 14, 2025
f4aec22
[mlir][acc] Fix async only api on data entry operations (#122818)
razvanlupusoru Jan 14, 2025
493c066
[libc++] Fix ambiguity due to non-uglified member typedefs (#121664)
winner245 Jan 14, 2025
fbef1f8
[clang-format][NFC] Make formatting Verilog faster (#121139)
sstwcw Jan 14, 2025
df40b05
[mlir][nfc] Update 2 tests for PadOpVectorizationWithTransferWritePat…
banach-space Jan 14, 2025
d305fd0
[flang][AIX] filter out __builtin_c_devptr for generating packed type…
kkwli Jan 14, 2025
2f7807e
[Flang] Generate math.cosh op for non-precise cosh intrinsic calls (#…
jsjodin Jan 14, 2025
4f614a8
[AMDGPULowerBufferFatPointers] Use typeIncompatible() (#122902)
nikic Jan 14, 2025
f1b1c7f
[AMDGPU][True16][CodeGen] Undo sub(x,c) to add in true16 flow (#118854)
broxigarchen Jan 14, 2025
0fb0ac7
[OMPIRBuilder] Simplify error handling while emitting target calls, N…
skatrak Jan 14, 2025
87750c9
[VectorCombine] foldPermuteOfBinops - match identity shuffles only if…
RKSimon Jan 14, 2025
193ea83
[SimplifyLibCalls] Don't infer call-site nocapture on atoi
nikic Jan 14, 2025
58fa55c
[clang][bytecode] Add init link for the RVO ptr (#122904)
tbaederr Jan 14, 2025
97cf5aa
[Clang] Add AArch64 SME changes to release notes (NFC) (#122899)
sdesmalen-arm Jan 14, 2025
616007d
[LLD][COFF] Skip sections marked as IMAGE_SCN_LNK_INFO in the output …
cjacek Jan 14, 2025
091adb8
[libc][cmake] move _get_{common|hermetic}_test_compile_options to LLV…
nickdesaulniers Jan 14, 2025
0298e58
[libc++] Optimize input_iterator-pair `insert` for std::vector (#113768)
winner245 Jan 14, 2025
b74d3e1
[SPIR-V] Specify target environment in tests referring to the BuiltIn…
VyacheslavLevytskyy Jan 14, 2025
c2771ca
[libc][docs] Add sys/resource header's implementation status (#122563)
StarOne01 Jan 14, 2025
9ba27ca
[SPIR-V] Ensure no uses of intrinsic global variables after module tr…
VyacheslavLevytskyy Jan 14, 2025
539b15b
[libc][docs] stub out pthread.h support (#122497)
nickdesaulniers Jan 14, 2025
c334869
[ASan] Change strdup interceptor to allow null input on Windows (#122…
zacklj89 Jan 14, 2025
8d9dcd1
[compiler-rt] fseek interception update. (#122795)
devnexen Jan 14, 2025
fbb4697
[libc++] Remove unused _LIBCPP_HAS_NO_TREE_BARRIER macro and associat…
ldionne Jan 14, 2025
06c6bae
[HLSL] Implement D3DCOLORtoUBYTE4 intrinsic (#122202)
Icohedron Jan 14, 2025
a0bd40e
Revert "[clang][bytecode] Mark global decls with diagnostics invalid …
tbaederr Jan 14, 2025
692c77f
[libc][docs] reorder docs to be more beginner friendly (#122376)
nickdesaulniers Jan 14, 2025
b1edfa1
[SelectionDAG] Prevent converting a virtual register to an MCRegister…
topperc Jan 14, 2025
c7fddf5
[ARM] Prevent converting virtual register to MCRegister. (#122862)
topperc Jan 14, 2025
fed817a
[DSE] Consider the aliasing through global variable while checking cl…
haopliu Jan 14, 2025
5187482
IR: handle FP predicates in CmpPredicate::getMatching (#122924)
artagnon Jan 14, 2025
a4b7a2d
[DirectX] Propagate shader flags mask of callees to callers (#118306)
bharadwajy Jan 14, 2025
5a3b5ca
[bazel] Add targets for some testing utility binaries/libraries. (#12…
slackito Jan 14, 2025
71f238a
[Hexagon] Add missing builtins for V79 (#122916)
iajbar Jan 14, 2025
576b538
Revert "[libc++] Stop copying headers to the build directory (#115380)"
kstoimenov Jan 14, 2025
1594413
Add Clang attribute to ensure that fields are initialized explicitly …
higher-performance Jan 14, 2025
dcc141b
[TargetParser] Add missing include to modulemap (#122768)
cyndyishida Jan 14, 2025
bf23ae6
[flang] Fix crash in fuzzed input program (#122193)
klausler Jan 14, 2025
c8202db
[flang] Fix crash in fuzzing test (#122189)
klausler Jan 14, 2025
6f55c80
[flang] Fix crash in fuzzer-generated error test. (#122199)
klausler Jan 14, 2025
9405a81
[flang] Fix crash exposed by fuzzing (#122187)
klausler Jan 14, 2025
01a0d21
[flang][acc] Implement MappableType interfaces for fir.box and fir.ar…
razvanlupusoru Jan 14, 2025
63d3bd6
[Exegesis] Fix test failures from #122775 on MacOSX and Fuchsia
mshockwave Jan 14, 2025
d1a6eaa
[Attributor][NFC] Performance improvements (#122923)
macurtis-amd Jan 14, 2025
1dbc982
[libc] Fix SPDX-License-Identifier file header comment typos (#122776)
frobtech Jan 14, 2025
0d15081
[flang] Fix a warning
kazutakahirata Jan 14, 2025
e511b3e
[SPIRV] Fix graphic test to use correct triple. (#122738)
s-perron Jan 14, 2025
5dcf5cc
[lldb] Remove unfiltered stop reason propagation from StopInfoMachExc…
felipepiovezan Jan 14, 2025
dac06e7
[flang][acc] Fix FIRTestOpenACCInterfaces dependency (#122953)
razvanlupusoru Jan 14, 2025
5deabab
Rename [[clang::requires_explicit_initialization]] to [[clang::requir…
higher-performance Jan 14, 2025
31e9d39
[bazel] remove unneeded copts (#122958)
slackito Jan 14, 2025
44d9bee
[rtsan][test] Prevent test check from being optimized out in LTO buil…
ilovepi Jan 14, 2025
0e7b754
[ValueTracking] Squash compile-time regression from 66badf2 (#122700)
artagnon Jan 14, 2025
48757e0
[InstCombine] Teach foldSelectOpOp about samesign (#122723)
artagnon Jan 14, 2025
60dc450
SCEV: migrate to CmpPredicate (NFC) (#122907)
artagnon Jan 14, 2025
11758f9
[flang][acc] Add missing dependency to bbc tool (#122960)
razvanlupusoru Jan 14, 2025
68c9826
[bazel] add missing dep to //clang:static_analyzer_core_options
slackito Jan 14, 2025
43491f0
[mlir][emitc] Expose emitc dialect types (#119645)
TGMM Jan 14, 2025
8d1d67e
[Offload][PGO] Fix dump of array in ProfData (#122039)
jsji Jan 14, 2025
b720b6c
[flang] Fix crash from fuzzy test. (#122364)
klausler Jan 14, 2025
ebec4d6
[flang] Fix use-after-free cases found by valgrind (#122394)
klausler Jan 14, 2025
89bbaf3
[flang] Fix another crash from another fuzzer test. (#122562)
klausler Jan 14, 2025
9696355
[flang] Better messages and error recovery for a bad RESHAPE (#122604)
klausler Jan 14, 2025
bf95854
[flang] EOF goes to ERR= in READ(..., REC=) (#122608)
klausler Jan 14, 2025
874a3ba
[flang][runtime] Don't buffer unit 0 (#122614)
klausler Jan 14, 2025
9f0f54a
[flang] Improve error messages for module self-USE (#122747)
klausler Jan 14, 2025
4a3e4b9
[flang] Adjust prescanner fix for preprocessing (#122779)
klausler Jan 14, 2025
9629f2c
[flang] Improve module file error message wording (#122787)
klausler Jan 14, 2025
ecf264d
[flang] Fix spurious error message due to inaccessible generic bindin…
klausler Jan 14, 2025
93fd72c
[llvm-gsymutil] Ensure gSYM creation determinism with merged function…
alx32 Jan 14, 2025
3d24c77
[clang][DebugInfo] Emit DW_AT_object_pointer on function definitions …
Michael137 Jan 14, 2025
ef804d8
[libc++] Simplify when the sized global deallocations overloads are a…
philnik777 Jan 14, 2025
6e14f9b
[bazel] minor formatting fixes (#122964)
slackito Jan 14, 2025
31249e2
[DirectX] Avoid deprecated PointerUnion methods (#122972)
bogner Jan 14, 2025
db1df40
[AutoBump] Merge with 31249e27 (Jan 14)
jorickert Mar 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions clang-tools-extra/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ Changes in existing checks
<clang-tidy/checks/performance/move-const-arg>` check to fix a crash when
an argument type is declared but not defined.

- Improved :doc:`performance-unnecessary-copy-initialization`
<clang-tidy/checks/performance/unnecessary-copy-initialization> check
- Improved :doc:`performance-unnecessary-copy-initialization
<clang-tidy/checks/performance/unnecessary-copy-initialization>` check
to consider static member functions the same way as free functions.

- Improved :doc:`readability-container-contains
Expand Down
9 changes: 9 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,15 @@ Arm and AArch64 Support
in leaf functions after enabling ``-fno-omit-frame-pointer``, you can do so by adding
the ``-momit-leaf-frame-pointer`` option.

- SME keyword attributes which apply to function types are now represented in the
mangling of the type. This means that ``void foo(void (*f)() __arm_streaming);``
now has a different mangling from ``void foo(void (*f)());``.

- The ``__arm_agnostic`` keyword attribute was added to let users describe
a function that preserves SME state enabled by PSTATE.ZA without having to share
this state with its callers and without making the assumption that this state
exists.

- Support has been added for the following processors (-mcpu identifiers in parenthesis):

For AArch64:
Expand Down
8 changes: 8 additions & 0 deletions clang/include/clang/AST/Decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -4285,6 +4285,14 @@ class RecordDecl : public TagDecl {
RecordDeclBits.HasNonTrivialToPrimitiveCopyCUnion = V;
}

bool hasUninitializedExplicitInitFields() const {
return RecordDeclBits.HasUninitializedExplicitInitFields;
}

void setHasUninitializedExplicitInitFields(bool V) {
RecordDeclBits.HasUninitializedExplicitInitFields = V;
}

/// Determine whether this class can be passed in registers. In C++ mode,
/// it must have at least one trivial, non-deleted copy or move constructor.
/// FIXME: This should be set as part of completeDefinition.
Expand Down
13 changes: 12 additions & 1 deletion clang/include/clang/AST/DeclBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,9 @@ class DeclContext {
/// hasLazyLocalLexicalLookups, hasLazyExternalLexicalLookups
friend class ASTWriter;

protected:
enum { NumOdrHashBits = 25 };

// We use uint64_t in the bit-fields below since some bit-fields
// cross the unsigned boundary and this breaks the packing.

Expand Down Expand Up @@ -1667,6 +1670,14 @@ class DeclContext {
LLVM_PREFERRED_TYPE(bool)
uint64_t HasNonTrivialToPrimitiveCopyCUnion : 1;

/// True if any field is marked as requiring explicit initialization with
/// [[clang::require_explicit_initialization]].
/// In C++, this is also set for types without a user-provided default
/// constructor, and is propagated from any base classes and/or member
/// variables whose types are aggregates.
LLVM_PREFERRED_TYPE(bool)
uint64_t HasUninitializedExplicitInitFields : 1;

/// Indicates whether this struct is destroyed in the callee.
LLVM_PREFERRED_TYPE(bool)
uint64_t ParamDestroyedInCallee : 1;
Expand All @@ -1681,7 +1692,7 @@ class DeclContext {

/// True if a valid hash is stored in ODRHash. This should shave off some
/// extra storage and prevent CXXRecordDecl to store unused bits.
uint64_t ODRHash : 26;
uint64_t ODRHash : NumOdrHashBits;
};

/// Number of inherited and non-inherited bits in RecordDeclBitfields.
Expand Down
7 changes: 7 additions & 0 deletions clang/include/clang/Basic/Attr.td
Original file line number Diff line number Diff line change
Expand Up @@ -1902,6 +1902,13 @@ def Leaf : InheritableAttr {
let SimpleHandler = 1;
}

def ExplicitInit : InheritableAttr {
let Spellings = [Clang<"require_explicit_initialization">];
let Subjects = SubjectList<[Field], ErrorDiag>;
let Documentation = [ExplicitInitDocs];
let SimpleHandler = 1;
}

def LifetimeBound : DeclOrTypeAttr {
let Spellings = [Clang<"lifetimebound", 0>];
let Subjects = SubjectList<[ParmVar, ImplicitObjectParameter], ErrorDiag>;
Expand Down
49 changes: 49 additions & 0 deletions clang/include/clang/Basic/AttrDocs.td
Original file line number Diff line number Diff line change
Expand Up @@ -1684,6 +1684,55 @@ is not specified.
}];
}

def ExplicitInitDocs : Documentation {
let Category = DocCatField;
let Content = [{
The ``clang::require_explicit_initialization`` attribute indicates that a
field of an aggregate must be initialized explicitly by the user when an object
of the aggregate type is constructed. The attribute supports both C and C++,
but its usage is invalid on non-aggregates.

Note that this attribute is *not* a memory safety feature, and is *not* intended
to guard against use of uninitialized memory.

Rather, it is intended for use in "parameter-objects", used to simulate,
for example, the passing of named parameters.
The attribute generates a warning when explicit initializers for such
variables are not provided (this occurs regardless of whether any in-class field
initializers exist):

.. code-block:: c++

struct Buffer {
void *address [[clang::require_explicit_initialization]];
size_t length [[clang::require_explicit_initialization]] = 0;
};

struct ArrayIOParams {
size_t count [[clang::require_explicit_initialization]];
size_t element_size [[clang::require_explicit_initialization]];
int flags = 0;
};

size_t ReadArray(FILE *file, struct Buffer buffer,
struct ArrayIOParams params);

int main() {
unsigned int buf[512];
ReadArray(stdin, {
buf
// warning: field 'length' is not explicitly initialized
}, {
.count = sizeof(buf) / sizeof(*buf),
// warning: field 'element_size' is not explicitly initialized
// (Note that a missing initializer for 'flags' is not diagnosed, because
// the field is not marked as requiring explicit initialization.)
});
}

}];
}

def NoUniqueAddressDocs : Documentation {
let Category = DocCatField;
let Content = [{
Expand Down
45 changes: 45 additions & 0 deletions clang/include/clang/Basic/BuiltinsHexagonDep.def
Original file line number Diff line number Diff line change
Expand Up @@ -1923,3 +1923,48 @@ TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_sf_bf_acc, "V32iV32iV16iV16i", "", HVXV
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_sf_bf_acc_128B, "V64iV64iV32iV32i", "", HVXV73)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vsub_sf_bf, "V32iV16iV16i", "", HVXV73)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vsub_sf_bf_128B, "V64iV32iV32i", "", HVXV73)

// V79 HVX Instructions.

TARGET_BUILTIN(__builtin_HEXAGON_V6_get_qfext, "V16iV16ii", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_get_qfext_128B, "V32iV32ii", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_get_qfext_oracc, "V16iV16iV16ii", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_get_qfext_oracc_128B, "V32iV32iV32ii", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_set_qfext, "V16iV16ii", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_set_qfext_128B, "V32iV32ii", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vabs_f8, "V16iV16i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vabs_f8_128B, "V32iV32i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vadd_hf_f8, "V32iV16iV16i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vadd_hf_f8_128B, "V64iV32iV32i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt2_b_hf, "V16iV16iV16i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt2_b_hf_128B, "V32iV32iV32i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt2_hf_b, "V32iV16i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt2_hf_b_128B, "V64iV32i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt2_hf_ub, "V32iV16i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt2_hf_ub_128B, "V64iV32i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt2_ub_hf, "V16iV16iV16i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt2_ub_hf_128B, "V32iV32iV32i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt_f8_hf, "V16iV16iV16i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt_f8_hf_128B, "V32iV32iV32i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt_hf_f8, "V32iV16i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vcvt_hf_f8_128B, "V64iV32i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vfmax_f8, "V16iV16iV16i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vfmax_f8_128B, "V32iV32iV32i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vfmin_f8, "V16iV16iV16i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vfmin_f8_128B, "V32iV32iV32i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vfneg_f8, "V16iV16i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vfneg_f8_128B, "V32iV32i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmerge_qf, "V16iV16iV16i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmerge_qf_128B, "V32iV32iV32i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_hf_f8, "V32iV16iV16i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_hf_f8_128B, "V64iV32iV32i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_hf_f8_acc, "V32iV32iV16iV16i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_hf_f8_acc_128B, "V64iV64iV32iV32i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_rt_hf, "V16iV16ii", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_rt_hf_128B, "V32iV32ii", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_rt_qf16, "V16iV16ii", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_rt_qf16_128B, "V32iV32ii", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_rt_sf, "V16iV16ii", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vmpy_rt_sf_128B, "V32iV32ii", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vsub_hf_f8, "V32iV16iV16i", "", HVXV79)
TARGET_BUILTIN(__builtin_HEXAGON_V6_vsub_hf_f8_128B, "V64iV32iV32i", "", HVXV79)
10 changes: 10 additions & 0 deletions clang/include/clang/Basic/DiagnosticASTKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,16 @@ def note_constexpr_assumption_failed : Note<
def err_experimental_clang_interp_failed : Error<
"the experimental clang interpreter failed to evaluate an expression">;

def warn_attribute_needs_aggregate : Warning<
"%0 attribute is ignored in non-aggregate type %1">,
InGroup<IgnoredAttributes>;

def warn_cxx20_compat_requires_explicit_init_non_aggregate : Warning<
"explicit initialization of field %1 will not be enforced in C++20 and later "
"because %2 has a user-declared constructor, making the type no longer an "
"aggregate">,
DefaultIgnore, InGroup<CXX20Compat>;

def warn_integer_constant_overflow : Warning<
"overflow in expression; result is %0 with type %1">,
InGroup<DiagGroup<"integer-overflow">>;
Expand Down
1 change: 1 addition & 0 deletions clang/include/clang/Basic/DiagnosticGroups.td
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@ def Trigraphs : DiagGroup<"trigraphs">;
def UndefinedReinterpretCast : DiagGroup<"undefined-reinterpret-cast">;
def ReinterpretBaseClass : DiagGroup<"reinterpret-base-class">;
def Unicode : DiagGroup<"unicode">;
def UninitializedExplicitInit : DiagGroup<"uninitialized-explicit-init">;
def UninitializedMaybe : DiagGroup<"conditional-uninitialized">;
def UninitializedSometimes : DiagGroup<"sometimes-uninitialized">;
def UninitializedStaticSelfInit : DiagGroup<"static-self-init">;
Expand Down
3 changes: 3 additions & 0 deletions clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -2347,6 +2347,9 @@ def err_init_reference_member_uninitialized : Error<
"reference member of type %0 uninitialized">;
def note_uninit_reference_member : Note<
"uninitialized reference member is here">;
def warn_field_requires_explicit_init : Warning<
"field %select{%1|in %1}0 requires explicit initialization but is not "
"explicitly initialized">, InGroup<UninitializedExplicitInit>;
def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">,
InGroup<Uninitialized>;
def warn_base_class_is_uninit : Warning<
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -4108,7 +4108,7 @@ defm ms_tls_guards : BoolFOption<"ms-tls-guards",
"Do not emit code to perform on-demand initialization of thread-local variables">,
PosFlag<SetTrue>>;
def ftime_report : Flag<["-"], "ftime-report">, Group<f_Group>,
Visibility<[ClangOption, CC1Option]>,
Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
MarshallingInfoFlag<CodeGenOpts<"TimePasses">>;
def ftime_report_EQ: Joined<["-"], "ftime-report=">, Group<f_Group>,
Visibility<[ClangOption, CC1Option]>, Values<"per-pass,per-pass-run">,
Expand Down
3 changes: 3 additions & 0 deletions clang/lib/AST/ByteCode/Compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ bool InitLink::emit(Compiler<Emitter> *Ctx, const Expr *E) const {
if (!Ctx->emitConstUint32(Offset, E))
return false;
return Ctx->emitArrayElemPtrPopUint32(E);
case K_RVO:
return Ctx->emitRVOPtr(E);
case K_InitList:
return true;
default:
Expand Down Expand Up @@ -4998,6 +5000,7 @@ bool Compiler<Emitter>::visitReturnStmt(const ReturnStmt *RS) {
if (!this->visit(RE))
return false;
} else {
InitLinkScope<Emitter> ILS(this, InitLink::RVO());
// RVO - construct the value in the return location.
if (!this->emitRVOPtr(RE))
return false;
Expand Down
4 changes: 3 additions & 1 deletion clang/lib/AST/ByteCode/Compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ struct InitLink {
K_Temp = 2,
K_Decl = 3,
K_Elem = 5,
K_InitList = 6
K_RVO = 6,
K_InitList = 7
};

static InitLink This() { return InitLink{K_This}; }
static InitLink InitList() { return InitLink{K_InitList}; }
static InitLink RVO() { return InitLink{K_RVO}; }
static InitLink Field(unsigned Offset) {
InitLink IL{K_Field};
IL.Offset = Offset;
Expand Down
8 changes: 5 additions & 3 deletions clang/lib/AST/Decl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5031,6 +5031,7 @@ RecordDecl::RecordDecl(Kind DK, TagKind TK, const ASTContext &C,
setHasNonTrivialToPrimitiveDefaultInitializeCUnion(false);
setHasNonTrivialToPrimitiveDestructCUnion(false);
setHasNonTrivialToPrimitiveCopyCUnion(false);
setHasUninitializedExplicitInitFields(false);
setParamDestroyedInCallee(false);
setArgPassingRestrictions(RecordArgPassingKind::CanPassInRegs);
setIsRandomized(false);
Expand Down Expand Up @@ -5231,9 +5232,10 @@ unsigned RecordDecl::getODRHash() {
// Only calculate hash on first call of getODRHash per record.
ODRHash Hash;
Hash.AddRecordDecl(this);
// For RecordDecl the ODRHash is stored in the remaining 26
// bit of RecordDeclBits, adjust the hash to accomodate.
setODRHash(Hash.CalculateHash() >> 6);
// For RecordDecl the ODRHash is stored in the remaining
// bits of RecordDeclBits, adjust the hash to accommodate.
static_assert(sizeof(Hash.CalculateHash()) * CHAR_BIT == 32);
setODRHash(Hash.CalculateHash() >> (32 - NumOdrHashBits));
return RecordDeclBits.ODRHash;
}

Expand Down
39 changes: 39 additions & 0 deletions clang/lib/AST/DeclCXX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "clang/AST/TypeLoc.h"
#include "clang/AST/UnresolvedSet.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticAST.h"
#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/LangOptions.h"
Expand Down Expand Up @@ -457,6 +458,10 @@ CXXRecordDecl::setBases(CXXBaseSpecifier const * const *Bases,
if (BaseClassDecl->hasMutableFields())
data().HasMutableFields = true;

if (BaseClassDecl->hasUninitializedExplicitInitFields() &&
BaseClassDecl->isAggregate())
setHasUninitializedExplicitInitFields(true);

if (BaseClassDecl->hasUninitializedReferenceMember())
data().HasUninitializedReferenceMember = true;

Expand Down Expand Up @@ -1113,6 +1118,9 @@ void CXXRecordDecl::addedMember(Decl *D) {
} else if (!T.isCXX98PODType(Context))
data().PlainOldData = false;

if (Field->hasAttr<ExplicitInitAttr>())
setHasUninitializedExplicitInitFields(true);

if (T->isReferenceType()) {
if (!Field->hasInClassInitializer())
data().HasUninitializedReferenceMember = true;
Expand Down Expand Up @@ -1372,6 +1380,10 @@ void CXXRecordDecl::addedMember(Decl *D) {
if (!FieldRec->hasCopyAssignmentWithConstParam())
data().ImplicitCopyAssignmentHasConstParam = false;

if (FieldRec->hasUninitializedExplicitInitFields() &&
FieldRec->isAggregate())
setHasUninitializedExplicitInitFields(true);

if (FieldRec->hasUninitializedReferenceMember() &&
!Field->hasInClassInitializer())
data().HasUninitializedReferenceMember = true;
Expand Down Expand Up @@ -2188,6 +2200,33 @@ void CXXRecordDecl::completeDefinition(CXXFinalOverriderMap *FinalOverriders) {
for (conversion_iterator I = conversion_begin(), E = conversion_end();
I != E; ++I)
I.setAccess((*I)->getAccess());

ASTContext &Context = getASTContext();

if (isAggregate() && hasUserDeclaredConstructor() &&
!Context.getLangOpts().CPlusPlus20) {
// Diagnose any aggregate behavior changes in C++20
for (const FieldDecl *FD : fields()) {
if (const auto *AT = FD->getAttr<ExplicitInitAttr>())
Context.getDiagnostics().Report(
AT->getLocation(),
diag::warn_cxx20_compat_requires_explicit_init_non_aggregate)
<< AT << FD << Context.getRecordType(this);
}
}

if (!isAggregate() && hasUninitializedExplicitInitFields()) {
// Diagnose any fields that required explicit initialization in a
// non-aggregate type. (Note that the fields may not be directly in this
// type, but in a subobject. In such cases we don't emit diagnoses here.)
for (const FieldDecl *FD : fields()) {
if (const auto *AT = FD->getAttr<ExplicitInitAttr>())
Context.getDiagnostics().Report(AT->getLocation(),
diag::warn_attribute_needs_aggregate)
<< AT << Context.getRecordType(this);
}
setHasUninitializedExplicitInitFields(false);
}
}

bool CXXRecordDecl::mayBeAbstract() const {
Expand Down
3 changes: 3 additions & 0 deletions clang/lib/CodeGen/CGDebugInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4829,6 +4829,9 @@ llvm::DILocalVariable *CGDebugInfo::EmitDeclare(const VarDecl *VD,
if (IPD->getParameterKind() == ImplicitParamKind::CXXThis ||
IPD->getParameterKind() == ImplicitParamKind::ObjCSelf)
Flags |= llvm::DINode::FlagObjectPointer;
} else if (const auto *PVD = dyn_cast<ParmVarDecl>(VD)) {
if (PVD->isExplicitObjectParameter())
Flags |= llvm::DINode::FlagObjectPointer;
}

// Note: Older versions of clang used to emit byval references with an extra
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/CodeGen/CGStmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ void CodeGenFunction::EmitStmt(const Stmt *S, ArrayRef<const Attr *> Attrs) {
cast<OMPParallelMasterTaskLoopSimdDirective>(*S));
break;
case Stmt::OMPParallelMaskedTaskLoopSimdDirectiveClass:
llvm_unreachable(
"parallel masked taskloop simd directive not supported yet.");
EmitOMPParallelMaskedTaskLoopSimdDirective(
cast<OMPParallelMaskedTaskLoopSimdDirective>(*S));
break;
case Stmt::OMPDistributeDirectiveClass:
EmitOMPDistributeDirective(cast<OMPDistributeDirective>(*S));
Expand Down
Loading
Loading