aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
AgeCommit message (Collapse)Author
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
2017-08-30generic functions can access comptime args in align valueAndrew Kelley
See #37
2017-08-29more alignment improvementsAndrew Kelley
* add alignment capability for fn protos * add @alignCast * fix some ast rendering code * fix some ir rendering code * add error for pointer cast increasing alignment * update allocators in std to correctly align See #37
2017-08-29ptrCast gives compile error for increasing alignmentAndrew Kelley
See #37
2017-08-29prevent implicitly increasing pointer alignmentAndrew Kelley
See #37
2017-08-29pass all tests without triggering assertionsAndrew Kelley
fixes tests when targeting darwin
2017-08-29introduce align keywordAndrew Kelley
* remove `@setGlobalAlign` * add align keyword for setting alignment on functions and variables. * loads and stores use alignment from pointer * memcpy, memset use alignment from pointer * add syntax for pointer alignment * slices can have volatile * add u2, i2 primitives * ignore preferred align and use abi align everywhere * back to only having alignOf builtin. preferredAlignOf is too tricky to be useful. See #432. Partial revert of e726925e802eddab53cbfd9aacbc5eefe95c356f. See #37
2017-08-28Merge branch 'embed-lld'Andrew Kelley
Zig now depends on LLVM 5.0.0. For the latest version that supports LLVM 4.0.1, use 2a49c876be76dc98996a3251310728ad32b22363. Unfortunately we had to embed LLD into Zig due to some MACH-O related LLD bugs. One of them is already upstream and another is awaiting feedback on the llvm-dev mailing list. You can use cmake option -DZIG_FORCE_EXTERNAL_LLD=ON to still use external LLD if you want to live with the MACH-O bugs or if your system LLD is patched. Closes #273
2017-08-27macos passing all tests except for building a shared libraryAndrew Kelley
see #273
2017-08-27progress toward tests passing on MacOSAndrew Kelley
2017-08-26codegen for enums chooses best order of tag and union fieldsAndrew Kelley
closes #396
2017-08-26fixups from previous commitAndrew Kelley
See #396
2017-08-26use most_aligned_member+padding to represent enum unionsscurest
2017-08-20fix not propagating parseh aliases through pub use declsAndrew Kelley
2017-08-20compile-time f32, f64 operations are now correctly lossyAndrew Kelley
previously we used the bigfloat abstraction to do all compile-time float math. but runtime code and comptime code are supposed to get the same result. so now if you add a f32 to a f32 at compile time it does it with f32 math instead of the bigfloat. float literals still get the bigfloat math. closes #424
2017-08-19add compile error for globally shadowing a primitive typeAndrew Kelley
closes #423
2017-08-19bit shifting safetyAndrew Kelley
* add u3, u4, u5, u6, u7 and i3, i4, i5, i6, i7 * shift operations shift amount parameter type is integer with log2 bit width of other param - This enforces not violating undefined behavior on shift amount >= bit width with the type system * clean up math.log, math.ln, math.log2, math.log10 closes #403
2017-08-17fix wrong value for clz, ctz at compile timeAndrew Kelley
closes #418 also make clz, ctz return smaller integer bit widths and use smaller integer bit widths for enum tag types
2017-08-16compiler_rt implementations for __fixuns* functionsAndrew Kelley
* add u128 and i128 integer types * add f128 floating point type * implement big integer multiplication (See #405)
2017-08-06fix constant debug info when number literal is 0Andrew Kelley
2017-08-05fix initializing undefined and crash when casting to invalid typeAndrew Kelley
closes #408
2017-07-08better bigint/bigfloat implementationAndrew Kelley