aboutsummaryrefslogtreecommitdiff
path: root/src/stage1/analyze.hpp
AgeCommit message (Collapse)Author
2022-12-06actually remove stage1Andrew Kelley
2022-04-27stage1: Manually lower softfloat ops when neededCody Tapscott
Updates stage1 to manually lower softfloat operations for all unary floating point operations, extension/truncation, and arithmetic.
2021-09-20Address Spaces: Pointer and function info in @TypeRobin Voetter
2021-07-28stage1: Expand SysV C ABI support for small structsBelhorma Bendebiche
While the SysV ABI is not that complicated, LLVM does not allow us direct access to enforce it. By mimicking the IR generated by clang, we can trick LLVM into doing the right thing. This involves two main additions: 1. `AGG` ABI class This is not part of the spec, but since we have to track class per eightbyte and not per struct, the current enum is not enough. I considered adding multiple classes like: `INTEGER_INTEGER`, `INTEGER_SSE`, `SSE_INTEGER`. However, all of those cases would trigger the same code path so it's simpler to collapse into one. This class is only used on SysV. 2. LLVM C ABI type Clang uses different types in C ABI function signatures than the original structs passed in, and does conversion. For example, this struct: `{ i8, i8, float }` would use `{ i16, float }` at ABI boundaries. When passed as an argument, it is instead split into two arguments `i16` and `float`. Therefore, for every struct that passes ABI boundaries we need to keep track of its corresponding ABI type. Here are some more examples: ``` | Struct | ABI equivalent | | { i8, i8, i8, i8 } | i32 | | { float, float } | double | | { float, i32, i8 } | { float, i64 } | ``` Then, we must update function calls, returns, parameter lists and inits to properly convert back and forth as needed.
2021-07-11Rename IrInstSrc to Stage1ZirInst and IrInstGen to Stage1AirInstMartin Wickham
2021-06-16Add create_sentineled_str_litDaniele Cocca
2021-06-16{create,init}_const_slice: accept custom sentinelDaniele Cocca
2021-05-28stage1: rework tokenizer to match stage2Andrew Kelley
* Extracts AstGen logic from ir.cpp into astgen.cpp. Reduces the largest file of stage1 from 33,551 lines to 25,510. * tokenizer: rework it completely to match the stage2 tokenizer logic. They can now be maintained together; when one is changed, the other can be changed in the same way. - Each token now takes up 13 bytes instead of 64 bytes. The tokenizer does not parse char literals, string literals, integer literals, etc into meaningful data. Instead, that happens during parsing or astgen. - no longer store line offsets. Error messages scan source files to find the line/column as needed (same as stage2). - main loop: instead of checking the loop, handle a null byte explicitly in the switch statements. This is a nice improvement that we may want to backport to stage2. - delete some dead tokens, artifacts of past syntax that no longer exists. * Parser: fix a TODO by parsing builtin functions as tokens rather than `@` as a separate token. This is how stage2 does it. * Remove some debugging infrastructure. These will need to be redone, if at all, as the code migrates to match stage2. - remove the ast_render code. - remove the IR debugging stuff - remove teh token printing code
2021-04-25stage1: Use correct alignment for asyncCall frameLemonBoy
2020-12-08stage1: Validate the specified cc for lazy fn typesLemonBoy
Closes #7337
2020-11-20stage1: Resolve usingnamespace decls when calling @typeInfoLemonBoy
Closes #7176
2020-10-08stage1: Disallow arrays in function parameters or return typesTadeo Kondrak
Closes #6535.
2020-09-21rename src-self-hosted/ to src/Andrew Kelley