aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
AgeCommit message (Collapse)Author
2018-01-06Darwin -> MacOSX, added Zen. See #438Andrea Orru
2017-12-26self-hosted: build against zig_llvm and embedded LLDAndrew Kelley
Now the self-hosted compiler re-uses the same C++ code for interfacing with LLVM as the C++ code. It also links against the same LLD library files.
2017-12-22explicitly return from blocksAndrew Kelley
instead of last statement being expression value closes #629
2017-12-20add labeled loops, labeled break, labeled continue. remove gotoAndrew Kelley
closes #346 closes #630 regression: translate-c can no longer translate switch statements. after #629 we can ressurect and modify the code to utilize arbitrarily returning from blocks.
2017-12-19fix assert when wrapping zero bit type in nullableAndrew Kelley
closes #659
2017-12-19export keyword works againAndrew Kelley
2017-12-19wip bring back export keywordAndrew Kelley
2017-12-18wip export rewriteAndrew Kelley
2017-12-10rename @EnumTagType to @TagType in type namesAndrew Kelley
2017-12-06add higher level arg-parsing API + misc. changesAndrew Kelley
* add @noInlineCall - see #640 This fixes a crash in --release-safe and --release-fast modes where the optimizer inlines everything into _start and clobbers the command line argument data. If we were able to verify that the user's code never reads command line args, we could leave off this "no inline" attribute. * add i29 and u29 primitive types. u29 is the type of alignment, so it makes sense to be a primitive. probably in the future we'll make any `i` or `u` followed by digits into a primitive. * add `aligned` functions to Allocator interface * add `os.argsAlloc` and `os.argsFree` so that you can get a `[]const []u8`, do whatever arg parsing you want, and then free it. For now this uses the other API under the hood, but it could be reimplemented to do a single allocation. * add tests to make sure command line argument parsing works.
2017-12-05add implicit cast from enum to unionAndrew Kelley
when the enum is the tag type of the union and is comptime known to be of a void field of the union See #642
2017-12-04fix abi alignment of union-enums not counting tag typeAndrew Kelley
add more tests for unions See #618
2017-12-03rework enums and unions and their relationship to each otherAndrew Kelley
* @enumTagName renamed to @tagName and it works on enums and union-enums * Remove the EnumTag type. Now there is only enum and union, and the tag type of a union is always an enum. * unions support specifying the tag enum type, and they support inferring an enum tag type. * Enums no longer support field types but they do support setting the tag values. Likewise union-enums when inferring an enum tag type support setting the tag values. * It is now an error for enums and unions to have 0 fields. * switch statements support union-enums closes #618
2017-12-02ability to set tag values of enumsAndrew Kelley
also remove support for enums with 0 values closes #305
2017-12-02casting between integer and enum only works via tag typeAndrew Kelley
See #305
2017-12-01packed structs can have enums with explicit tag typesAndrew Kelley
See #305
2017-11-30ability to specify tag type of enumsAndrew Kelley
see #305
2017-11-29fix capturing value of switch with all unreachable prongsAndrew Kelley
closes #635
2017-11-24fix assertion failed when invalid type encounteredAndrew Kelley
2017-11-24rename "parsec" to "translate-c"Andrew Kelley
2017-11-16union secret field is the tag index instead of distinct type indexAndrew Kelley
See #144
2017-11-15unions have a secret field for the typeAndrew Kelley
See #144
2017-11-15basic union supportAndrew Kelley
See #144
2017-11-10fix test failuresAndrew Kelley
put all the codegen for fn prototypes to the same place
2017-11-08fix enum sizes too largeAndrew Kelley
closes #598
2017-11-06add @memberType and @memberName builtin functionsAndrew Kelley
see #383 there is a plan to unify most of the reflection into 2 builtin functions, as outlined in the above issue, but this gives us needed features for now, and we can iterate on the design in future commits
2017-11-03Windows libc & static libc are located in the same dir which is already ↵dimenus
covered by msvc_lib_dir
2017-11-02fix incorrect debug info for empty structsAndrew Kelley
closes #579 now all tests pass for llvm master branch
2017-11-01windows: use the same libc search within a compilation unitAndrew Kelley
2017-11-01WIN32: Linking with the CRT at runtime. (#570)Dimenus
Disclaimer: Forgive me if my format sucks, I've never submitted a PR before! Fixes: #517 I added a few things to allow zig to link with the CRT properly both statically and dynamically. In Visual Studio 2017, Microsoft changed how the c-runtime is factored again. With this change, they also added a COM interface to allow you to query the respective Visual Studio instance for two of them. This does that and also falls back on a registry query for 2015 support. If you're using a Visual Studio instance older than 2015, you'll have to use the existing options available with the zig compiler. Changes are listed below along with a general description of the changes. all_types.cpp: The separate variables for msvc/kern32 have been removed and all win32 libc directory paths have been combined into a ZigList since we're querying more than two directories and differentiating one from another doesn't matter to lld. analyze.cpp: The existing functions were extended to support querying libc libs & libc headers at runtime. codegen.cpp/hpp: Microsoft uses the new 'Universal C Runtime' name now. Doesn't matter from a functionality standpoint. I left the compiler switches as is to not introduce any breaking changes. link.cpp: We're linking 4 libs and generating another in order to support the UCRT. Dynamic: msvcrt/d, vcruntime/d, ucrt/d, legacy_stdio_definitions.lib Static: libcmt/d, libvcruntime/d libucrt/d, legacy_stdio_definitions.lib main.cpp: Update function call names. os.cpp/hpp: COM/Registry interface for querying Windows UCRT/SDK. Sources: [Windows CRT](https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features) [VS 2015 Breaking Changes](https://msdn.microsoft.com/en-us/library/bb531344.aspx)
2017-10-27use llvm named structs for const values when possibleAndrew Kelley
normally we want to use llvm types for constants. but union constants (which are found inside enums) when they are initialized with the non-most-aligned-member must be unnamed structs. these bubble up to all aggregate types. if a constant of an aggregate type contains, recursively, a union constant with a non-most-aligned-member initialized, the aggregate typed constant must be unnamed too. this fixes some of the asserts that were coming in from llvm master branch.
2017-10-26better output when @cImport generates invalid zigAndrew Kelley
2017-10-25fix crash on field access of opaque typeAndrew Kelley
2017-10-25cleaner verbose flags and zig build prints failed commandAndrew Kelley
2017-10-16look for libc at runtime on windowsAndrew Kelley
See #539 before we close the issue we should also detect MSVC 2017 but this gets us started with supporting MSVC 2015
2017-10-16ability to make a DLLAndrew Kelley
See #302
2017-10-14build-exe allows direct export of WinMainCRTStartupAndrew Kelley
2017-09-30remove zigrtAndrew Kelley
adds test case for #394 partially reverts a32b5929ccf8cbf79396d8924097a1a911985dac
2017-09-24windows gui hello worldAndrew Kelley
2017-09-23improvements to windows supportAndrew Kelley
See #302
2017-09-20parsec: cleaner shifting code for fixed size typesAndrew Kelley
2017-09-17fix crash when enum has invalid fieldAndrew Kelley
closes #468
2017-09-14depend on embedded SoftFloat-3d instead of __float128Andrew Kelley
See #302 See #467
2017-09-11Add support for MSVCJonathan Marler
2017-09-10fix uninitialized variableAndrew Kelley
2017-09-09more compile errors for non-const variables of thingsAndrew Kelley
closes #456
2017-09-05rename parseh to parsecAndrew Kelley
2017-09-05fix void return node and param name nodes, fix dupe macrosAndrew Kelley
all tests passing
2017-09-01c-to-zig: return statementAndrew Kelley
2017-08-30align syntax: align(4) instead of align 4Andrew Kelley
closes #37