Skip to content

Add contracts representation and parsing. Much thanks to Peter for th… #3

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

Draft
wants to merge 1,802 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
1802 commits
Select commit Hold shift + click to select a range
d5f5dc9
[SandboxIR] More boilerplate: Function, Argument, Constant, Instructi…
vporpo Jul 3, 2024
bbd52dd
[SLP]Remove operands upon marking instruction for deletion.
alexey-bataev Jul 3, 2024
7aa906d
[RISCV] Merge the Arch and Exts variables in RISCVISAInfo::parseArchS…
topperc Jul 3, 2024
c02e8f7
[llvm][transforms] Add a new algorithm to SplitModule (#95941)
sergachev Jul 3, 2024
7002ecb
[msan] Convert vector shadow to scalar before zext (#96722)
thurstond Jul 3, 2024
a1bc606
[Flang][Transform] Modify stack reclaim pass to use allocation addres…
agozillon Jul 3, 2024
a379b22
[IR] Use range-based for loops (NFC) (#97575)
kazutakahirata Jul 3, 2024
92f4001
[Transforms] Use range-based for loops (NFC) (#97576)
kazutakahirata Jul 3, 2024
fd524d4
[BOLT] Add Demangle to Profile link components
shawbyoung Jul 3, 2024
873c3f7
Revert "[SLP]Remove operands upon marking instruction for deletion."
alexey-bataev Jul 3, 2024
af784a5
[ThinLTO] Use a set rather than a map to track exported ValueInfos. (…
mingmingl-llvm Jul 3, 2024
a3c5c83
[DAGCombiner] Remove unneeded getValueType() calls in visitMULHS/MULH…
topperc Jul 3, 2024
b586498
[flang] Fix failing test (#97634)
Leporacanthicus Jul 3, 2024
04a1a34
[Driver] Add -Wa, options --crel and --allow-experimental-crel
MaskRay Jul 3, 2024
4c63672
[OpenMP] Fix use of ompt_start_tool in ompd test. (#97616)
hansangbae Jul 3, 2024
6aed0d5
[libc] created integration tests for newhdrgen (#97361)
aaryanshukla Jul 3, 2024
611212f
AMDGPU/GlobalISel: Legalize atomicrmw fmin/fmax (#97048)
arsenm Jul 3, 2024
4a1fdeb
[libc] reordered Function class parameters and moved yaml files (#97329)
RoseZhang03 Jul 3, 2024
5828b04
[BOLT][DWARF] Refactor legacy ranges writers (#96006)
sayhaan Jul 3, 2024
7d68d9d
[libc][math] Implement correctly rounded double precision tan (#97489)
lntue Jul 3, 2024
10b43f4
[Clang][Sema] Correctly transform dependent operands of overloaded bi…
sdkrystian Jul 3, 2024
af7ee51
[mlir][bytecode] Fix external resource bytecode parsing (#97650)
Jul 3, 2024
eaabd76
Revert "[MLIR][Vector] Generalize DropUnitDimFromElementwiseOps to no…
hanhanW Jul 3, 2024
d3a76b0
[llvm][SLPVectorizer] Fix a bad cast assertion (#97621)
jroelofs Jul 3, 2024
3eebeb7
[libc] Add aligned_alloc (#96586)
PiJoules Jul 3, 2024
2ef5b82
[libc][docs] Update full host build docs (#97643)
michaelrj-google Jul 3, 2024
4c79fac
[BOLT] Remove workaround for flushPendingLabels
MaskRay Jul 3, 2024
f2c6add
[MC] Remove remnant code related to pending labels
MaskRay Jul 3, 2024
089ba11
[Linker] Use a range-based for loop (NFC) (#97656)
kazutakahirata Jul 3, 2024
665efe8
[libc] Add LIBC_NAMESPACE_DECL macro (#97109)
PiJoules Jul 4, 2024
94471e7
[MC] Move MCAssembler::isSymbolLinkerVisible to MCSymbolMachO
MaskRay Jul 4, 2024
a0c6b8a
[BOLT][docs] Add merge-fdata to Linux optimization guide (#97659)
maksfb Jul 4, 2024
73f5f83
[BasicBlockSections] Using MBBSectionID as DenseMap key (#97295)
HaohaiWen Jul 4, 2024
507b0f6
[AArch64] Clean up ptrauth-call test a bit. NFC.
ahmedbougacha Jul 4, 2024
ac20135
[RISCV] Rematerialize vid.v (#97520)
lukel97 Jul 4, 2024
32f7672
[Clang][OpenMP] This is addition fix for #92210. (#94802)
jyu2-git Jul 4, 2024
8ce1aed
[flang] Lower MATMUL to type specific runtime calls. (#97547)
vzakhari Jul 4, 2024
24cee1c
[SPIR-V] Add __spirv_ wrappers to Non-Uniform, Atomic, Convert Instru…
VyacheslavLevytskyy Jul 4, 2024
8431170
[emacs] More consistently highlight value keywords that appear in vec…
goldsteinn Jul 4, 2024
2acb068
[PAC][llvm-readobj][ELF][AArch64] Define AUTH relocations for signed …
kovdan01 Jul 4, 2024
86187ed
[clang][Interp] Fix init chain in local initializers
tbaederr Jul 4, 2024
948862b
[mlir][nvvm] Fix the verifier of `wgmma.mma_async` wrt transposed lay…
shubaoyu2 Jul 4, 2024
0ad6ac8
[NFC][MLIR] Fix: `alloca` promotion for `AllocationOpInterface` (#97672)
nikalra Jul 4, 2024
2dda8a2
Revert "[clang][Interp] Fix init chain in local initializers"
tbaederr Jul 4, 2024
30df629
[lldb][DataFormatter][NFC] Remove duplicate null-check in std::map it…
Michael137 Jul 4, 2024
c67653f
[RISCV] Support vXf16 vector_shuffle with Zvfhmin. (#97491)
topperc Jul 4, 2024
899fe2c
[CVP][LVI] Fix incorrect scalar type when getting constant folded vec…
goldsteinn Jul 4, 2024
a2ed216
[LVI] Simplify the getPredicateResult() implementation (NFC)
nikic Jul 3, 2024
97a2bd8
Revert "[mlir][loops] Reland Refactor LoopFuseSiblingOp and support p…
pifon2a Jul 4, 2024
ebab105
[IR] Don't strip through pointer to vector of pointer bitcasts
nikic Jul 4, 2024
927def4
Revert "[lldb] Print empty enums as if they were unrecognised normal …
DavidSpickett Jul 4, 2024
67b302c
[mlir][vector] Add vector.step operation (#96776)
c-rhodes Jul 4, 2024
7b34cad
[AArch64] Extract bf16 cases from `itofp.ll` to `itofp-bf16.ll`, NFC.
Him188 Jul 1, 2024
54de090
[AArch64] Add i128 and fp128 tests to `itofp.ll`. NFC
Him188 Jul 2, 2024
173514d
[AArch64] Add fp128 tests in `fcmp.ll`. NFC
Him188 Jul 2, 2024
328d9f6
Reland "[lldb] Print empty enums as if they were unrecognised normal …
DavidSpickett Jul 4, 2024
4002e38
[RISCV] Use splat shorthand in strided load store tests. NFC
lukel97 Jul 4, 2024
28be3f8
[LAA] Cache pointer bounds expansions (NFCI).
fhahn Jul 4, 2024
f99746f
[Orc][RuntimeDyld] Return after handling error (#95364)
nikic Jul 4, 2024
94b2b1d
Fix MSVC "not all control paths return a value" warning. NFC
RKSimon Jul 4, 2024
81660bb
[AArch64] remove pointless AEK_NONE (#97569)
tmatheson-arm Jul 4, 2024
2c0add9
[TTI] Return a more sensible cost for histogram intrinsic. (#97397)
huntergr-arm Jul 4, 2024
e6cf292
[InstCombine][X86] Add some basic knownbits tests for PMULH/PMULHU
RKSimon Jul 4, 2024
5c204b1
[ValueTracking][X86] computeKnownBitsFromOperator - add PMULH/PMULHU …
RKSimon Jul 4, 2024
2b3b405
[LV] Don't vectorize first-order recurrence with VF <vscale x 1 x ..>
fhahn Jul 4, 2024
e7bfd4d
[Mem2Reg] Add some single store tests (NFC)
nikic Jul 4, 2024
07b3e2c
[LLDB] XFail on Windows TestThreadAPI.py test_StepInstruction
omjavaid Jul 4, 2024
d6af73e
[compiler-rt][Fuzzer] Disable fuzzer-leak test
DavidSpickett Jul 4, 2024
4835572
[analyzer] Check the correct first and last elements in cstring.Unini…
Szelethus Jul 4, 2024
7fb71d1
[SystemZ] Fix handling of target triples on Debian (#95407) (#97546)
iii-i Jul 4, 2024
42b193c
[AMX] Error out when AMX DP instructions use same registers (#97686)
phoebewang Jul 4, 2024
99f6ff9
[Flang][OpenMP] Use InsertionGuard in DataSharingProcessor (#97562)
skatrak Jul 4, 2024
6222c8f
[IR][LangRef] Add partial reduction add intrinsic (#94499)
NickGuy-Arm Jul 4, 2024
f58930f
[Mem2Reg] Don't use single store optimization for potentially poison …
nikic Jul 4, 2024
bbc6504
[NFC] [APFloat] Refactor IEEEFloat::toString (#97117)
Ariel-Burton Jul 4, 2024
3cab132
[clang][analyzer][doc] Migrate checkers-related docs from HTML to RST…
gamesh411 Jul 4, 2024
218f71d
[DebugInfo][LowerConstantIntrinsics] Fix the missing debug location o…
Apochens Jul 4, 2024
e0f4d27
[DebugInfo][LoopFlatten] Fix missing debug location update for new br…
Apochens Jul 4, 2024
2532ebb
[X86] Add test showing failure to concat VBLENDVB nodes back together…
RKSimon Jul 4, 2024
d43ec97
[X86] combineConcatVectorOps - IsConcatFree - peek through bitcasts t…
RKSimon Jul 4, 2024
f329e3e
[clang-tidy] Add `bugprone-pointer-arithmetic-on-polymorphic-object` …
Discookie Jul 4, 2024
0035c2e
[gn build] Port f329e3ed9070
llvmgnsyncbot Jul 4, 2024
b12449f
[CodeGen] Refactor and document ThunkInserter (#97468)
atrosinenko Jul 4, 2024
94a067a
[LLDB] Support exception breakpoints for plugin-provided languages (#…
walter-erquinigo Jul 4, 2024
361350f
[BOLT][DWARF] Deduplicate Foreign TU list (#97629)
ayermolo Jul 4, 2024
817f0d9
[Flang][OpenMP] NFC: Remove unused argument for omp.target lowering (…
skatrak Jul 4, 2024
5db6eac
[X86] Avoid useless DomTree in flags copy lowering (#97628)
aengelke Jul 4, 2024
f15266e
[MC][ELF] Emit instructions directly into fragment (#94950)
aengelke Jul 4, 2024
655651a
[libc++] Upgrade to GCC 14 (#97205)
philnik777 Jul 4, 2024
8299bfa
[VPlan] Extract reduction result insertion point to variable (NFCI).
fhahn Jul 4, 2024
79d6f52
[LVI] Use Constant instead of Tristate for predicate results
nikic Jul 4, 2024
f4d058f
[SelectionDAG] Ignore LegalTypes parameter in TargetLoweringBase::get…
topperc Jul 4, 2024
34fe032
[DAGCombiner] Use getShiftAmountConstant where possible. (#97683)
topperc Jul 4, 2024
fbd1b65
[lldb][DataFormatter][NFC] Move std::map iterator formatter into LibC…
Michael137 Jul 4, 2024
687531f
[DAG] PromoteIntRes_EXTRACT_SUBVECTOR - pull out repeated getOperand/…
RKSimon Jul 4, 2024
bb6ab8b
[TargetLowering] Update the description of getShiftAmountTy. NFC
topperc Jul 4, 2024
2307d27
[libc] fix float_comparison_test when an emulator is used to run the …
mikhailramalho Jul 4, 2024
8bb4294
[libc] Fix compilation warnings on 32-bit archs (#97745)
mikhailramalho Jul 4, 2024
0ccec54
[libc] Fix compilation when long double is used as float128 (#97747)
mikhailramalho Jul 4, 2024
834ecc8
[clang] CTAD alias: fix transformation for require-clause expr Part2.…
hokein Jul 4, 2024
4f77677
[libc] Implement fcntl when only SYS_fcntl64 is available (#97740)
mikhailramalho Jul 4, 2024
d1dc416
Fix MSVC 1920+ auto NTTP mangling for pointers to members (#97007)
MaxEW707 Jul 4, 2024
093ddac
[libc++][chrono] Fixes leap seconds. (#90070)
mordante Jul 4, 2024
bb979cd
Improve codegen, Start on constification.
EricWF Jul 4, 2024
d1c911f
[clang][FMV] Do not omit explicit default target_version attribute. (…
labrinea Jul 4, 2024
8270485
[X86] var-permute-*.ll - check memory address math
RKSimon Jul 4, 2024
e975ff0
[X86] matchAddressRecursively - don't fold zext(shl(x,c)) -> shl(zext…
RKSimon Jul 4, 2024
c1a5f1e
[Support] Use range-based for loops (NFC) (#97657)
kazutakahirata Jul 4, 2024
b298e2d
[LLD] [MinGW] Reinstate the former spelling in the version message (#…
mstorsjo Jul 4, 2024
3141c11
[SelectionDAG] Remove LegalTypes argument from getShiftAmountTy. NFC …
topperc Jul 4, 2024
7a9ef0f
Adding masked operation to OpenMP Dialect (#96022)
anchuraj Jul 4, 2024
839ed1b
[MemProf][compiler-rt] Update MemProfData preprocessor directives
boomanaiden154 Jul 4, 2024
4762f3b
[RISCV][TTI] Add cost of type based binOp VP intrinsics with function…
ElvisWang123 Jul 5, 2024
bfa762a
[MLIR][Python] fix class name of powf and negf in linalg (#97696)
xurui1995 Jul 5, 2024
8419da8
[SelectionDAG] Remove LegalTypes argument from getShiftAmountConstant…
topperc Jul 5, 2024
f737865
Revert "[llvm-config] Quote and escape paths if necessary (#97305)"
aganea Jul 5, 2024
33112cb
[DAGCombiner] Remove unnecessary assert from getShiftAmountTy wrapper…
topperc Jul 5, 2024
ffc459d
[RISCV] Add a check in lowerSELECT after foldBinOpIntoSelectIfProfita…
Yunzezhu94 Jul 5, 2024
9e21174
[clang] Avoid 'raw_string_ostream::str' (NFC)
JOE1994 Jul 5, 2024
23aff11
[RISCV] Add FeaturePredictableSelectIsExpensive
wangpc-pp Jul 5, 2024
db782b4
[RISCV] Don't forward AVL in VSETVLIInfo if it would clobber other de…
lukel97 Jul 5, 2024
c7ee204
[OpenMP] Fix stack corruption due to argument mismatch (#96386)
sushgokh Jul 5, 2024
5ce141f
[symbolizer] Empty string is not an error (#97781)
spavloff Jul 5, 2024
a3ba6a7
[MC,MachO] Simplify IndirectSybols
MaskRay Jul 5, 2024
d2dd4b5
[libc++] Adds a new feature-test macro generator class. (#90889)
mordante Jul 5, 2024
1d4d92d
[MC] Move MCAssembler::IndirectSymbols to MachObjectWriter
MaskRay Jul 5, 2024
7c4dbad
[DebugInfo][SimplifyCFGPass] Fix the missing debug location update fo…
Apochens Jul 5, 2024
093aaca
[clang][analyzer][doc] Migrate user-related docs from HTML to RST (#…
gamesh411 Jul 5, 2024
009082a
[MC] Move MCAssembler::DataRegions to MachObjectWriter
MaskRay Jul 5, 2024
74984de
[X86][CodeGen] Convert masked.load/store to CLOAD/CSTORE node only wh…
KanRobert Jul 5, 2024
c60b930
Revert "[X86][CodeGen] Convert masked.load/store to CLOAD/CSTORE node…
KanRobert Jul 5, 2024
eb7ebd5
[llvm-cov] Remove View member from MCDCView and BranchView (#97734)
nikic Jul 5, 2024
8101cbf
[ompd] Fix strict aliasing violation in TargetValue::getValue() (#97739)
nikic Jul 5, 2024
d6df018
[MLIR] Add the convergent attribute to LLVM Dialect (#97709)
FMarno Jul 5, 2024
a14a53e
[openmp] Add ompdModule dependency to check-ompd (#97736)
nikic Jul 5, 2024
27bb2a3
[mlir][Pass] Handle escaped pipline option values (#97667)
nikalra Jul 5, 2024
a48305e
[X86][CodeGen] Convert masked.load/store to CLOAD/CSTORE node only wh…
KanRobert Jul 5, 2024
daaea12
[Mem2Reg] Always allow single-store optimization for dominating stores
nikic Jul 5, 2024
b3fa2a6
[lldb][FreeBSD] Fix NativeRegisterContextFreeBSD_x86_64() declaration…
kiyolee Jul 5, 2024
e4b2842
[SelectionDAG] Handle VSCALE in isKnownNeverZero (#97789)
lukel97 Jul 5, 2024
b546096
[VectorCombine] foldShuffleToIdentity - handle bitcasts with equal el…
RKSimon Jul 5, 2024
99d6c6d
[VPlan] Model branch cond to enter scalar epilogue in VPlan. (#92651)
fhahn Jul 5, 2024
2d0c4c3
[Flang][OpenMP] Remove unused OpWithBodyGenInfo attributes (#97572)
skatrak Jul 5, 2024
5aacf93
[libc++] Use _Complex for multiplication and division of complex floa…
philnik777 Jul 5, 2024
fbd7360
[clang][Interp] Short-cirtuit Move/Copy constructors if we can
tbaederr Jul 4, 2024
928fde3
[X86] is_fpclass-fp80.ll - regenerate with standard X86/X64 prefixes
RKSimon Jul 5, 2024
3d2961b
[X86] zero-remat.ll - regenerate with standard X86/X64 prefixes
RKSimon Jul 5, 2024
03000f0
[X86] fp-strict-scalar-cmp-fp16.ll - regenerate with standard X86/X64…
RKSimon Jul 5, 2024
0fbb320
[X86] csr-split.ll - regenerate with standard X86/X64 prefixes
RKSimon Jul 5, 2024
720b958
[Flang][OpenMP] NFC: Share DataSharingProcessor creation logic for al…
skatrak Jul 5, 2024
6fbd26b
[clang][Interp] Add QualType parameter to Pointer::toRValue
tbaederr Jul 5, 2024
cc53b95
[AArch64] When hardening against SLS, only create called thunks (#97…
atrosinenko Jul 5, 2024
f926e19
Reapply "[clang][Interp] Fix init chain in local initializers"
tbaederr Jul 4, 2024
8ec9840
[CodeGen] Add dump() to MachineTraceMetrics.h
wangpc-pp Jul 5, 2024
eedc2c8
[LV] Remove now obsolete DT updates of scalar exit block.
fhahn Jul 5, 2024
b52c512
[MLIR][OpenMP] Remove OpenMPDialectFoldInterface (#97577)
skatrak Jul 5, 2024
5d79110
[Pipelines] Perform mergefunc after constmerge (#92498)
yamt Jul 5, 2024
2f0700a
[clang][Interp] Add a missing template keyword
tbaederr Jul 5, 2024
959ff45
[LV] Regenerate test checks for zero_unroll.ll (NFC).
fhahn Jul 5, 2024
d6e5b14
[NFC][opt] Improve help message (#97805)
omern1 Jul 5, 2024
00c622e
[clang][Interp][Test] Add test for #97302
tbaederr Jul 5, 2024
db7db68
[libc++] Use __is_array if the builtin is fixed (#93037)
philnik777 Jul 5, 2024
ccc0b66
[clang] Avoid 'raw_string_ostream::str' (NFC)
JOE1994 Jul 5, 2024
e2cee2c
[BOLT][AArch64] Fixes assertion errors occurred when perf2bolt was ex…
kaadam Jul 5, 2024
f542796
[lld][ELF] Annotate Bitfields with Preferred Types (#97737)
lenary Jul 5, 2024
7102eae
[lld][ELF] Annotate Bitfields with Preferred Types (#97737)
lenary Jul 5, 2024
d4216b5
[clang][CodeGen][AMDGPU] Enable AMDGPU `printf` for `spirv64-amd-amdh…
AlexVlx Jul 5, 2024
9f2215a
[libc][math] Fix signed zeros for erff. (#97742)
lntue Jul 5, 2024
ac76ce2
[libc][math][c23] Classify f16fma{,f,l} as LLVM libc extensions (#97728)
overmighty Jul 5, 2024
18b575d
[libc++abi] Fixing up LIBCXXABI_ADDITIONAL_COMPILE_FLAGS (#97608)
zibi2 Jul 5, 2024
2bc474b
[InstCombine][X86] Pull out repeated uses of PatternMatch namespace. …
RKSimon Jul 5, 2024
ae0d224
[BPF] Fix linking issues in static map initializers (#91310)
mejedi Jul 5, 2024
b0b3c1a
[gn] port 5aacf93a8968
nico Jul 5, 2024
d177a94
[IR] Add Constant::toConstantRange() (NFC)
nikic Jul 5, 2024
4339d2e
[CVP] Add missing CHECK lines in test (NFC)
nikic Jul 5, 2024
f92bfca
[AArch64] All bits of an exact right shift are demanded (#97448)
momchil-velikov Jul 5, 2024
130f0f5
[LVI][CVP] Add support for vector comparisons
nikic Jul 5, 2024
3bb2563
[mlir][vector] Fix crash in `vector.insert` canonicalization (#97801)
matthias-springer Jul 5, 2024
9315645
[mlir][python] auto attribute casting (#97786)
makslevental Jul 5, 2024
3449303
LDist/test: clean up and modernize (NFC) (#97822)
artagnon Jul 5, 2024
0488f21
[InstCombine][X86] Add test showing failure to peek through bitcast+s…
RKSimon Jul 5, 2024
6c1c97c
[InstCombine][X86] Peek through bitcast+shuffle+bitcast sequence when…
RKSimon Jul 5, 2024
3bfc516
[lldb-dap][NFC] Minor rename
Jul 5, 2024
44248d2
[PGO][compiler-rt] Add a test to ensure include files do not diverge …
boomanaiden154 Jul 5, 2024
23d1d95
[LLVM][compiler-rt][AArch64] Refactor AArch64 CPU features (#97777)
boomanaiden154 Jul 5, 2024
0f1da49
[libc] Fix readlink tests on 32-bit systems (#97850)
mikhailramalho Jul 5, 2024
788731c
[clang] Implement P3144R2 "Deleting a Pointer to an Incomplete Type..…
Endilll Jul 5, 2024
fc66543
Revert "[libc] Fix readlink tests on 32-bit systems" (#97852)
mikhailramalho Jul 5, 2024
683c8e9
[libc++] Adds a missing include.
mordante Jul 5, 2024
1ed84a8
[clang-doc] fix bug introduced by asset test (#97540)
PeterChou1 Jul 5, 2024
e70f376
[MCParser] Simplify macro-like body expansion
MaskRay Jul 5, 2024
f6ae0d3
[CodeGen] Pre-commit test case related to ComputeNumSignBits for SHL …
bjope Jul 4, 2024
c2fbc70
[SelectionDAG] Let ComputeKnownSignBits handle (shl (ext X), C) (#97695)
bjope Jul 4, 2024
ac03ae3
[LV] Preserve LAA in LoopVectorize (NFCI).
fhahn Jul 5, 2024
812f9e8
[MCParser] .altmacro: ignore & after a token
MaskRay Jul 5, 2024
f8b1ca4
[MCParser] .altmacro: Support argument expansion not preceded by \
MaskRay Jul 5, 2024
3a49706
[AArch64,test] Improve ilp32-diagnostics.s
MaskRay Jul 5, 2024
37bee25
[BOLT][NFC] Refactor function matching (#97502)
shawbyoung Jul 5, 2024
4a0aff1
MCAssembler: Clean up iterator types for Symbols
MaskRay Jul 5, 2024
045e68f
[libc] Change the test file names used in readlink_test and readlinka…
lntue Jul 5, 2024
dc1da93
[BOLT][BAT] Add support for three-way split functions (#93760)
aaupov Jul 5, 2024
3485540
[llvm] Avoid 'raw_string_ostream::str' (NFC)
JOE1994 Jul 5, 2024
ceade83
[clang-format] Skip block commented out includes when sorting them (#…
owenca Jul 5, 2024
b75453b
MCAssembler: Remove unneeded non-const iterators for Sections and mis…
MaskRay Jul 5, 2024
8f5b144
[bazel] Port #97777 (#97868)
keith Jul 5, 2024
88381ce
[RISCV] Hoist some common setOperationActions to a common place. NFC
topperc Jul 6, 2024
f118c88
[RISCV] Remove unnecessary setOperationAction for ISD::SELECT_CC for …
topperc Jul 6, 2024
593f708
[Support] Silence function cast warning when building with Clang ToT …
aganea Jul 6, 2024
10e1b93
[compiler-rt] Silence function cast warning when building with Clang …
aganea Jul 6, 2024
cf1ded3
[lldb] Silence function cast warning when building with Clang ToT tar…
aganea Jul 6, 2024
be26e54
[openmp] Silence warning when building the x64 Windows LLVM release p…
aganea Jul 6, 2024
6337fdc
[RISCV] Use EXTLOAD in lowerVECTOR_SHUFFLE. (#97862)
topperc Jul 6, 2024
0b9f284
[RISCV] Remove unused check-prefixes. NFC
topperc Jul 6, 2024
a348824
[RISCV] Allow folding vmerge with implicit passthru when true has tie…
lukel97 Jul 6, 2024
ccf357f
[libc] Add `dlfcn.h` headers (#97772)
izaakschroeder Jul 6, 2024
9cb9a97
[CMake] Use Clang to infer the target triple (#89425)
petrhosek Jul 6, 2024
2c6d5fd
A lot of forward progress.
EricWF Jul 6, 2024
249f571
whitespace changes
EricWF Jul 6, 2024
acd7a68
[llvm] Remove redundant calls to std::unique_ptr<T>::get (NFC) (#97778)
kazutakahirata Jul 6, 2024
874ca08
[Clang][ExprConstant] fix constant expression did not evaluate to int…
Backl1ght Jul 6, 2024
ac9d34a
[clang-doc] revert asset bug fix (#97882)
PeterChou1 Jul 6, 2024
5aa8ef8
[libc++][test] Updates sized deallocation tests. (#97833)
mordante Jul 6, 2024
126f81d
[NFC][libc++] removes std:: qualification,
mordante Jul 6, 2024
55b95a7
[mlir][Transforms][NFC] Dialect conversion: Reland docs improvement (…
matthias-springer Jul 6, 2024
88b2629
[AArch64][PAC] Support BLRA* instructions in SLS Hardening pass (#97605)
atrosinenko Jul 6, 2024
f90bac9
Revert "[AArch64][PAC] Support BLRA* instructions in SLS Hardening pa…
atrosinenko Jul 6, 2024
be3a8b8
[clang] Add C++26 diagnostics to compatibility diagnosic groups (#97806)
Endilll Jul 6, 2024
4a9aef6
DynamicAPInt: optimize size of structure (#97831)
artagnon Jul 6, 2024
de88b2c
[Clang] Simplify release notes and remove irrelevant comment (#96407)
spaits Jul 6, 2024
f8834ed
[libc][C23][math] Implement cospif function correctly rounded for all…
HendrikHuebner Jul 6, 2024
9374f83
Outline X86 autoupgrade patterns (#97851)
jholewinski-nv Jul 6, 2024
2da0055
[libc++][NFC] Merge identical char_traits functions into a base class…
philnik777 Jul 6, 2024
d64efe4
[lld-macho] Remove symbols to `__mod_init_func` with `-init_offsets` …
BertalanD Jul 6, 2024
e55585f
[Clang] Fix typo in cxx_status.html
cor3ntin Jul 6, 2024
9e94043
[libc++] Remove annotations for GCC 13 and update the documentation (…
philnik777 Jul 6, 2024
048815c
Revert "[lldb] Silence function cast warning when building with Clang…
aganea Jul 6, 2024
b4b17d9
Revert "[compiler-rt] Silence function cast warning when building wit…
aganea Jul 6, 2024
57b76b4
Revert "[Support] Silence function cast warning when building with Cl…
aganea Jul 6, 2024
6e4bb60
[libc++] Assume newer LLVM versions for not-yet-released macOS versions
ldionne Jul 6, 2024
4eee4d5
change flags, but break clang
EricWF Jul 6, 2024
b039625
Add contracts representation and parsing. Much thanks to Peter for th…
EricWF Jun 19, 2024
6b6d951
fix todo
EricWF Jun 19, 2024
9674f45
get it working end-to-end
EricWF Jun 22, 2024
93a6ba5
a bunch of work, most of it broken
EricWF Jul 2, 2024
4b91b34
Get templates working.
EricWF Jul 3, 2024
670df13
Improve codegen, Start on constification.
EricWF Jul 4, 2024
33eaf39
A lot of forward progress.
EricWF Jul 6, 2024
c8290ce
whitespace changes
EricWF Jul 6, 2024
d19459f
change flags, but break clang
EricWF Jul 6, 2024
acd41cd
finish merge
EricWF Jul 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 29 additions & 6 deletions clang/include/clang/AST/Decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ namespace clang {
class ASTContext;
struct ASTTemplateArgumentListInfo;
class CompoundStmt;
class ContractStmt;
class DependentFunctionTemplateSpecializationInfo;
class EnumDecl;
class Expr;
Expand Down Expand Up @@ -769,11 +770,13 @@ struct QualifierInfo {
/// Contains type source information through TypeSourceInfo.
class DeclaratorDecl : public ValueDecl {
// A struct representing a TInfo, a trailing requires-clause and a syntactic
// qualifier, to be used for the (uncommon) case of out-of-line declarations
// and constrained function decls.
// qualifier, to be used for the (uncommon) case of out-of-line declarations,
// constrained function decls or functions with contracts.
struct ExtInfo : public QualifierInfo {
TypeSourceInfo *TInfo;
Expr *TrailingRequiresClause = nullptr;
SmallVector<ContractStmt *> PreContracts = {};
SmallVector<ContractStmt *> PostContracts = {};
};

llvm::PointerUnion<TypeSourceInfo *, ExtInfo *> DeclInfo;
Expand Down Expand Up @@ -853,8 +856,22 @@ class DeclaratorDecl : public ValueDecl {
: nullptr;
}

SmallVector<ContractStmt *> getPreContracts() const {
if (hasExtInfo()) return getExtInfo()->PreContracts;
return {};
}

SmallVector<ContractStmt *> getPostContracts() const {
if (hasExtInfo()) return getExtInfo()->PostContracts;
return {};
}

void setTrailingRequiresClause(Expr *TrailingRequiresClause);

void setPreContracts(SmallVector<ContractStmt *> PreContracts);

void setPostContracts(SmallVector<ContractStmt *> PostContracts);

unsigned getNumTemplateParameterLists() const {
return hasExtInfo() ? getExtInfo()->NumTemplParamLists : 0;
}
Expand Down Expand Up @@ -2037,6 +2054,7 @@ class FunctionDecl : public DeclaratorDecl,
LazyDeclStmtPtr Body;
/// Information about a future defaulted function definition.
DefaultedOrDeletedFunctionInfo *DefaultedOrDeletedInfo;
///
};

unsigned ODRHash;
Expand Down Expand Up @@ -2126,7 +2144,9 @@ class FunctionDecl : public DeclaratorDecl,
const DeclarationNameInfo &NameInfo, QualType T,
TypeSourceInfo *TInfo, StorageClass S, bool UsesFPIntrin,
bool isInlineSpecified, ConstexprSpecKind ConstexprKind,
Expr *TrailingRequiresClause = nullptr);
Expr *TrailingRequiresClause = nullptr,
SmallVector<ContractStmt *> PreContracts = {},
SmallVector<ContractStmt *> PostContracts = {});

using redeclarable_base = Redeclarable<FunctionDecl>;

Expand Down Expand Up @@ -2162,20 +2182,23 @@ class FunctionDecl : public DeclaratorDecl,
TypeSourceInfo *TInfo, StorageClass SC, bool UsesFPIntrin = false,
bool isInlineSpecified = false, bool hasWrittenPrototype = true,
ConstexprSpecKind ConstexprKind = ConstexprSpecKind::Unspecified,
Expr *TrailingRequiresClause = nullptr) {
Expr *TrailingRequiresClause = nullptr,
SmallVector<ContractStmt *> PreContracts = {},
SmallVector<ContractStmt *> PostContracts = {}) {
DeclarationNameInfo NameInfo(N, NLoc);
return FunctionDecl::Create(C, DC, StartLoc, NameInfo, T, TInfo, SC,
UsesFPIntrin, isInlineSpecified,
hasWrittenPrototype, ConstexprKind,
TrailingRequiresClause);
TrailingRequiresClause, PreContracts, PostContracts);
}

static FunctionDecl *
Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc,
const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo,
StorageClass SC, bool UsesFPIntrin, bool isInlineSpecified,
bool hasWrittenPrototype, ConstexprSpecKind ConstexprKind,
Expr *TrailingRequiresClause);
Expr *TrailingRequiresClause, SmallVector<ContractStmt *> PreContracts,
SmallVector<ContractStmt *> PostContracts);

static FunctionDecl *CreateDeserialized(ASTContext &C, GlobalDeclID ID);

Expand Down
41 changes: 30 additions & 11 deletions clang/include/clang/AST/DeclCXX.h
Original file line number Diff line number Diff line change
Expand Up @@ -2066,9 +2066,12 @@ class CXXMethodDecl : public FunctionDecl {
QualType T, TypeSourceInfo *TInfo, StorageClass SC,
bool UsesFPIntrin, bool isInline,
ConstexprSpecKind ConstexprKind, SourceLocation EndLocation,
Expr *TrailingRequiresClause = nullptr)
Expr *TrailingRequiresClause = nullptr,
SmallVector<ContractStmt *> PreContracts = {},
SmallVector<ContractStmt *> PostContracts = {})
: FunctionDecl(DK, C, RD, StartLoc, NameInfo, T, TInfo, SC, UsesFPIntrin,
isInline, ConstexprKind, TrailingRequiresClause) {
isInline, ConstexprKind, TrailingRequiresClause,
PreContracts, PostContracts) {
if (EndLocation.isValid())
setRangeEnd(EndLocation);
}
Expand All @@ -2079,7 +2082,9 @@ class CXXMethodDecl : public FunctionDecl {
const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo,
StorageClass SC, bool UsesFPIntrin, bool isInline,
ConstexprSpecKind ConstexprKind, SourceLocation EndLocation,
Expr *TrailingRequiresClause = nullptr);
Expr *TrailingRequiresClause = nullptr,
SmallVector<ContractStmt *> PreContracts = {},
SmallVector<ContractStmt *> PostContracts = {});

static CXXMethodDecl *CreateDeserialized(ASTContext &C, GlobalDeclID ID);

Expand Down Expand Up @@ -2547,7 +2552,9 @@ class CXXConstructorDecl final
bool UsesFPIntrin, bool isInline,
bool isImplicitlyDeclared, ConstexprSpecKind ConstexprKind,
InheritedConstructor Inherited,
Expr *TrailingRequiresClause);
Expr *TrailingRequiresClause,
SmallVector<ContractStmt *> PreContracts,
SmallVector<ContractStmt *> PostContracts);

void anchor() override;

Expand Down Expand Up @@ -2590,7 +2597,9 @@ class CXXConstructorDecl final
ExplicitSpecifier ES, bool UsesFPIntrin, bool isInline,
bool isImplicitlyDeclared, ConstexprSpecKind ConstexprKind,
InheritedConstructor Inherited = InheritedConstructor(),
Expr *TrailingRequiresClause = nullptr);
Expr *TrailingRequiresClause = nullptr,
SmallVector<ContractStmt *> PreContracts = {},
SmallVector<ContractStmt *> PostContracts = {});

void setExplicitSpecifier(ExplicitSpecifier ES) {
assert((!ES.getExpr() ||
Expand Down Expand Up @@ -2809,10 +2818,13 @@ class CXXDestructorDecl : public CXXMethodDecl {
const DeclarationNameInfo &NameInfo, QualType T,
TypeSourceInfo *TInfo, bool UsesFPIntrin, bool isInline,
bool isImplicitlyDeclared, ConstexprSpecKind ConstexprKind,
Expr *TrailingRequiresClause = nullptr)
Expr *TrailingRequiresClause = nullptr,
SmallVector<ContractStmt *> PreContracts = {},
SmallVector<ContractStmt *> PostContracts = {})
: CXXMethodDecl(CXXDestructor, C, RD, StartLoc, NameInfo, T, TInfo,
SC_None, UsesFPIntrin, isInline, ConstexprKind,
SourceLocation(), TrailingRequiresClause) {
SourceLocation(), TrailingRequiresClause, PreContracts,
PostContracts) {
setImplicit(isImplicitlyDeclared);
}

Expand All @@ -2824,7 +2836,9 @@ class CXXDestructorDecl : public CXXMethodDecl {
const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo,
bool UsesFPIntrin, bool isInline, bool isImplicitlyDeclared,
ConstexprSpecKind ConstexprKind,
Expr *TrailingRequiresClause = nullptr);
Expr *TrailingRequiresClause = nullptr,
SmallVector<ContractStmt *> PreContracts = {},
SmallVector<ContractStmt *> PostContracts = {});
static CXXDestructorDecl *CreateDeserialized(ASTContext &C, GlobalDeclID ID);

void setOperatorDelete(FunctionDecl *OD, Expr *ThisArg);
Expand Down Expand Up @@ -2865,10 +2879,13 @@ class CXXConversionDecl : public CXXMethodDecl {
TypeSourceInfo *TInfo, bool UsesFPIntrin, bool isInline,
ExplicitSpecifier ES, ConstexprSpecKind ConstexprKind,
SourceLocation EndLocation,
Expr *TrailingRequiresClause = nullptr)
Expr *TrailingRequiresClause = nullptr,
SmallVector<ContractStmt *> PreContracts = {},
SmallVector<ContractStmt *> PostContracts = {})
: CXXMethodDecl(CXXConversion, C, RD, StartLoc, NameInfo, T, TInfo,
SC_None, UsesFPIntrin, isInline, ConstexprKind,
EndLocation, TrailingRequiresClause),
EndLocation, TrailingRequiresClause, PreContracts,
PostContracts),
ExplicitSpec(ES) {}
void anchor() override;

Expand All @@ -2883,7 +2900,9 @@ class CXXConversionDecl : public CXXMethodDecl {
const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo,
bool UsesFPIntrin, bool isInline, ExplicitSpecifier ES,
ConstexprSpecKind ConstexprKind, SourceLocation EndLocation,
Expr *TrailingRequiresClause = nullptr);
Expr *TrailingRequiresClause = nullptr,
SmallVector<ContractStmt *> PreContracts = {},
SmallVector<ContractStmt *> PostContracts = {});
static CXXConversionDecl *CreateDeserialized(ASTContext &C, GlobalDeclID ID);

ExplicitSpecifier getExplicitSpecifier() {
Expand Down
3 changes: 3 additions & 0 deletions clang/include/clang/AST/RecursiveASTVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -2443,6 +2443,9 @@ DEF_TRAVERSE_STMT(ObjCAtThrowStmt, {})
DEF_TRAVERSE_STMT(ObjCAtTryStmt, {})
DEF_TRAVERSE_STMT(ObjCForCollectionStmt, {})
DEF_TRAVERSE_STMT(ObjCAutoreleasePoolStmt, {})
// FIXME(EricWF): This may have a declaration with a body eventually.
// Will that need a different implementation.
DEF_TRAVERSE_STMT(ContractStmt, {})

DEF_TRAVERSE_STMT(CXXForRangeStmt, {
if (!getDerived().shouldVisitImplicitCode()) {
Expand Down
19 changes: 19 additions & 0 deletions clang/include/clang/AST/Stmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ enum class CXXNewInitializationStyle;
enum class PredefinedIdentKind;
enum class SourceLocIdentKind;
enum class StringLiteralKind;
enum class ContractKind;

//===----------------------------------------------------------------------===//
// AST classes for statements.
Expand Down Expand Up @@ -849,6 +850,21 @@ class alignas(void *) Stmt {
SourceLocation RParenLoc;
};

class ContractAssertBitfields {
friend class ASTStmtReader;
friend class ASTStmtWriter;
friend class ContractStmt;

LLVM_PREFERRED_TYPE(StmtBitfields)
unsigned : NumStmtBits;

LLVM_PREFERRED_TYPE(bool)
unsigned HasResultName : 1;

LLVM_PREFERRED_TYPE(ContractKind)
unsigned ContractKind : 2;
};

class CXXNewExprBitfields {
friend class ASTStmtReader;
friend class ASTStmtWriter;
Expand Down Expand Up @@ -1266,6 +1282,9 @@ class alignas(void *) Stmt {
// C++ Coroutines expressions
CoawaitExprBitfields CoawaitBits;

// C++ contracts
ContractAssertBitfields ContractAssertBits;

// Obj-C Expressions
ObjCIndirectCopyRestoreExprBitfields ObjCIndirectCopyRestoreExprBits;

Expand Down
99 changes: 99 additions & 0 deletions clang/include/clang/AST/StmtCXX.h
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,105 @@ class CoreturnStmt : public Stmt {
}
};

enum class ContractKind { Pre, Post, Assert };

class ContractStmt final : public Stmt,
private llvm::TrailingObjects<ContractStmt, Stmt *> {
friend class ASTStmtReader;
friend TrailingObjects;

enum { ResultNameDeclOffset = 0, ConditionOffset = 1, Count = 2 };

public:
// These types correspond to the three C++ 'await_suspend' return variants

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha :)


private:
unsigned condOffset() const {
return ResultNameDeclOffset + ContractAssertBits.HasResultName;
}

Stmt **getSubStmts() { return getTrailingObjects<Stmt *>(); }

Stmt *const *getSubStmts() const { return getTrailingObjects<Stmt *>(); }

SourceLocation KeywordLoc;

public:
ContractStmt(ContractKind CK, SourceLocation KeywordLoc, Expr *Condition)
: Stmt(ContractStmtClass), KeywordLoc(KeywordLoc) {
ContractAssertBits.ContractKind = static_cast<unsigned>(CK);
ContractAssertBits.HasResultName = false;
}

ContractStmt(EmptyShell Empty, ContractKind Kind, bool HasResultName = false)
: Stmt(ContractStmtClass, Empty) {
ContractAssertBits.ContractKind = static_cast<unsigned>(Kind);
ContractAssertBits.HasResultName = HasResultName;
}

static ContractStmt *Create(const ASTContext &C, ContractKind Kind,
SourceLocation KeywordLoc, Expr *Condition,
DeclStmt *ResultNameDecl = nullptr);

static ContractStmt *CreateEmpty(const ASTContext &C, ContractKind Kind,
bool HasResultName = false);

ContractKind getContractKind() const {
return static_cast<ContractKind>(ContractAssertBits.ContractKind);
}
void setContractKind(ContractKind CK) {
ContractAssertBits.ContractKind = static_cast<unsigned>(CK);
}

bool hasResultNameDecl() const { return ContractAssertBits.HasResultName; }

DeclStmt *getResultNameDecl() const {
return hasResultNameDecl()
? static_cast<DeclStmt *>(
getTrailingObjects<Stmt *>()[ResultNameDeclOffset])
: nullptr;
}

void setResultNameDecl(DeclStmt *D) {
assert(hasResultNameDecl() && "no result name decl");
getTrailingObjects<Stmt *>()[ResultNameDeclOffset] = D;
}

void setCondition(Expr *E) {
getTrailingObjects<Stmt *>()[ConditionOffset] = E;
}

Expr *getCond() {
return reinterpret_cast<Expr *>(getTrailingObjects<Stmt *>()[condOffset()]);
}

const Expr *getCond() const {
return reinterpret_cast<Expr *>(getTrailingObjects<Stmt *>()[condOffset()]);
}

void setCond(Expr *Cond) {
getTrailingObjects<Stmt *>()[condOffset()] = reinterpret_cast<Stmt *>(Cond);
}

SourceLocation getKeywordLoc() const { return KeywordLoc; }
SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; }
SourceLocation getEndLoc() const LLVM_READONLY {
return getCond()->getEndLoc();
}

child_range children() {
return child_range(getSubStmts(), getSubStmts() + condOffset() + 1);
}

const_child_range children() const {
return const_child_range(getSubStmts(), getSubStmts() + condOffset() + 1);
}

static bool classof(const Stmt *T) {
return T->getStmtClass() == ContractStmtClass;
}
};

} // end namespace clang

#endif
14 changes: 14 additions & 0 deletions clang/include/clang/Basic/Builtins.td
Original file line number Diff line number Diff line change
Expand Up @@ -2575,6 +2575,20 @@ def SetJmpEx : MSLibBuiltin<"setjmpex.h"> {
let Prototype = "int(jmp_buf)";
}

// C++ contracts
def ContractViolation : Builtin {
let Spellings = ["handle_contract_violation"];
let Prototype = "void()";
let Attributes = [NoThrow, NoReturn, Constexpr];
}

def ContractAssert : Builtin {
let Spellings = ["__builtin_contract_assert"];
let Attributes = [NoThrow, Constexpr];

let Prototype = "void(bool)";
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dead code?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep.


// C99 library functions
// C99 stdarg.h
def VaStart : LibBuiltin<"stdarg.h"> {
Expand Down
2 changes: 2 additions & 0 deletions clang/include/clang/Basic/DiagnosticASTKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@ def note_constexpr_assumption_failed : Note<
"assumption evaluated to false">;
def err_experimental_clang_interp_failed : Error<
"the experimental clang interpreter failed to evaluate an expression">;
def note_constexpr_contract_failure : Error<
"contract failed during execution of constexpr function">;

def warn_integer_constant_overflow : Warning<
"overflow in expression; result is %0 with type %1">,
Expand Down
1 change: 1 addition & 0 deletions clang/include/clang/Basic/LangOptions.def
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ LANGOPT(NoBuiltin , 1, 0, "disable builtin functions")
LANGOPT(NoMathBuiltin , 1, 0, "disable math builtin functions")
LANGOPT(GNUAsm , 1, 1, "GNU-style inline assembly")
LANGOPT(Coroutines , 1, 0, "C++20 coroutines")
LANGOPT(Contracts , 1, 1, "C++2c contracts")
LANGOPT(CoroAlignedAllocation, 1, 0, "prefer Aligned Allocation according to P2014 Option 2")
LANGOPT(DllExportInlines , 1, 1, "dllexported classes dllexport inline methods")
LANGOPT(RelaxedTemplateTemplateArgs, 1, 1, "C++17 relaxed matching of template template arguments")
Expand Down
Loading
Loading