Commit Graph

29316 Commits

Author SHA1 Message Date
Jakub Konka
78b441e8de test/link/macho: test merge literals on x86_64 2024-05-23 12:04:17 +02:00
Jakub Konka
03d0a68356 test/link/macho: clean up merge literals tests on aarch64 2024-05-23 12:04:17 +02:00
Jakub Konka
28d08dd8a6 link/macho: test merging literals targeting ObjC 2024-05-23 12:04:17 +02:00
Jakub Konka
8fc0c7dce1 link/macho: apply fixes to deduping logic
* test non-ObjC literal deduping logic
2024-05-23 12:04:17 +02:00
Jakub Konka
434e69482e link/macho: dedup literals in objects and internal object file 2024-05-23 12:04:17 +02:00
Andrew Kelley
9be8a9000f Revert "implement @expect builtin (#19658)"
This reverts commit a7de02e052.

This did not implement the accepted proposal, and I did not sign off
on the changes. I would like a chance to review this, please.
2024-05-22 09:57:43 -07:00
David Rubin
a7de02e052
implement @expect builtin (#19658)
* implement `@expect`

* add docs

* add a second arg for expected bool

* fix typo

* move `expect` to use BinOp

* update to newer langref format
2024-05-22 10:51:16 -05:00
Jacob Young
ed75f62568 Compilation: better cleanup of temporary files
The diag file did not get deleted on the success path and the dep file
did not get deleted on the failure path.
2024-05-22 10:42:01 -04:00
Andrew Kelley
0286970b19 std autodocs server: don't trim all URLs
This is a partial revert of 6635360dbd.
2024-05-22 07:13:08 -07:00
Veikka Tuominen
0fb2015fd3 llvm: fix @wasmMemory{Size,Grow} for wasm64
Closes #19942
2024-05-22 09:48:52 -04:00
Jakub Konka
d78968c1b5 test/link: actually run tests requiring symlinks on non-Win
Fixes regression introduced by 5d5e89aa8d

Turns out since landing that PR we haven't run any tests requiring
symlinks or any Apple SDK on a macOS host. Not great.
2024-05-22 14:59:32 +02:00
Veikka Tuominen
5fe9f88b13
Merge pull request #20023 from Vexu/fixes
Minor LLVM backend fixes
2024-05-22 11:54:38 +03:00
Jiacai Liu
6635360dbd
std-docs: use open for macOS. 2024-05-21 23:21:17 +03:00
Veikka Tuominen
eb0f871cb9
Merge pull request #19961 from wooster0/errorstuff
Sema: improvements to error messages related to the handling of (error) values
2024-05-21 22:37:00 +03:00
wooster0
ac55685a94 Sema: add missing declared here note 2024-05-22 02:16:56 +09:00
Veikka Tuominen
f776e70c39 llvm: fix lowering of packed structs with optional pointers
Closes #20022
2024-05-21 19:52:25 +03:00
Veikka Tuominen
167854c19c llvm: lower ptr to int constants with correct address spaces
Closes #19915
2024-05-21 19:52:00 +03:00
orvit
ae44e199a8
use constant in formatType 2024-05-21 14:41:49 +00:00
poypoyan
aa07366513
std.math.big.int.Managed: adjust size of arg for limbs_buffer in format() 2024-05-21 13:28:05 +00:00
Simon Brown
33d7815813 Implement addManyAsSlice for BoundedArray 2024-05-21 13:46:05 +03:00
Ridai Govinda Pombo
28476a5ee9 cmake/llvm: Don't unset LLVM_CONFIG_EXE 2024-05-20 17:36:07 -04:00
Andrew Kelley
50a1419457 update libcxx and libcxxabi to llvm 18.1.6
Contains fixes for OpenBSD
2024-05-20 16:12:36 -04:00
Alex Kladov
9f4f43cf7f std: align PriorityQueue and ArrayList API-wise
ArrayList uses `items` slice  to store len initialized items, while
PriorityQueue stores `capacity` potentially uninitialized items.

This is a surprising difference in the API that leads to bugs!

https://github.com/tigerbeetle/tigerbeetle/pull/1948
2024-05-20 12:04:20 -04:00
Veikka Tuominen
8aae0d87b5 Target: add OpenHarmonyOS ABI
Closes #20009
2024-05-20 09:25:52 -04:00
Andrew Kelley
9691da71cd
Merge pull request #19969 from BratishkaErik/CMake/cleanup
CMake: general cleanup and fixes
2024-05-20 07:59:15 -04:00
Jacob Young
ad72172293 Build.Step.Run: fix cache management when there are side effects
Closes #19947
2024-05-20 07:45:31 -04:00
Andrew Kelley
657442485a
Merge pull request #19987 from Frojdholm/fix-gpa-double-free-stack-traces
gpa: Fix GeneralPurposeAllocator double free stack traces
2024-05-20 07:37:41 -04:00
february cozzocrea
d67d9fa357 Minor follow-up improvements to PR #19227 for aro translate-c 2024-05-20 07:35:10 -04:00
Wes Koerber
4239a0d9c3 fix: incorrect field sizes in std.os.linux.ifmap 2024-05-20 13:50:06 +03:00
Hampus Fröjdholm
762e2a4b52 gpa: Fix GeneralPurposeAllocator double free stack traces
The wrong `size_class` was used when fetching stack traces from empty
buckets. The `size_class` would always be the maximum value after
exhausting the search of active buckets rather than the actual
`size_class` of the allocation.
2024-05-18 11:46:37 +02:00
Hampus Fröjdholm
61f1b2db70 gpa: Add helper to calculate size class of empty buckets
Empty buckets have their `alloc_cursor` set to `slot_count` to allow the
size class to be calculated later. This happens deep within the free
function.

This adds a helper and a test to verify that the size class of empty
buckets is indeed recoverable.
2024-05-18 11:43:42 +02:00
Eric Joldasov
1e785984b0
CMake: try to fix CI failures
Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
2024-05-15 15:37:12 +05:00
Eric Joldasov
1079b5fe63
CMake: remove ZIG_USE_CCACHE option
Not really useful after old C++ compiler removal, and
zig build has own cache system. If someone still wants it,
`CMAKE_C_COMPILER_LAUNCHER` and `CMAKE_CXX_COMPILER_LAUNCHER` exist.

From CMake docs:

> RULE_LAUNCH_COMPILE
> Note: This property is intended for internal use by ctest(1).
> Projects and developers should use the <LANG>_COMPILER_LAUNCHER
> target properties or the associated CMAKE_<LANG>_COMPILER_LAUNCHER
> variables instead.

Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
2024-05-14 23:40:42 +05:00
Eric Joldasov
34ed49c62d
CMake: refactor ZIG_PIE and ZIG_BUILD_ARGS
Set `ZIG_PIE` default to be same as `CMAKE_POSITION_INDEPENDENT_CODE`, and
add check for situation when `ZIG_PIE` is set to True but CMake does not
support compiling position independent code. CMake's support is needed
for "zigcpp" target.

Also remove temporary variables for constructing `ZIG_BUILD_ARGS`,
instead use `list(APPEND ...)` functions.

Also remove long unused `ZIG_NO_LANGREF` variable.

Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
2024-05-14 23:40:42 +05:00
Eric Joldasov
b59c722a3f
CMake: clean CMAKE_{SOURCE,BUILD}_DIR
Replace `CMAKE_SOURCE_DIR` and `CMAKE_BUILD_DIR` with different variables,
or in some cases just remove them.

For some function arguments, prepended `CMAKE_SOURCE_DIR` was removed without
replacement. This includes:
 * Sources for `add_library` and `add_executable` (`ZIG_CPP_SOURCES` and `ZIG_WASM2C_SOURCES`)
 * Inputs for `configure_file` and `target_include_directory`
 * For arguments above, CMake already prepends
   `CMAKE_CURRENT_SOURCE_DIR` to them by default, if they are relative paths.
   Additionaly, it was removed from arguments of commands that have `WORKING_DIRECTORY` set to
   `PROJECT_SOURCE_DIR`, they will be similarly converted by CMake for us.

Also:
 * Move project declaration to the top so that these variables are
available earlier.
 * Avoid calling "git" executable if ".git" directory does not exist.
 * Swap "--prefix" and `ZIG_BUILD_ARGS` arguments in cmake/install.cmake
   to match same "zig2 build" command in CMakeLists.txt and allow
   overriding "--prefix" argument

Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
2024-05-14 23:40:41 +05:00
Eric Joldasov
c2ad0220e0
CMake: remove C/C++ flags override for static executable
They were introduced in https://github.com/ziglang/zig/pull/3467 and
5b51f41cee , and become obsolete since
C++-based compiler was removed: all C or C++ sources built by CMake
are just intermediate steps in bootstrapping.

Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
2024-05-14 23:40:41 +05:00
Eric Joldasov
9574d6888e
build.zig: sync "exe_cflags" with CMake
Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
2024-05-14 23:40:41 +05:00
Eric Joldasov
1f7ca6b2df
CMake: refactor "zigcpp" target logic
* Localize most of the global properties and functions, for some time
  they are only needed for "zigcpp" static library (sometimes with PUBLIC
  keyword, so that it will propagate to zig2): `CMAKE_*_OUTPUT_DIRECTORY`
  and two calls to `include_directories`. This removes useless flags when
  building other targets and cleans build log a bit.
* Remove `EXE_CXX_FLAGS` variable, instead use more appropriate specific
  properties and functions for this target. This gives better errors if
  compiler does not support some of them, and CMake also handles for us
  duplicate flags. It's also easier to read side-by-side with same
  flags from build.zig .
* Add some comments.

Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
2024-05-14 23:40:41 +05:00
Eric Joldasov
1ffa6a0e79
CMake: remove unused variables EXE_LDFLAGS and ZIG_LIB_DIR
Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
2024-05-14 23:40:41 +05:00
Eric Joldasov
2380f6aadc
CMake: bump minimum required version to "3.15"
Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
2024-05-14 23:40:41 +05:00
Jakub Konka
6a65561e3e
Merge pull request #19958 from ziglang/macho-check-object
Step.CheckObject: add support for dumping raw section contents for MachO
2024-05-14 07:11:41 +02:00
Wooster
f14cf13ff8 Sema: suggest using try/catch/if on method call on error union 2024-05-14 01:13:49 +09:00
r00ster91
9ae43567a3 Sema: improve error set/union discard/ignore errors
Previously the error had a note suggesting to use `try`, `catch`, or
`if`, even for error sets where none of those work.
Instead, in case of an error set the way you can handle the error
depends very much on the specific case. For example you might be in a
`catch` where you are discarding or ignoring the error set capture
value, in which case one way to handle the error might be to `return`
the error.
So, in that case, we do not attach that error note.

Additionally, this makes the error tell you what kind of an error it is:
is it an error set or an error union? This distinction is very relevant
in how to handle the error.
2024-05-14 01:13:49 +09:00
r00ster91
8579904ddd Sema: add error note for !?Type types when optional type is expected 2024-05-14 01:13:49 +09:00
r00ster91
31689d0dd9 Sema: remove periods from the few error messages that have them
For consistency.
2024-05-14 01:13:49 +09:00
r00ster91
60830e36e3 Sema error: talk about discarding instead of suppressing
Maybe I'm just being pedantic here (most likely) but I don't like how we're
just telling the user here how to "suppress this error" by "assigning the value to '_'".
I think it's better if we use the word "discard" here which I think is
the official terminology and also tells the user what it actually means
to "assign the value to '_'".

Also, using the value would also be a way to "suppress the error".
It is just one of the two options: discard or use.
2024-05-14 01:13:48 +09:00
Jakub Konka
2d537da6bd Step.CheckObject: support dumping raw section contents for MachO 2024-05-13 09:14:35 +02:00
Jakub Konka
5d619da2de Step.CheckObject: put MachO object parsing logic in ObjectContext wrapper 2024-05-13 08:56:15 +02:00
Jakub Konka
6f117dbca4 test/standalone: fix iOS smoke test 2024-05-13 08:55:27 +02:00
Andrew Kelley
e2ec54bb38
Merge pull request #19926 from squeek502/windows-sdk-cachepath-registry
WindowsSdk: Fix finding the _Instances directory when it's not in the default location
2024-05-12 09:39:13 -04:00