Skip to content

[AutoBump] Merge with e0e67a62 (Feb 17) (48) #592

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

Open
wants to merge 110 commits into
base: bump_to_5c93eb56
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
3063153
[clang-format] Fix a bug in annotating ObjCMethodSpecifier (#127159)
owenca Feb 15, 2025
66465c3
Revert "Make llvm::telemetry::Manager::preDispatch protected. (#1271…
kazutakahirata Feb 15, 2025
8fff0c1
[lldb] Add terminfo dependency for ncurses support (#126810)
ajordanr-google Feb 15, 2025
ed32d85
[lldb] Use async output & error stream for EvaluateExpression
JDevlieghere Feb 15, 2025
b24e140
[CI] Keep Track of Workflow Name Instead of Job Name
boomanaiden154 Feb 15, 2025
776fa2d
[lldb] Gardening in IOHandlerCurses (NFC)
JDevlieghere Feb 15, 2025
c30a7f4
[flang] Fix standalone builds against installed MLIR (#126387)
mgorny Feb 15, 2025
b6be53d
[ValueTracking] Test for not cond to assume (NFC)
andjo403 Feb 15, 2025
77b309d
[AST] Avoid repeated hash lookups (NFC) (#127299)
kazutakahirata Feb 15, 2025
8bdc312
[Index] Avoid repeated hash lookups (NFC) (#127300)
kazutakahirata Feb 15, 2025
42e0ee4
[Sema] Avoid repeated hash lookups (NFC) (#127301)
kazutakahirata Feb 15, 2025
9453b38
[clang-offload-packager] Avoid repeated hash lookups (NFC) (#127302)
kazutakahirata Feb 15, 2025
05209f1
[ExecutionEngine] Avoid repeated hash lookups (NFC) (#127303)
kazutakahirata Feb 15, 2025
7e7a362
[Hexagon] Avoid repeated map lookups (NFC) (#127304)
kazutakahirata Feb 15, 2025
4887e41
[libc++][NFC] Make enable_ifs in <optional> consistent (#127184)
philnik777 Feb 15, 2025
cffc1ac
[libc++] Avoid including <features.h> on arbitrary platforms (#125587)
ldionne Feb 15, 2025
8f3a070
[Clang] Add new WG21 papers(Hagenberg) papers to the C++ status page
cor3ntin Feb 15, 2025
70b95ca
[libc][math] Fix sqrtf128 implicit conversions. (#127154)
lntue Feb 15, 2025
2db2628
[MLIR] Fix mlirExecutionEngineLookup throwing assert on lookup fail (…
edg-l Feb 15, 2025
42ff31a
[X86] combineTargetShuffle - fold VPERMV3(HI,MASK,LO) -> VPERMV(COMMU…
RKSimon Feb 15, 2025
a6093d3
[libc++] Explicitly mention vector_bool in the name of benchmarks (#1…
ldionne Feb 15, 2025
88284e4
[RISCV] Support Zb*/P Shared Instructions (#127160)
realqhc Feb 15, 2025
21e956d
[CodeGen] Remove two dead pass initializer decls. NFC
darkbuck Feb 3, 2025
4664a4c
[LAA] Use getPointer/setPointer in createCheckForAccess (NFC).
fhahn Feb 15, 2025
bfdf30e
[AArch64] Add patterns for addv(sext) and addv(zext)
davemgreen Feb 15, 2025
b403004
ConstRange: factor and introduce splitPosNeg (NFC) (#126528)
artagnon Feb 15, 2025
948e97a
[flang] Revert MLIR_MAIN_SRC_DIR override (#127337)
mgorny Feb 15, 2025
e60de25
[LAA] Replace symbolic strides for translated pointers earlier (NFC).
fhahn Feb 15, 2025
c17df0a
[webkit.UncountedLambdaCapturesChecker] Fix a crash in declProtectsTh…
rniwa Feb 15, 2025
2472d38
[libc++] Move unused basic_string function definition to the dylib so…
philnik777 Feb 15, 2025
248716f
[libc++] Fixes (|multi)_set spaceship operator. (#127326)
mordante Feb 15, 2025
761d422
[HLSL] Implement HLSL intialization list support (#123141)
llvm-beanz Feb 15, 2025
07b0665
[Flang] Support overriding `LLVM_LIT_ARGS` in standalone builds (#127…
mgorny Feb 15, 2025
02fb976
[mlir] Improve GreedyPatternRewriteDriver logging (#127314)
banach-space Feb 15, 2025
ad948fa
[mlir][vector] Document `ConvertVectorStore` + unify var names (nfc) …
banach-space Feb 15, 2025
50581ef
[NFC] Fix warning in recent commit
llvm-beanz Feb 15, 2025
e5f4019
[AArch64] Add extending reduction costs for addlv and dot
davemgreen Feb 15, 2025
e5f5517
[VPlan] Create IR basic block for middle.block in VPlan.
fhahn Feb 15, 2025
256145b
[PowerPC] Use getSignedTargetConstant in SelectOptimalAddrMode. (#127…
topperc Feb 15, 2025
963ff1c
[mlir] lower min/maxnum to libdevice calls (#127323)
ftynse Feb 15, 2025
ed48398
[libc] Fill out generated malloc.h and related stdlib.h extensions (#…
frobtech Feb 16, 2025
3e3af86
[SandboxVec][DAG] Add MemDGNode::MemSuccs (#127253)
vporpo Feb 16, 2025
2157aec
[libc] Produce standard-compliant header guard macros in hdrgen (#127…
frobtech Feb 16, 2025
c6d95c4
[libc++] Fix initialization-order-fiasco with iostream.cpp constructo…
vitalybuka Feb 16, 2025
dbc98cf
[libclc] [cmake] Fix per-target *_convert.cl dependencies (#127315)
mgorny Feb 16, 2025
538b8f8
[Clang] [NFC] Remove outdated FIXME (#126978)
MagentaTreehouse Feb 16, 2025
a422bc7
[InstCombine] Test for trunc to i1 in foldSelectICmpAndBinOp. (NFC)
andjo403 Feb 16, 2025
d64cf19
[clang][bytecode] Add Descriptor::dumpFull (#127386)
tbaederr Feb 16, 2025
e8d8488
[clang][bytecode] Fix dynamic array allocation return values (#127387)
tbaederr Feb 16, 2025
dab9156
[X86] Add missing explicit conversion for AMXAVX512 and SHA (#127385)
phoebewang Feb 16, 2025
29f3a35
[InstCombine] Do not keep samesign when speculatively executing icmps…
dtcxzyw Feb 16, 2025
54f3713
[Flang][NFC] Move runtime library files to flang-rt (#110298)
Meinersbur Feb 16, 2025
a1120c9
[AMDGPU] NFC: Fix some details for lit test (#127141)
jrbyrnes Feb 16, 2025
8ac5d2d
ConstRange: test edge-cases of makeAllowedICmpRegion (#127080)
artagnon Feb 16, 2025
81c85ea
[flang-rt] Fix aarch64-libcxx build failure
Meinersbur Feb 16, 2025
9c4ef23
[InstCombine] Test foldSelectICmpAnd with extra uses. (NFC)
andjo403 Feb 16, 2025
552e465
[Clang][NFCI] Fix a logic issue in TransformDesignatedInitExpr (#127211)
GS-GOAT Feb 16, 2025
79d8a34
[mlir] add some FP classification ops and their lowering to libdevice…
ftynse Feb 16, 2025
c01c3cf
[ARM] Fix MRC cp10 and cp11 warning (#126407)
hstk30-hw Feb 16, 2025
17d508f
[InstCombine] Test foldSelectICmpAnd with cast. (NFC)
andjo403 Feb 16, 2025
b55f751
[Flang] LLVM_ENABLE_RUNTIMES=flang-rt (#110217)
Meinersbur Feb 16, 2025
9f6b7b4
[analyzer] StackAddrEscapeChecker: also check return for child stack …
Flandini Feb 16, 2025
1c87e47
[AST] Avoid repeated map lookups (NFC) (#127369)
kazutakahirata Feb 16, 2025
0bae0bf
[clang-tidy] Avoid repeated hash lookups (NFC) (#127370)
kazutakahirata Feb 16, 2025
8d75246
[AMDGPU] Avoid repeated hash lookups (NFC) (#127371)
kazutakahirata Feb 16, 2025
0323554
[GlobalISel] Avoid repeated hash lookups (NFC) (#127372)
kazutakahirata Feb 16, 2025
e81f7ca
[TableGen] Avoid repeated hash lookups (NFC) (#127373)
kazutakahirata Feb 16, 2025
ec880b1
[X86] Avoid repeated map lookups (NFC) (#127374)
kazutakahirata Feb 16, 2025
d235b72
Reapply "[Analyzer][CFG] Correctly handle rebuilt default arg and def…
yronglin Feb 16, 2025
6812fc0
[mlir][affine] make affine-loop-unroll-jam interface pass (#127402)
linuxlonelyeagle Feb 16, 2025
6e94007
[llvm] Remove `br i1 undef` in some `llvm/test/CodeGen` tests (#127368)
Yeaseen Feb 16, 2025
e080366
[LAA] Inline hasComputableBounds in only caller, simplify isNoWrap.
fhahn Feb 16, 2025
f5d63cc
[LICM] Add test with deref assumption of GEP.
fhahn Feb 16, 2025
c22d84f
[ELF] Refine ctx.arg.exportDynamic condition
MaskRay Feb 16, 2025
6273877
[lld] enable installing lld headers and libraries as part of distribu…
makslevental Feb 16, 2025
b4f91b0
[LV] Use IRBuilder::insert to insert VPWidenRecipe (NFC).
fhahn Feb 16, 2025
f75126e
[FreeBSD] Support -stdlib=libstdc++
arichardson Feb 16, 2025
7817045
[RISCV] Support [mh]edelegh CSRs (#121634)
dong-miao Feb 16, 2025
01b7e65
[FreeBSD] Fix comparison in f75126eeabba13ce2aab53c2e4296fca12b9da0d
arichardson Feb 16, 2025
d150101
[Hexagon] Use MCRegister. NFC
topperc Feb 16, 2025
26fc2e9
[Mips] Use MCRegisterClass::getRegister() instead of begin()+RegNo. NFC
topperc Feb 16, 2025
a7a0208
[flang] Assert the Options fit into the storage bits (#126169)
fmayer Feb 16, 2025
ecb7f5a
[mlir][linalg] Update docs for `linalg.generic`(NFC) (#127178)
CoTinker Feb 17, 2025
9e8cd73
[Mips] Use MCRegister. NFC
topperc Feb 16, 2025
69f3e00
[MLIR] NFC. Refactor IntegerRelation getSliceBounds (#127308)
bondhugula Feb 17, 2025
885382f
[clang-format] Fix a bug in annotating braces (#127306)
owenca Feb 17, 2025
5d62a79
[Serialization] Remove getMacroID (#127413)
kazutakahirata Feb 17, 2025
9b7282e
[RISCV] Recognize de-interleave shuffles with 2 sources. (#127272)
topperc Feb 17, 2025
c3cae9d
[clang][bytecode] Fix const-ness of local primitive temporary (#127405)
tbaederr Feb 17, 2025
06a3abd
[AMDGPU][NewPM] Port "SIFormMemoryClauses" to NPM (#127181)
vikramRH Feb 17, 2025
f1627e1
[clang][bytecode][NFC] Move reduced libcxx tests to a subdir (#127438)
tbaederr Feb 17, 2025
02d4aac
[AMDGPU] Remove materializeImmediate (#127420)
kazutakahirata Feb 17, 2025
36f8c8b
[clang][bytecode] Fix rejecting non-constexpr array ctors (#127448)
tbaederr Feb 17, 2025
de06978
[AMDGPU] Avoid repeated hash lookups (NFC) (#127445)
kazutakahirata Feb 17, 2025
86d8222
[dsymutil] Avoid repeated hash lookups (NFC) (#127449)
kazutakahirata Feb 17, 2025
153dd19
[SelectionDAG] Remove lowerCallToExternalSymbol (#127408)
kazutakahirata Feb 17, 2025
b16ce8f
[X86] getFauxShuffleMask - match 256-bit CONCAT(SUB0, SUB1) 64-bit el…
RKSimon Feb 17, 2025
6684a59
[analyzer][NFC] Trivial cleanup in ArrayBoundChecker (#126941)
NagyDonat Feb 17, 2025
94585dc
[X86] Add test coverage for #116931
RKSimon Feb 17, 2025
948a847
[WebAssembly] Recognise EXTEND_HIGH (#123325)
sparker-arm Feb 17, 2025
ea7897a
[WebAssembly] Enable interleaved memory accesses (#125696)
sparker-arm Feb 17, 2025
e0545b5
[Analysis] Remove getGuaranteedWellDefinedOps (#127453)
kazutakahirata Feb 17, 2025
b9c6d3e
[clang-linker-wrapper] Avoid repeated hash lookups (NFC) (#127443)
kazutakahirata Feb 17, 2025
ff4e21f
[clang-tidy] Avoid repeated hash lookups (NFC) (#127444)
kazutakahirata Feb 17, 2025
fb14638
[DebugInfo] Avoid repeated hash lookups (NFC) (#127446)
kazutakahirata Feb 17, 2025
d497766
[Hexagon] Avoid repeated map lookups (NFC) (#127447)
kazutakahirata Feb 17, 2025
82dc2d4
[clang][Modules] Remove a resloved issue from StandardCPlusPlusModule…
hokein Feb 17, 2025
262e4c1
Revert "[clang][Modules] Remove a resloved issue from StandardCPlusPl…
hokein Feb 17, 2025
e0e67a6
[LV] Add initial support for vectorizing literal struct return values…
MacDue Feb 17, 2025
336fabf
[AutoBump] Merge with e0e67a62 (Feb 17)
jorickert Jun 17, 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: 3 additions & 1 deletion .ci/metrics/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class JobMetrics:
status: int
created_at_ns: int
workflow_id: int
workflow_name: str


@dataclass
Expand Down Expand Up @@ -199,6 +200,7 @@ def get_per_workflow_metrics(
job_result,
created_at_ns,
workflow_run.id,
workflow_run.name,
)
)

Expand Down Expand Up @@ -278,7 +280,7 @@ def main():
for workflow_metric in reversed(current_metrics):
if isinstance(workflow_metric, JobMetrics):
workflows_to_track[
workflow_metric.job_name
workflow_metric.workflow_name
] = workflow_metric.workflow_id

time.sleep(SCRAPE_INTERVAL_SECONDS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,15 @@ static bool checkOverrideByDerivedMethod(const CXXMethodDecl *BaseMD,

bool VirtualNearMissCheck::isPossibleToBeOverridden(
const CXXMethodDecl *BaseMD) {
auto Iter = PossibleMap.find(BaseMD);
if (Iter != PossibleMap.end())
auto [Iter, Inserted] = PossibleMap.try_emplace(BaseMD);
if (!Inserted)
return Iter->second;

bool IsPossible = !BaseMD->isImplicit() && !isa<CXXConstructorDecl>(BaseMD) &&
!isa<CXXDestructorDecl>(BaseMD) && BaseMD->isVirtual() &&
!BaseMD->isOverloadedOperator() &&
!isa<CXXConversionDecl>(BaseMD);
PossibleMap[BaseMD] = IsPossible;
Iter->second = IsPossible;
return IsPossible;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ void IncludeModernizePPCallbacks::InclusionDirective(
// 2. Insert `using namespace std;` to the beginning of TU.
// 3. Do nothing and let the user deal with the migration himself.
SourceLocation DiagLoc = FilenameRange.getBegin();
if (CStyledHeaderToCxx.count(FileName) != 0) {
IncludesToBeProcessed.emplace_back(
IncludeMarker{CStyledHeaderToCxx[FileName], FileName,
FilenameRange.getAsRange(), DiagLoc});
if (auto It = CStyledHeaderToCxx.find(FileName);
It != CStyledHeaderToCxx.end()) {
IncludesToBeProcessed.emplace_back(IncludeMarker{
It->second, FileName, FilenameRange.getAsRange(), DiagLoc});
} else if (DeleteHeaders.count(FileName) != 0) {
IncludesToBeProcessed.emplace_back(
// NOLINTNEXTLINE(modernize-use-emplace) - false-positive
Expand Down
4 changes: 4 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ Code Completion
Static Analyzer
---------------

- Clang currently support extending lifetime of object bound to
reference members of aggregates in CFG and ExprEngine, that are
created from default member initializer.

New features
^^^^^^^^^^^^

Expand Down
2 changes: 0 additions & 2 deletions clang/include/clang/AST/Redeclarable.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ class Redeclarable {

bool isFirst() const {
return isa<KnownLatest>(Link) ||
// FIXME: 'template' is required on the next line due to an
// apparent clang bug.
isa<UninitializedLatest>(cast<NotKnownLatest>(Link));
}

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 @@ -12626,6 +12626,9 @@ def err_hlsl_pointers_unsupported : Error<
"%select{pointers|references}0 are unsupported in HLSL">;
def err_hlsl_missing_resource_class : Error<"HLSL resource needs to have [[hlsl::resource_class()]] attribute">;
def err_hlsl_attribute_needs_intangible_type: Error<"attribute %0 can be used only on HLSL intangible type %1">;
def err_hlsl_incorrect_num_initializers: Error<
"too %select{few|many}0 initializers in list for type %1 "
"(expected %2 but found %3)">;

def err_hlsl_operator_unsupported : Error<
"the '%select{&|*|->}0' operator is unsupported in HLSL">;
Expand Down
5 changes: 5 additions & 0 deletions clang/include/clang/Sema/SemaHLSL.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
namespace clang {
class AttributeCommonInfo;
class IdentifierInfo;
class InitializedEntity;
class InitializationKind;
class ParsedAttr;
class Scope;
class VarDecl;
Expand Down Expand Up @@ -149,6 +151,9 @@ class SemaHLSL : public SemaBase {

QualType getInoutParameterType(QualType Ty);

bool TransformInitList(const InitializedEntity &Entity,
const InitializationKind &Kind, InitListExpr *Init);

private:
// HLSL resource type attributes need to be processed all at once.
// This is a list to collect them.
Expand Down
3 changes: 0 additions & 3 deletions clang/include/clang/Serialization/ASTWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -751,9 +751,6 @@ class ASTWriter : public ASTDeserializationListener,
/// Get the unique number used to refer to the given macro.
serialization::MacroID getMacroRef(MacroInfo *MI, const IdentifierInfo *Name);

/// Determine the ID of an already-emitted macro.
serialization::MacroID getMacroID(MacroInfo *MI);

uint32_t getMacroDirectivesOffset(const IdentifierInfo *Name);

/// Emit a reference to a type.
Expand Down
5 changes: 3 additions & 2 deletions clang/lib/AST/ByteCode/Compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2707,7 +2707,8 @@ bool Compiler<Emitter>::VisitMaterializeTemporaryExpr(

// For everyhing else, use local variables.
if (SubExprT) {
unsigned LocalIndex = allocateLocalPrimitive(E, *SubExprT, /*IsConst=*/true,
bool IsConst = SubExpr->getType().isConstQualified();
unsigned LocalIndex = allocateLocalPrimitive(E, *SubExprT, IsConst,
/*IsExtended=*/true);
if (!this->visit(SubExpr))
return false;
Expand Down Expand Up @@ -3028,7 +3029,7 @@ bool Compiler<Emitter>::VisitCXXConstructExpr(const CXXConstructExpr *E) {

size_t NumElems = CAT->getZExtSize();
const Function *Func = getFunction(E->getConstructor());
if (!Func || !Func->isConstexpr())
if (!Func)
return false;

// FIXME(perf): We're calling the constructor once per array element here,
Expand Down
1 change: 1 addition & 0 deletions clang/lib/AST/ByteCode/Descriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ struct Descriptor final {

void dump() const;
void dump(llvm::raw_ostream &OS) const;
void dumpFull(unsigned Offset = 0, unsigned Indent = 0) const;
};

/// Bitfield tracking the initialisation status of elements of primitive arrays.
Expand Down
32 changes: 32 additions & 0 deletions clang/lib/AST/ByteCode/Disasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,38 @@ LLVM_DUMP_METHOD void Descriptor::dump(llvm::raw_ostream &OS) const {
OS << " dummy";
}

/// Dump descriptor, including all valid offsets.
LLVM_DUMP_METHOD void Descriptor::dumpFull(unsigned Offset,
unsigned Indent) const {
unsigned Spaces = Indent * 2;
llvm::raw_ostream &OS = llvm::errs();
OS.indent(Spaces);
dump(OS);
OS << '\n';
OS.indent(Spaces) << "Metadata: " << getMetadataSize() << " bytes\n";
OS.indent(Spaces) << "Size: " << getSize() << " bytes\n";
OS.indent(Spaces) << "AllocSize: " << getAllocSize() << " bytes\n";
Offset += getMetadataSize();
if (isCompositeArray()) {
OS.indent(Spaces) << "Elements: " << getNumElems() << '\n';
unsigned FO = Offset;
for (unsigned I = 0; I != getNumElems(); ++I) {
FO += sizeof(InlineDescriptor);
assert(ElemDesc->getMetadataSize() == 0);
OS.indent(Spaces) << "Element " << I << " offset: " << FO << '\n';
ElemDesc->dumpFull(FO, Indent + 1);

FO += ElemDesc->getAllocSize();
}
} else if (isRecord()) {
ElemRecord->dump(OS, Indent + 1, Offset);
} else if (isPrimitive()) {
} else {
}

OS << '\n';
}

LLVM_DUMP_METHOD void InlineDescriptor::dump(llvm::raw_ostream &OS) const {
{
ColorScope SC(OS, true, {llvm::raw_ostream::BLUE, true});
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/AST/ByteCode/DynamicAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Block *DynamicAllocator::allocate(const Expr *Source, PrimType T,
Block *DynamicAllocator::allocate(const Descriptor *ElementDesc,
size_t NumElements, unsigned EvalID,
Form AllocForm) {
assert(ElementDesc->getMetadataSize() == 0);
// Create a new descriptor for an array of the specified size and
// element type.
const Descriptor *D = allocateDescriptor(
Expand All @@ -72,6 +73,7 @@ Block *DynamicAllocator::allocate(const Descriptor *D, unsigned EvalID,
auto *B = new (Memory.get()) Block(EvalID, D, /*isStatic=*/false);
B->invokeCtor();

assert(D->getMetadataSize() == sizeof(InlineDescriptor));
InlineDescriptor *ID = reinterpret_cast<InlineDescriptor *>(B->rawData());
ID->Desc = D;
ID->IsActive = true;
Expand Down
9 changes: 2 additions & 7 deletions clang/lib/AST/ByteCode/Interp.h
Original file line number Diff line number Diff line change
Expand Up @@ -2896,9 +2896,7 @@ inline bool Alloc(InterpState &S, CodePtr OpPC, const Descriptor *Desc) {
Block *B = Allocator.allocate(Desc, S.Ctx.getEvalID(),
DynamicAllocator::Form::NonArray);
assert(B);

S.Stk.push<Pointer>(B);

return true;
}

Expand All @@ -2923,8 +2921,7 @@ inline bool AllocN(InterpState &S, CodePtr OpPC, PrimType T, const Expr *Source,
Allocator.allocate(Source, T, static_cast<size_t>(NumElements),
S.Ctx.getEvalID(), DynamicAllocator::Form::Array);
assert(B);
S.Stk.push<Pointer>(B, sizeof(InlineDescriptor));

S.Stk.push<Pointer>(B);
return true;
}

Expand All @@ -2950,9 +2947,7 @@ inline bool AllocCN(InterpState &S, CodePtr OpPC, const Descriptor *ElementDesc,
Allocator.allocate(ElementDesc, static_cast<size_t>(NumElements),
S.Ctx.getEvalID(), DynamicAllocator::Form::Array);
assert(B);

S.Stk.push<Pointer>(B, sizeof(InlineDescriptor));

S.Stk.push<Pointer>(B);
return true;
}

Expand Down
41 changes: 21 additions & 20 deletions clang/lib/AST/ByteCode/InterpBuiltin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1655,49 +1655,50 @@ static bool interp__builtin_operator_new(InterpState &S, CodePtr OpPC,
return false;
}

bool IsArray = NumElems.ugt(1);
std::optional<PrimType> ElemT = S.getContext().classify(ElemType);
DynamicAllocator &Allocator = S.getAllocator();
if (ElemT) {
if (NumElems.ule(1)) {
const Descriptor *Desc =
S.P.createDescriptor(NewCall, *ElemT, Descriptor::InlineDescMD,
/*IsConst=*/false, /*IsTemporary=*/false,
/*IsMutable=*/false);
Block *B = Allocator.allocate(Desc, S.getContext().getEvalID(),
if (IsArray) {
Block *B = Allocator.allocate(NewCall, *ElemT, NumElems.getZExtValue(),
S.Ctx.getEvalID(),
DynamicAllocator::Form::Operator);
assert(B);

S.Stk.push<Pointer>(B);
S.Stk.push<Pointer>(Pointer(B).atIndex(0));
return true;
}
assert(NumElems.ugt(1));

Block *B =
Allocator.allocate(NewCall, *ElemT, NumElems.getZExtValue(),
S.Ctx.getEvalID(), DynamicAllocator::Form::Operator);
const Descriptor *Desc =
S.P.createDescriptor(NewCall, *ElemT, Descriptor::InlineDescMD,
/*IsConst=*/false, /*IsTemporary=*/false,
/*IsMutable=*/false);
Block *B = Allocator.allocate(Desc, S.getContext().getEvalID(),
DynamicAllocator::Form::Operator);
assert(B);

S.Stk.push<Pointer>(B);
return true;
}

assert(!ElemT);
// Structs etc.
const Descriptor *Desc = S.P.createDescriptor(
NewCall, ElemType.getTypePtr(), Descriptor::InlineDescMD,
NewCall, ElemType.getTypePtr(),
IsArray ? std::nullopt : Descriptor::InlineDescMD,
/*IsConst=*/false, /*IsTemporary=*/false, /*IsMutable=*/false,
/*Init=*/nullptr);

if (NumElems.ule(1)) {
Block *B = Allocator.allocate(Desc, S.getContext().getEvalID(),
DynamicAllocator::Form::Operator);
if (IsArray) {
Block *B =
Allocator.allocate(Desc, NumElems.getZExtValue(), S.Ctx.getEvalID(),
DynamicAllocator::Form::Operator);
assert(B);
S.Stk.push<Pointer>(B);
S.Stk.push<Pointer>(Pointer(B).atIndex(0));
return true;
}

Block *B =
Allocator.allocate(Desc, NumElems.getZExtValue(), S.Ctx.getEvalID(),
DynamicAllocator::Form::Operator);
Block *B = Allocator.allocate(Desc, S.getContext().getEvalID(),
DynamicAllocator::Form::Operator);
assert(B);
S.Stk.push<Pointer>(B);
return true;
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/AST/ByteCode/Program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,8 @@ Descriptor *Program::createDescriptor(const DeclTy &D, const Type *Ty,
return allocateDescriptor(D, *T, MDSize, IsTemporary,
Descriptor::UnknownSize{});
} else {
const Descriptor *Desc = createDescriptor(D, ElemTy.getTypePtr(),
MDSize, IsConst, IsTemporary);
const Descriptor *Desc = createDescriptor(
D, ElemTy.getTypePtr(), std::nullopt, IsConst, IsTemporary);
if (!Desc)
return nullptr;
return allocateDescriptor(D, Desc, MDSize, IsTemporary,
Expand Down
12 changes: 12 additions & 0 deletions clang/lib/AST/DeclCXX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1462,6 +1462,18 @@ void CXXRecordDecl::addedMember(Decl *D) {
if (Using->getDeclName().getCXXOverloadedOperator() == OO_Equal)
data().HasInheritedAssignment = true;
}

// HLSL: All user-defined data types are aggregates and use aggregate
// initialization, meanwhile most, but not all built-in types behave like
// aggregates. Resource types, and some other HLSL types that wrap handles
// don't behave like aggregates. We can identify these as different because we
// implicitly define "special" member functions, which aren't spellable in
// HLSL. This all _needs_ to change in the future. There are two
// relevant HLSL feature proposals that will depend on this changing:
// * 0005-strict-initializer-lists.md
// * https://github.com/microsoft/hlsl-specs/pull/325
if (getLangOpts().HLSL)
data().Aggregate = data().UserDeclaredSpecialMembers == 0;
}

bool CXXRecordDecl::isLiteral() const {
Expand Down
16 changes: 7 additions & 9 deletions clang/lib/AST/ExternalASTMerger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,16 +206,14 @@ class LazyASTImporter : public ASTImporter {
<< "\n";
Source<DeclContext *> FromDC(
cast<DeclContext>(From)->getPrimaryContext());
if (FromOrigins.count(FromDC) &&
Parent.HasImporterForOrigin(*FromOrigins.at(FromDC).AST)) {
if (auto It = FromOrigins.find(FromDC);
It != FromOrigins.end() &&
Parent.HasImporterForOrigin(*It->second.AST)) {
if (LoggingEnabled)
logs() << "(ExternalASTMerger*)" << (void*)&Parent
<< " forced origin (DeclContext*)"
<< (void*)FromOrigins.at(FromDC).DC
<< ", (ASTContext*)"
<< (void*)FromOrigins.at(FromDC).AST
<< "\n";
Parent.ForceRecordOrigin(ToDC, FromOrigins.at(FromDC));
logs() << "(ExternalASTMerger*)" << (void *)&Parent
<< " forced origin (DeclContext*)" << (void *)It->second.DC
<< ", (ASTContext*)" << (void *)It->second.AST << "\n";
Parent.ForceRecordOrigin(ToDC, It->second);
} else {
if (LoggingEnabled)
logs() << "(ExternalASTMerger*)" << (void*)&Parent
Expand Down
17 changes: 17 additions & 0 deletions clang/lib/AST/ParentMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "clang/AST/ParentMap.h"
#include "clang/AST/Decl.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/StmtObjC.h"
#include "llvm/ADT/DenseMap.h"

Expand Down Expand Up @@ -103,6 +104,22 @@ static void BuildParentMap(MapTy& M, Stmt* S,
BuildParentMap(M, SubStmt, OVMode);
}
break;
case Stmt::CXXDefaultArgExprClass:
if (auto *Arg = dyn_cast<CXXDefaultArgExpr>(S)) {
if (Arg->hasRewrittenInit()) {
M[Arg->getExpr()] = S;
BuildParentMap(M, Arg->getExpr(), OVMode);
}
}
break;
case Stmt::CXXDefaultInitExprClass:
if (auto *Init = dyn_cast<CXXDefaultInitExpr>(S)) {
if (Init->hasRewrittenInit()) {
M[Init->getExpr()] = S;
BuildParentMap(M, Init->getExpr(), OVMode);
}
}
break;
default:
for (Stmt *SubStmt : S->children()) {
if (SubStmt) {
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/AST/VTableBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2115,8 +2115,8 @@ void ItaniumVTableBuilder::dumpLayout(raw_ostream &Out) {

// Dump the next address point.
uint64_t NextIndex = Index + 1;
if (AddressPointsByIndex.count(NextIndex)) {
if (AddressPointsByIndex.count(NextIndex) == 1) {
if (unsigned Count = AddressPointsByIndex.count(NextIndex)) {
if (Count == 1) {
const BaseSubobject &Base =
AddressPointsByIndex.find(NextIndex)->second;

Expand Down
Loading