12417 Commits

Author SHA1 Message Date
kcbanner
2f75d20d87 debug: use an explicit context type instead of anytype for dumpStackTraceFromBase, update crash_report to use this for exceptions 2023-07-20 22:58:13 -04:00
Hao Li
8a18abfd60
Remove the SingleThread limitation for ARM (#16442)
The libc++ issue has been fixed in https://reviews.llvm.org/D118391, so
we don't have this issue in llvm 16+

closes #6573
2023-07-20 19:17:28 -04:00
Frank Denis
124448c1b6 Include system headers path when targeting assembly_with_cpp
This is consistent with what clang and gcc are doing, because
headers such as <cet.h> are specifically designed to be used
in the context of assembly code.

Fixes #16449
2023-07-20 16:14:12 -07:00
Andrew Kelley
3f15010abe
Merge pull request #16430 from jacobly0/llvm-builder
llvm: begin the journey of independence from llvm
2023-07-20 12:55:03 -07:00
Jacob Young
4d31d4d875 llvm: cleanup LLVM IR dumping 2023-07-20 02:44:40 -04:00
Jacob Young
a1062c63ca llvm: add Builder trailing extra interface 2023-07-20 01:48:50 -04:00
Jacob Young
ea72fea1a4 llvm: fix bootstrap 2023-07-19 23:39:42 -04:00
Jacob Young
9dd7a9eb02 llvm: fix various crashes 2023-07-19 23:38:40 -04:00
Jacob Young
9c4d5e64b4 llvm: minor fixes 2023-07-19 23:38:40 -04:00
Jacob Young
9afb349aba llvm: convert most instructions 2023-07-19 23:38:40 -04:00
Jacob Young
ef84e86992 llvm: convert cursor positioning 2023-07-19 23:38:40 -04:00
Jacob Young
3f46e747a8 llvm: convert basic block creation 2023-07-19 23:38:40 -04:00
Jacob Young
8fde3a8f04 llvm: finish converting constants 2023-07-19 23:38:40 -04:00
Jacob Young
1f8407c356 llvm: cleanup management and implement more const functions 2023-07-19 23:38:40 -04:00
Jacob Young
7ec7fe5359 llvm: cleanup init 2023-07-19 23:38:40 -04:00
Jacob Young
ff8a49448c llvm: finish converting lowerValue 2023-07-19 23:38:40 -04:00
Jacob Young
2cb52235b9 llvm: convert all calls to constInt 2023-07-19 23:38:40 -04:00
Jacob Young
65fd401c06 llvm: remove more usages of llvm.Type 2023-07-19 23:38:40 -04:00
Jacob Young
d167bd4b56 llvm: finish converting lowerType 2023-07-19 23:38:40 -04:00
Jacob Young
3314fd83af llvm: compute data layout without help like a grownup compiler 2023-07-19 23:38:40 -04:00
Jacob Young
d195173ba2 llvm: start tracking more things without relying on the llvm api 2023-07-19 23:38:40 -04:00
notcancername
ce859cfcb8 cbe: fix bug where empty enum would be generated
fix a bug where an invalid empty enum would be emitted into the C
source file if the global error set was empty.
2023-07-19 23:20:25 -04:00
Luuk de Gram
cec1e973b6
Merge pull request #16439 from Luukdegram/wasm-linker
wasm-linker: finish shared-memory & TLS implementation
2023-07-19 21:55:30 +02:00
Luuk de Gram
142dbc7b82
wasm-linker: create TLS Wasm globals correctly
Previously, they were only created when we had any TLS segment.
This meant that while the symbol existed, the global itself wouldn't.
The result of this was a crash during symbol names writing as it
would attempt to write the symbol name of a global that didn't exist.
Now we always create them, and instead update its `init` value during
`setupMemory`.

In the future, the entire symbol (and global) will be removed by
the garbage collector.
2023-07-19 17:22:46 +02:00
Luuk de Gram
3fd6e93f4f
wasm-linker: prevent double-free on parse failure 2023-07-19 17:22:46 +02:00
Luuk de Gram
2672f7d9e8
wasm-linker: shared-memory fixes
Implements the `start` section which will execute a given function
at startup of the program. After function execution, the _start
function will be called by the runtime. In the case of shared-memory
we set this section to the function `__wasm_init_memory` which will
initialize all memory on startup.

This also fixes the above mentioned function to ensure we correctly
lower the i32 values.

Lastly, this fixes a typo where we would retrieve a global, instead
of setting its value.
2023-07-19 17:22:46 +02:00
Luuk de Gram
376e1b4603
wasm-linker: implement TLS relocations 2023-07-19 17:22:46 +02:00
Luuk de Gram
388589987c
wasm-linker: allow explicit memory exports
Rather than verifying if importing memory is false, we now rely
on the option that was passed to the CLI (where export is defaulted
to `true` unless only import-memory is given).
2023-07-19 17:22:45 +02:00
Andrew Kelley
d5d067211b Autodoc: fix crash on new InternPool addition 2023-07-18 23:45:47 -07:00
Andrew Kelley
9262b6076f Sema: fix generic function instances not respecting linksection 2023-07-18 21:46:30 -07:00
Andrew Kelley
c597ba32d9 Sema: fix return type of generic function is function pointer
also that's one less standalone test and one more behavior test.
2023-07-18 21:15:16 -07:00
Andrew Kelley
3145ae561d Sema: fix compile error source location regressions 2023-07-18 19:02:06 -07:00
Andrew Kelley
8daa8d255b Sema: fix fn_proto_param LazySrcLoc resolution
to match source code span from merge-base.
2023-07-18 19:02:06 -07:00
Andrew Kelley
727b371bbc Sema: fix source location crash for function prototypes 2023-07-18 19:02:06 -07:00
Andrew Kelley
0153f3a8f9 Sema: fix crash: array_in_c_exported_function
Fuck it, we're storing decl indexes in LazySrcLoc now.
2023-07-18 19:02:06 -07:00
Andrew Kelley
47499bf47b Sema: enhance generic call error message
when the type of an anytype parameter is a comptime-only type but the
argument at the callsite is runtime-known.
2023-07-18 19:02:06 -07:00
Andrew Kelley
abe71b40c5 Sema: use src_decl for exported status
Fixes wrong calling convention in instantiated functions.
2023-07-18 19:02:06 -07:00
Andrew Kelley
3f2a4720b1 compiler: fix branch regressions
* getOwnedFunctionIndex no longer checks if the value is actually a
   function.
 * The callsites to `intern` that I added want to avoid the `getCoerced`
   call, so I added `intern2`.
 * Adding to inferred error sets should not happen if the destination
   error set is not the inferred error set of the current Sema instance.
 * adhoc_inferred_error_set_type can be seen by the backend. Treat it
   like anyerror.
2023-07-18 19:02:06 -07:00
Andrew Kelley
b03d34429d compiler: work around slightly different generics semantics
Both of these cases are interesting, were not covered by behavior tests,
and should be inspected carefully with regards to the language
specification.
2023-07-18 19:02:06 -07:00
Andrew Kelley
d15e8f8017 Sema: resolve inferred error set with function state in_progress
This way dependency loops are reported instead of the compiler crashing.
2023-07-18 19:02:06 -07:00
Andrew Kelley
e1935d4d16 InternPool: fix funcAnalysis through func_coerced 2023-07-18 19:02:06 -07:00
Andrew Kelley
ad8c250103 Sema: reset generic_owner for inline/comptime calls 2023-07-18 19:02:06 -07:00
Andrew Kelley
e27b2b3ab9 Sema: restore WipCaptures logic
Earlier in this branch, I failed to properly port this logic while
reworking generic functions. This commit fixes it.
2023-07-18 19:02:06 -07:00
Andrew Kelley
3a4d565254 Sema: fix zirStoreNode crash
when other function's inferred error set is the return type of a
function, it should not try to insert the error set into it.

this implies that this branch fixes a bug in master branch.
2023-07-18 19:02:06 -07:00
Andrew Kelley
7c66bd39be Sema: fix analyzeIsNonErrComptimeOnly false positive
The logic here was not properly ported from master branch which broke
errdefers.
2023-07-18 19:02:06 -07:00
Andrew Kelley
45a8c6c1f4 AstGen: idiomatic use of switch 2023-07-18 19:02:06 -07:00
Andrew Kelley
6754d1a182 Sema: fix access of inactive union field
When instantiating a generic function call, in the case of a function
call generated by the language, the LazySrcLoc provided for `call_src`
may not point to anything interesting.
2023-07-18 19:02:06 -07:00
Andrew Kelley
9f61c29bfb InternPool: unwrap func_coerced when using it as generic_owner 2023-07-18 19:02:06 -07:00
Andrew Kelley
1b70fca534 Sema: fix generic function instance with comptime return type 2023-07-18 19:02:06 -07:00
Andrew Kelley
722bd22508 Sema: fix not setting up adhoc inferred error set correctly
for comptime/inline calls.
2023-07-18 19:02:06 -07:00