Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
3cdb30e
[Clang][Sema] Use the correct lookup context when building overloaded…
sdkrystian Sep 9, 2024
db6051d
[analyzer] fix crash on binding to symbolic region with `void *` type…
pskrgag Sep 9, 2024
95753ff
[gn build] Port ea2da571c761
llvmgnsyncbot Sep 9, 2024
5c8fd1e
[lld][WebAssembly] Fix use of uninitialized stack data with --wasm64 …
sbc100 Sep 9, 2024
60f052e
[CMake] Passthrough variables for packages to subbuilds (#107611)
petrhosek Sep 9, 2024
7d37172
[NFCI][BitcodeReader]Read real GUID from VI as opposed to storing it …
mingmingl-llvm Sep 9, 2024
c36c462
[LTO] Simplify calculateCallGraphRoot (NFC) (#107765)
kazutakahirata Sep 9, 2024
95831f0
[ARM] Add a default unreachable case to AddrModeToString. NFC
davemgreen Sep 9, 2024
7f90479
[flang][OpenMP] Don't abort when default is used on an invalid direct…
luporl Sep 9, 2024
7543d09
[llvm-ml] Fix RIP-relative addressing for ptr operands (#107618)
nga888 Sep 9, 2024
cd8229b
[flang][cuda] Support c_devptr in c_f_pointer intrinsic (#107470)
clementval Sep 9, 2024
6cc0138
Fix implicit conversion rank ordering (#106811)
llvm-beanz Sep 9, 2024
34e3007
[ARM] Fix a warning
kazutakahirata Sep 9, 2024
0f349b7
[HLSL] Implement support for HLSL intrinsic - select (#107129)
spall Sep 9, 2024
5f74671
[flang][Driver] Support -Xlinker in flang (#107472)
tarunprabhu Sep 9, 2024
6850410
[Coverage] Ignore unused functions if the count is 0. (#107661)
ZequanWu Sep 9, 2024
4a501a4
[CUDA/HIP] propagate -cuid to a host-only compilation. (#107483)
Artem-B Sep 9, 2024
2773719
[libc][bazel] Update bazel overlay for math functions and their tests…
lntue Sep 9, 2024
09b231c
Re-apply "[NFCI][LTO][lld] Optimize away symbol copies within LTO glo…
mingmingl-llvm Sep 9, 2024
b1b9b7b
[libc++] Cache file attributes during directory iteration (#93316)
ed-sat Sep 9, 2024
048e46a
[clang, hexagon] Update copyright, license text (#107161)
androm3da Sep 9, 2024
02fff93
[MLGO] Remove unused imports
boomanaiden154 Sep 9, 2024
a7c26aa
Revert "[Coverage] Ignore unused functions if the count is 0." (#107901)
ZequanWu Sep 9, 2024
99ea357
[MLGO] Fix logging verbosity in scripts (#107818)
boomanaiden154 Sep 9, 2024
78c1009
[NFC][TableGen] DirectiveEmitter code cleanup (#107775)
jurahul Sep 9, 2024
eec1ee8
[SystemZ][z/OS] Enable lit testing for z/OS (#107631)
abhina-sree Sep 9, 2024
6776d65
[libc++] Implement LWG3953 (#107535)
NoumanAmir657 Sep 9, 2024
ab82f83
[LTO][NFC] Fix forward declaration (#107902)
mingmingl-llvm Sep 9, 2024
3681d85
Revert "[Clang][Sema] Use the correct lookup context when building ov…
nikic Sep 9, 2024
98815f7
[clang][docs] Add clang-tutor to External Clang Examples (#107665)
c8ef Sep 9, 2024
e62bf7c
[z/OS] Set the default arch for z/OS to be arch10 (#89854)
perry-ca Sep 9, 2024
b3d2d50
[SLP][NFC]Reorder code for better structural complexity, NFC
alexey-bataev Sep 9, 2024
985600d
[TableGen] Migrate CodeGenHWModes to use const RecordKeeper (#107851)
jurahul Sep 9, 2024
3f22756
[DirectX] Lower `@llvm.dx.typedBufferLoad` to DXIL ops
bogner Sep 9, 2024
3403438
[VPlan] Consistently use VTC for vector trip count in vplan-printing.ll.
fhahn Sep 9, 2024
53a81d4
Reland [asan][windows] Eliminate the static asan runtime on windows (…
Sep 9, 2024
6f8d278
[SandboxIR] Add missing VectorType functions (#107650)
Sterling-Augustine Sep 9, 2024
d9a9960
[scudo] Add fragmentation info for each memory group (#107475)
ChiaHungDuan Sep 9, 2024
66e9078
[LTO] Fix a use-after-free in legacy LTO C APIs (#107896)
cachemeifyoucan Sep 9, 2024
a9a5a18
[SPIRV] Add sign intrinsic part 1 (#101987)
tgymnich Sep 9, 2024
bdf0224
[TableGen] Change CGIOperandList::OperandInfo::Rec to const pointer (…
jurahul Sep 9, 2024
f12e10b
[SandboxVec] Implement Pass class (#107617)
Sep 9, 2024
26b786a
[NVPTX] Restrict combining to properly aligned v16i8 vectors. (#107919)
Artem-B Sep 9, 2024
d148a1a
[X86] Add tests support shifts + and in `LowerSELECTWithCmpZero`; NFC
goldsteinn Sep 9, 2024
88bd507
[X86] Handle shifts + and in `LowerSELECTWithCmpZero`
goldsteinn Sep 9, 2024
33c1325
[PAC] Make __is_function_overridden pauth-aware on ELF platforms (#10…
asl Sep 9, 2024
ae02211
[SandboxIR] Implement UndefValue (#107628)
Sep 9, 2024
81ef8e2
[NFC][sanitizer] Extract GetDTLSRange (#107934)
vitalybuka Sep 10, 2024
b0d2411
[NVPTX] Support copysign PTX instruction (#107800)
AlexMaclean Sep 10, 2024
3b22618
[ctx_prof] Insert the ctx prof flattener after the module inliner (#1…
mtrofin Sep 10, 2024
f3b4e47
[mlir][linalg][NFC] Drop redundant rankReductionStrategy (#107875)
CoTinker Sep 10, 2024
a111f91
[LoongArch][ISel] Check the number of sign bits in `PatGprGpr_32` (#…
dtcxzyw Sep 10, 2024
f7479b5
[NFC][TableGen] Simplify DirectiveEmitter using range for loops (#107…
jurahul Sep 10, 2024
e64a1c0
Fix unintended extra commit in PR #107499
mtrofin Sep 10, 2024
1ca411c
[LoongArch] Codegen for concat_vectors with LASX
wangleiat Sep 10, 2024
7a8e9df
[bazel][libc][NFC] Add missing layering deps (#107947)
rupprecht Sep 10, 2024
761bf33
[LLVM][Coroutines] Switch CoroAnnotationElidePass to a FunctionPass (…
yuxuanchen1997 Sep 10, 2024
eb0e4b1
[Fuzzer] Passthrough zlib CMake paths into the test (#107926)
petrhosek Sep 10, 2024
ffcff4a
[ValueTracking] Infer is-power-of-2 from assumptions. (#107745)
dtcxzyw Sep 10, 2024
56905da
[clang] fix half && bfloat16 convert node expr codegen (#89051)
JinjinLi868 Sep 10, 2024
dce5039
[clang][HLSL] Add sign intrinsic part 3 (#101989)
tgymnich Sep 10, 2024
02ab435
[bazel][libc][NFC] Add missing dep for standalone compile (#107957)
rupprecht Sep 10, 2024
7034ec4
[ORC] Remove EDU from dependants list of dependencies before destroying.
lhames Sep 10, 2024
094e6b8
[IR] Make UnaryInstruction::classof recognize FreezeInst. (#107944)
slackito Sep 10, 2024
4926835
[LLDB][Minidump] Support minidumps where there are multiple exception…
Jlalond Sep 10, 2024
3928ede
[clang][bytecode] Fix local destructor order (#107951)
tbaederr Sep 10, 2024
462251b
[ORC-RT] Replace FnTag arg of WrapperFunction::call with generic disp…
lhames Sep 10, 2024
9b67c99
[ORC-RT] Fix typo in 462251b80b7.
lhames Sep 10, 2024
b71d88c
[RISCV] Constrain passthru regclass in vmerge -> vmv peephole
lukel97 Sep 10, 2024
7ba6768
Revert "[RISCV] Update V0Defs after moving Src in peepholes (#107359)"
lukel97 Sep 10, 2024
ed0da00
[libc++][string] Remove potential non-trailing 0-length array (#105865)
serge-sans-paille Sep 10, 2024
06c3311
[PowerPC] Implement llvm.set.rounding intrinsic (#67302)
ecnelises Sep 10, 2024
bece0d7
[GlobalIsel] Update MIR gallery (#107903)
tschuett Sep 10, 2024
1c334de
[llvm][Support] Determine the max thread length on Haiku (#107801)
brad0 Sep 10, 2024
1581183
Revert "[llvm-ml] Fix RIP-relative addressing for ptr operands (#1076…
mstorsjo Sep 10, 2024
958f59d
[MLIR] Make `resolveCallable` customizable in `CallOpInterface` (#100…
xlauko Sep 10, 2024
831236e
[MLIR][NVVM] Add support for nvvm.breakpoint Op (#107193)
schwarzschild-radius Sep 10, 2024
53d35c4
Revert "[ORC-RT] Replace FnTag arg of WrapperFunction::call with gene…
metaflow Sep 10, 2024
7574042
Revert "[MLIR] Make `resolveCallable` customizable in `CallOpInterfac…
matthias-springer Sep 10, 2024
8aeb104
[mlir][SME] Update E2E test to show optional loop optimisation (NFC) …
nujaa Sep 10, 2024
7e07c1d
[DAG] expandAVG - consistently use getShiftAmountConstant for constan…
RKSimon Sep 9, 2024
918222b
[MLIR] Add f6E3M2FN type (#105573)
sergey-kozub Sep 10, 2024
083e25c
[MLIR] [NFC] Use APFloat semantics to get floating type width (#107372)
sergey-kozub Sep 10, 2024
0f47e3a
[LoongArch] Eliminate the redundant sign extension of division (#107971)
heiher Sep 10, 2024
bf69484
[VectorCombine] Add type shrinking and zext propagation for fixed-wid…
igogo-x86 Sep 10, 2024
edbe8fa
[llvm][Docs] Update guide to include ``pip install lit`` (#106526)
MichelleCDjunaidi Sep 10, 2024
a99d666
[MLIR][OpenMP] Replace index-based loop (NFC) (#107878)
skatrak Sep 10, 2024
a794ee4
[VPlan] Add VPValue for VF, use it for VPWidenIntOrFpInductionRecipe.…
fhahn Sep 10, 2024
2778d9d
[TOSA] tosa.negate operator lowering update (#107924)
d-smirnov Sep 10, 2024
69f8923
Re-apply "[ORC-RT] Replace FnTag arg of WrapperFunction::call..." wit…
lhames Sep 10, 2024
23595d1
[AArch64] Lower __builtin_bswap16 to rev16 if bswap followed by any_e…
adprasad-nvidia Sep 10, 2024
516f08b
[LLVM][AArch64] Refactor sve-b16b16 instruction definitions. (#107265)
paulwalker-arm Sep 10, 2024
433ca3e
[Flang][Lower] Introduce SymMapScope helper class (NFC) (#107866)
skatrak Sep 10, 2024
fffdd9e
[bazel] Port 69f8923efa61034b57805a8d6d859e9c1ca976eb
d0k Sep 10, 2024
925b220
[lldb] Recurse through DW_AT_signature when looking for attributes (#…
labath Sep 10, 2024
44556e6
[amdgpu] Add llvm.amdgcn.init.whole.wave intrinsic (#105822)
rovka Sep 10, 2024
4687017
[clang][bytecode][NFC] Fix CallBI function signature
tbaederr Sep 10, 2024
daf2085
[lld][AArch64] Fix getImplicitAddend in big-endian mode. (#107845)
statham-arm Sep 10, 2024
6a56f15
[clang][bytecode][NFC] Fix a commented-out test
tbaederr Sep 10, 2024
b0ffaa7
[AArch64] Prevent the AArch64LoadStoreOptimizer from reordering CFI i…
momchil-velikov Sep 10, 2024
306b08c
[AMDGPU] Remove unused SITargetLowering::isMemOpUniform
jayfoad Sep 10, 2024
cb30169
[flang] Use LLVM dialect ops for stack save/restore in target-rewrite…
jeanPerier Sep 10, 2024
930915a
[libc++] Include the full set of libc++ transitive includes in the CS…
ldionne Sep 10, 2024
bda9474
Add missing newlines at EOF; NFC
svenvh Sep 10, 2024
0ccc609
[VectorCombine] Add foldShuffleOfIntrinsics. (#106502)
HanKuanChen Sep 10, 2024
4a63d62
[gn] attempt to port 53a81d4d26f0 (win/asan dynamic runtime)
nico May 30, 2024
4d55f0b
[gn] attempt to port 53a81d4d26f0 more (win/asan dynamic runtime)
nico Sep 10, 2024
d1cad22
Reland [MLIR] Make resolveCallable customizable in CallOpInterface (#…
xlauko Sep 10, 2024
e610a0e
[gn] port eb0e4b1415800
nico Sep 10, 2024
5dd1c82
[NFC][AMDGPU][Driver] Move 'shouldSkipSanitizeOption' utility to AMDG…
ampandey-1995 Sep 10, 2024
f58312e
[ConstraintElim] Add tests with exiting latch.
fhahn Sep 10, 2024
4290e34
[flang][AMDGPU] Convert math ops to AMD GPU library calls instead of …
jsjodin Sep 10, 2024
69828c4
[GlobalIsel][NFC] update inline-memset.mir test (#108006)
tschuett Sep 10, 2024
bca2b6d
[SPIR-V] Expose an API call to initialize SPIRV target and translate …
VyacheslavLevytskyy Sep 10, 2024
46a76c3
[libc++][test] LWG2593: Moved-from state of Allocators (#107344)
frederick-vs-ja Sep 10, 2024
0f52545
[CGData][MachineOutliner] Global Outlining (#90074)
kyulee-com Sep 10, 2024
7190368
[gn build] Port bca2b6d23f69
nico Sep 10, 2024
2459679
[gn build] Port f12e10b51368
nico Sep 10, 2024
53b5902
[flang][OpenMP] Implement copyin for pointers and allocatables. (#107…
DavidTruby Sep 10, 2024
5823ac0
[llvm-exegesis] Refactor getting register number from name to LLVMSta…
boomanaiden154 Sep 10, 2024
dfd7284
[gn] port 0f525452896
nico Sep 10, 2024
33f1235
[libc][bazel] fix accidental rename
metaflow Sep 10, 2024
13c14c6
[APINotes] Avoid repeated hash lookups (NFC) (#107959)
kazutakahirata Sep 10, 2024
8530329
[Tablegen] Avoid repeated hash lookps (NFC) (#107961)
kazutakahirata Sep 10, 2024
19a2f17
[Format] Avoid repeated hash lookups (NFC) (#107962)
kazutakahirata Sep 10, 2024
9710085
[Lex] Avoid repeated hash lookups (NFC) (#107963)
kazutakahirata Sep 10, 2024
e982d7f
[mlir] Reuse pack dest in tensor.pack decomposition (#108025)
Max191 Sep 10, 2024
2bcab9b
[lldb][test] TestDbgInfoContentVectorFromStdModule.py: skip test on D…
Michael137 Sep 10, 2024
56a0334
[Attributor] Keep track of reached returns in AAPointerInfo (#107479)
jdoerfert Sep 10, 2024
d778689
[RFC][C++20][Modules] Fix crash when function and lambda inside loade…
dmpolukhin Sep 10, 2024
bf68403
Attempt to fix [CGData][MachineOutliner] Global Outlining (#90074) (#…
kyulee-com Sep 10, 2024
ba2aa1d
Fix for Attempt to fix [CGData][MachineOutliner] Global Outlining (#9…
kyulee-com Sep 10, 2024
2cfdcfb
Fix for llvm/test/CodeGen/RISCV/O3-pipeline.ll (#108050)
kyulee-com Sep 10, 2024
14b4356
[RISCV] Separate more of scalar FP in CC_RISCV. NFC (#107908)
topperc Sep 10, 2024
c7a7767
Revert "[amdgpu] Add llvm.amdgcn.init.whole.wave intrinsic" (#108054)
vitalybuka Sep 10, 2024
22144e2
[LLDB][Data Formatters] Calculate average and total time for summary …
Jlalond Sep 10, 2024
ce9f987
[libc] fix locale dependency for stdlib (#108042)
SchrodingerZhu Sep 10, 2024
524a028
[MemProf] Streamline and avoid unnecessary context id duplication (#1…
teresajohnson Sep 10, 2024
7fb19cb
[ADT] Require base equality in indexed_accessor_iterator::operator==(…
andrey-golubev Sep 10, 2024
90e8411
[DirectX] Lower `@llvm.dx.typedBufferStore` to DXIL ops
bogner Sep 10, 2024
c8ed2b8
[WebAssembly] Add a colon to type error message (#107980)
aheejin Sep 10, 2024
22067a8
[PowerPC] Fix assert exposed by PR 95931 in LowerBITCAST (#108062)
syzaara Sep 10, 2024
02c943a
Revert "[NVPTX] Support copysign PTX instruction (#107800)" (#108066)
pranavk Sep 10, 2024
7a91af4
Add DIExpression::foldConstantMath to CoroSplit (#107933)
rastogishubham Sep 10, 2024
feeb6aa
[bazel] Add CGData targets/deps (#108070)
rupprecht Sep 10, 2024
5537ae8
[RISCV] Fix fneg.d/fabs.d aliasing handling for Zdinx. Add missing fm…
topperc Sep 10, 2024
5b4100c
[lldb-dap] Improve `stackTrace` and `exceptionInfo` DAP request handl…
ashgti Sep 10, 2024
becb03f
[DirectX] Add DirectXTargetCodeGenInfo (#104856)
hekota Sep 10, 2024
f4e2d7b
[Coroutines] Move spill related methods to a Spill utils (#107884)
Sep 10, 2024
34559ad
[Coroutines] Split buildCoroutineFrame
Aug 23, 2024
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
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion clang/docs/ExternalClangExamples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ List of projects and tools
etc."

`<https://rprichard.github.io/CxxCodeBrowser/>`_
"A C/C++ source code indexer and navigator"
"A C/C++ source code indexer and navigator."

`<https://github.com/etaoins/qconnectlint>`_
"qconnectlint is a Clang tool for statically verifying the consistency
Expand Down Expand Up @@ -98,3 +98,6 @@ List of projects and tools
uses of reserved identifiers to ensuring that code adheres to lifecycle
protocols for certain LibreOffice-specific classes. They may serve as
examples for writing RecursiveASTVisitor-based plugins."

`<https://github.com/banach-space/clang-tutor>`_
"A collection of out-of-tree Clang plugins for teaching and learning."
12 changes: 12 additions & 0 deletions clang/include/clang/Basic/Builtins.td
Original file line number Diff line number Diff line change
Expand Up @@ -4763,6 +4763,18 @@ def HLSLSaturate : LangBuiltin<"HLSL_LANG"> {
let Prototype = "void(...)";
}

def HLSLSelect : LangBuiltin<"HLSL_LANG"> {
let Spellings = ["__builtin_hlsl_select"];
let Attributes = [NoThrow, Const];
let Prototype = "void(...)";
}

def HLSLSign : LangBuiltin<"HLSL_LANG"> {
let Spellings = ["__builtin_hlsl_elementwise_sign"];
let Attributes = [NoThrow, Const];
let Prototype = "void(...)";
}

// Builtins for XRay.
def XRayCustomEvent : Builtin {
let Spellings = ["__xray_customevent"];
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 @@ -9206,6 +9206,9 @@ def err_typecheck_expect_scalar_operand : Error<
"operand of type %0 where arithmetic or pointer type is required">;
def err_typecheck_cond_incompatible_operands : Error<
"incompatible operand types%diff{ ($ and $)|}0,1">;
def err_typecheck_expect_scalar_or_vector : Error<
"invalid operand of type %0 where %1 or "
"a vector of such type is required">;
def err_typecheck_expect_flt_or_vector : Error<
"invalid operand of type %0 where floating, complex or "
"a vector of such types is required">;
Expand Down
1 change: 1 addition & 0 deletions clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,7 @@ def z : Separate<["-"], "z">, Flags<[LinkerInput]>,
def offload_link : Flag<["--"], "offload-link">, Group<Link_Group>,
HelpText<"Use the new offloading linker to perform the link job.">;
def Xlinker : Separate<["-"], "Xlinker">, Flags<[LinkerInput, RenderAsInput]>,
Visibility<[ClangOption, CLOption, FlangOption, DXCOption]>,
HelpText<"Pass <arg> to the linker">, MetaVarName<"<arg>">,
Group<Link_Group>;
def Xoffload_linker : JoinedAndSeparate<["-"], "Xoffload-linker">,
Expand Down
43 changes: 5 additions & 38 deletions clang/include/clang/Lex/Preprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -1053,22 +1053,6 @@ class Preprocessor {
std::optional<MacroAnnotationInfo> DeprecationInfo;
std::optional<MacroAnnotationInfo> RestrictExpansionInfo;
std::optional<SourceLocation> FinalAnnotationLoc;

static MacroAnnotations makeDeprecation(SourceLocation Loc,
std::string Msg) {
return MacroAnnotations{MacroAnnotationInfo{Loc, std::move(Msg)},
std::nullopt, std::nullopt};
}

static MacroAnnotations makeRestrictExpansion(SourceLocation Loc,
std::string Msg) {
return MacroAnnotations{
std::nullopt, MacroAnnotationInfo{Loc, std::move(Msg)}, std::nullopt};
}

static MacroAnnotations makeFinal(SourceLocation Loc) {
return MacroAnnotations{std::nullopt, std::nullopt, Loc};
}
};

/// Warning information for macro annotations.
Expand Down Expand Up @@ -2884,35 +2868,18 @@ class Preprocessor {

void addMacroDeprecationMsg(const IdentifierInfo *II, std::string Msg,
SourceLocation AnnotationLoc) {
auto Annotations = AnnotationInfos.find(II);
if (Annotations == AnnotationInfos.end())
AnnotationInfos.insert(std::make_pair(
II,
MacroAnnotations::makeDeprecation(AnnotationLoc, std::move(Msg))));
else
Annotations->second.DeprecationInfo =
MacroAnnotationInfo{AnnotationLoc, std::move(Msg)};
AnnotationInfos[II].DeprecationInfo =
MacroAnnotationInfo{AnnotationLoc, std::move(Msg)};
}

void addRestrictExpansionMsg(const IdentifierInfo *II, std::string Msg,
SourceLocation AnnotationLoc) {
auto Annotations = AnnotationInfos.find(II);
if (Annotations == AnnotationInfos.end())
AnnotationInfos.insert(
std::make_pair(II, MacroAnnotations::makeRestrictExpansion(
AnnotationLoc, std::move(Msg))));
else
Annotations->second.RestrictExpansionInfo =
MacroAnnotationInfo{AnnotationLoc, std::move(Msg)};
AnnotationInfos[II].RestrictExpansionInfo =
MacroAnnotationInfo{AnnotationLoc, std::move(Msg)};
}

void addFinalLoc(const IdentifierInfo *II, SourceLocation AnnotationLoc) {
auto Annotations = AnnotationInfos.find(II);
if (Annotations == AnnotationInfos.end())
AnnotationInfos.insert(
std::make_pair(II, MacroAnnotations::makeFinal(AnnotationLoc)));
else
Annotations->second.FinalAnnotationLoc = AnnotationLoc;
AnnotationInfos[II].FinalAnnotationLoc = AnnotationLoc;
}

const MacroAnnotations &getMacroAnnotations(const IdentifierInfo *II) const {
Expand Down
6 changes: 3 additions & 3 deletions clang/include/clang/Sema/Overload.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,6 @@ class Sema;
/// HLSL Scalar Widening with promotion
ICR_HLSL_Scalar_Widening_Promotion,

/// HLSL Matching Dimension Reduction
ICR_HLSL_Dimension_Reduction,

/// Conversion
ICR_Conversion,

Expand All @@ -250,6 +247,9 @@ class Sema;
/// extension anyway.
ICR_C_Conversion_Extension,

/// HLSL Matching Dimension Reduction
ICR_HLSL_Dimension_Reduction,

/// HLSL Dimension reduction with promotion
ICR_HLSL_Dimension_Reduction_Promotion,

Expand Down
9 changes: 9 additions & 0 deletions clang/include/clang/Serialization/ASTReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,15 @@ class ASTReader
/// once recursing loading has been completed.
llvm::SmallVector<NamedDecl *, 16> PendingOdrMergeChecks;

/// Lambdas that need to be loaded right after the function they belong to.
/// It is required to have canonical declaration for lambda class from the
/// same module as enclosing function. This is required to correctly resolve
/// captured variables in the lambda. Without this, due to lazy
/// deserialization canonical declarations for the function and lambdas can
/// be from different modules and DeclRefExprs may refer to the AST nodes
/// that don't exist in the function.
SmallVector<GlobalDeclID, 4> PendingLambdas;

using DataPointers =
std::pair<CXXRecordDecl *, struct CXXRecordDecl::DefinitionData *>;
using ObjCInterfaceDataPointers =
Expand Down
10 changes: 3 additions & 7 deletions clang/lib/APINotes/APINotesWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,9 @@ class APINotesWriter::Implementation {
if (Identifier.empty())
return 0;

auto Known = IdentifierIDs.find(Identifier);
if (Known != IdentifierIDs.end())
return Known->second;

// Add to the identifier table.
Known = IdentifierIDs.insert({Identifier, IdentifierIDs.size() + 1}).first;
return Known->second;
// Add to the identifier table if missing.
return IdentifierIDs.try_emplace(Identifier, IdentifierIDs.size() + 1)
.first->second;
}

/// Retrieve the ID for the given selector.
Expand Down
82 changes: 51 additions & 31 deletions clang/lib/AST/ByteCode/Compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,26 @@ template <class Emitter> class LoopScope final : public LabelScope<Emitter> {
LoopScope(Compiler<Emitter> *Ctx, LabelTy BreakLabel, LabelTy ContinueLabel)
: LabelScope<Emitter>(Ctx), OldBreakLabel(Ctx->BreakLabel),
OldContinueLabel(Ctx->ContinueLabel),
OldLabelVarScope(Ctx->LabelVarScope) {
OldBreakVarScope(Ctx->BreakVarScope),
OldContinueVarScope(Ctx->ContinueVarScope) {
this->Ctx->BreakLabel = BreakLabel;
this->Ctx->ContinueLabel = ContinueLabel;
this->Ctx->LabelVarScope = this->Ctx->VarScope;
this->Ctx->BreakVarScope = this->Ctx->VarScope;
this->Ctx->ContinueVarScope = this->Ctx->VarScope;
}

~LoopScope() {
this->Ctx->BreakLabel = OldBreakLabel;
this->Ctx->ContinueLabel = OldContinueLabel;
this->Ctx->LabelVarScope = OldLabelVarScope;
this->Ctx->ContinueVarScope = OldContinueVarScope;
this->Ctx->BreakVarScope = OldBreakVarScope;
}

private:
OptLabelTy OldBreakLabel;
OptLabelTy OldContinueLabel;
VariableScope<Emitter> *OldLabelVarScope;
VariableScope<Emitter> *OldBreakVarScope;
VariableScope<Emitter> *OldContinueVarScope;
};

// Sets the context for a switch scope, mapping labels.
Expand All @@ -145,18 +149,18 @@ template <class Emitter> class SwitchScope final : public LabelScope<Emitter> {
: LabelScope<Emitter>(Ctx), OldBreakLabel(Ctx->BreakLabel),
OldDefaultLabel(this->Ctx->DefaultLabel),
OldCaseLabels(std::move(this->Ctx->CaseLabels)),
OldLabelVarScope(Ctx->LabelVarScope) {
OldLabelVarScope(Ctx->BreakVarScope) {
this->Ctx->BreakLabel = BreakLabel;
this->Ctx->DefaultLabel = DefaultLabel;
this->Ctx->CaseLabels = std::move(CaseLabels);
this->Ctx->LabelVarScope = this->Ctx->VarScope;
this->Ctx->BreakVarScope = this->Ctx->VarScope;
}

~SwitchScope() {
this->Ctx->BreakLabel = OldBreakLabel;
this->Ctx->DefaultLabel = OldDefaultLabel;
this->Ctx->CaseLabels = std::move(OldCaseLabels);
this->Ctx->LabelVarScope = OldLabelVarScope;
this->Ctx->BreakVarScope = OldLabelVarScope;
}

private:
Expand Down Expand Up @@ -4605,18 +4609,23 @@ bool Compiler<Emitter>::visitWhileStmt(const WhileStmt *S) {
this->fallthrough(CondLabel);
this->emitLabel(CondLabel);

if (const DeclStmt *CondDecl = S->getConditionVariableDeclStmt())
if (!visitDeclStmt(CondDecl))
return false;
{
LocalScope<Emitter> CondScope(this);
if (const DeclStmt *CondDecl = S->getConditionVariableDeclStmt())
if (!visitDeclStmt(CondDecl))
return false;

if (!this->visitBool(Cond))
return false;
if (!this->jumpFalse(EndLabel))
return false;
if (!this->visitBool(Cond))
return false;
if (!this->jumpFalse(EndLabel))
return false;

if (!this->visitStmt(Body))
return false;
if (!this->visitStmt(Body))
return false;

if (!CondScope.destroyLocals())
return false;
}
if (!this->jump(CondLabel))
return false;
this->fallthrough(EndLabel);
Expand All @@ -4636,13 +4645,18 @@ template <class Emitter> bool Compiler<Emitter>::visitDoStmt(const DoStmt *S) {

this->fallthrough(StartLabel);
this->emitLabel(StartLabel);

{
LocalScope<Emitter> CondScope(this);
if (!this->visitStmt(Body))
return false;
this->fallthrough(CondLabel);
this->emitLabel(CondLabel);
if (!this->visitBool(Cond))
return false;

if (!CondScope.destroyLocals())
return false;
}
if (!this->jumpTrue(StartLabel))
return false;
Expand Down Expand Up @@ -4671,29 +4685,33 @@ bool Compiler<Emitter>::visitForStmt(const ForStmt *S) {
this->fallthrough(CondLabel);
this->emitLabel(CondLabel);

if (const DeclStmt *CondDecl = S->getConditionVariableDeclStmt())
if (!visitDeclStmt(CondDecl))
return false;
{
LocalScope<Emitter> CondScope(this);
if (const DeclStmt *CondDecl = S->getConditionVariableDeclStmt())
if (!visitDeclStmt(CondDecl))
return false;

if (Cond) {
if (!this->visitBool(Cond))
return false;
if (!this->jumpFalse(EndLabel))
return false;
}
if (Cond) {
if (!this->visitBool(Cond))
return false;
if (!this->jumpFalse(EndLabel))
return false;
}

{
if (Body && !this->visitStmt(Body))
return false;

this->fallthrough(IncLabel);
this->emitLabel(IncLabel);
if (Inc && !this->discard(Inc))
return false;
}

if (!CondScope.destroyLocals())
return false;
}
if (!this->jump(CondLabel))
return false;

this->fallthrough(EndLabel);
this->emitLabel(EndLabel);
return true;
Expand Down Expand Up @@ -4760,7 +4778,7 @@ bool Compiler<Emitter>::visitBreakStmt(const BreakStmt *S) {
if (!BreakLabel)
return false;

for (VariableScope<Emitter> *C = VarScope; C != LabelVarScope;
for (VariableScope<Emitter> *C = VarScope; C != BreakVarScope;
C = C->getParent())
C->emitDestruction();
return this->jump(*BreakLabel);
Expand All @@ -4771,8 +4789,8 @@ bool Compiler<Emitter>::visitContinueStmt(const ContinueStmt *S) {
if (!ContinueLabel)
return false;

for (VariableScope<Emitter> *C = VarScope; C != LabelVarScope;
C = C->getParent())
for (VariableScope<Emitter> *C = VarScope;
C && C->getParent() != ContinueVarScope; C = C->getParent())
C->emitDestruction();
return this->jump(*ContinueLabel);
}
Expand All @@ -4781,6 +4799,7 @@ template <class Emitter>
bool Compiler<Emitter>::visitSwitchStmt(const SwitchStmt *S) {
const Expr *Cond = S->getCond();
PrimType CondT = this->classifyPrim(Cond->getType());
LocalScope<Emitter> LS(this);

LabelTy EndLabel = this->getLabel();
OptLabelTy DefaultLabel = std::nullopt;
Expand Down Expand Up @@ -4844,7 +4863,8 @@ bool Compiler<Emitter>::visitSwitchStmt(const SwitchStmt *S) {
if (!this->visitStmt(S->getBody()))
return false;
this->emitLabel(EndLabel);
return true;

return LS.destroyLocals();
}

template <class Emitter>
Expand Down
8 changes: 5 additions & 3 deletions clang/lib/AST/ByteCode/Compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,12 @@ class Compiler : public ConstStmtVisitor<Compiler<Emitter>, bool>,
/// Switch case mapping.
CaseMap CaseLabels;

/// Scope to cleanup until when chumping to one of the labels.
VariableScope<Emitter> *LabelVarScope = nullptr;
/// Scope to cleanup until when we see a break statement.
VariableScope<Emitter> *BreakVarScope = nullptr;
/// Point to break to.
OptLabelTy BreakLabel;
/// Scope to cleanup until when we see a continue statement.
VariableScope<Emitter> *ContinueVarScope = nullptr;
/// Point to continue to.
OptLabelTy ContinueLabel;
/// Default case label.
Expand Down Expand Up @@ -533,7 +535,7 @@ template <class Emitter> class LocalScope : public VariableScope<Emitter> {
return true;
// Emit destructor calls for local variables of record
// type with a destructor.
for (Scope::Local &Local : this->Ctx->Descriptors[*Idx]) {
for (Scope::Local &Local : llvm::reverse(this->Ctx->Descriptors[*Idx])) {
if (!Local.Desc->isPrimitive() && !Local.Desc->isPrimitiveArray()) {
if (!this->Ctx->emitGetPtrLocal(Local.Offset, E))
return false;
Expand Down
Loading