aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
AgeCommit message (Collapse)Author
2017-11-24rename "parsec" to "translate-c"Andrew Kelley
2017-11-16fix codegen for union init with runtime valueAndrew Kelley
see #144
2017-11-16debug safety for unionsAndrew 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-10fix bug when multiple function definitions existAndrew Kelley
This might be related to #529
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-04add compile-time reflection for function arg typesAndrew Kelley
See #383
2017-11-03Add emit command-line option (#580)Marc Tiehuis
Add emit command-line option
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-27Merge branch 'master' into self-hostedAndrew Kelley
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-25cleaner verbose flags and zig build prints failed commandAndrew Kelley
2017-10-24fix missing compiler_rt in release modesAndrew Kelley
the optimizer was deleting compiler_rt symbols, so I changed the linkage type from LinkOnce to Weak also changed LinkOnce to mean linkonce_odr in llvm and Weak to mean weak_odr in llvm. See #563
2017-10-24wip self hosted codeAndrew Kelley
2017-10-21fix compiler crash regarding type name of undefinedAndrew Kelley
See #547
2017-10-17add uwtable attribute to functions on windowsAndrew Kelley
See #516 now we have at least a callstack. we still need updated LLD to get stack traces.
2017-10-16fix codegen of enum name table having wrong LLVM typesAndrew Kelley
See https://bugs.llvm.org/show_bug.cgi?id=34952
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-15clean up some resourcesAndrew Kelley
2017-10-15fix windows argument parsingAndrew Kelley
2017-10-15disable byval parameters on windows to work around llvm bugAndrew Kelley
See #536
2017-10-14build-exe allows direct export of WinMainCRTStartupAndrew Kelley
2017-10-10add module flag to emit CodeView for COFF object filesAndrew Kelley
see #516
2017-10-03use __chkstk_ms compiler-rt functions for __chkstkAndrew Kelley
I had to revert the target native features thing because there is still some incorrect behavior with f128. Reopens #508 partially reverts b5054625093ef22b3f228199b6fbf70e1c50b703 See #302
2017-10-03replace __chkstk function with a stub that does not crashAndrew Kelley
Closes #508 See #302
2017-10-03add @setAlignStack builtinAndrew Kelley
2017-10-02windows: alignstack=16 on every functionAndrew Kelley
See #302
2017-10-01implement standard library path searchAndrew Kelley
closes #463 See #302
2017-10-01fix implementation of --zig-std-dirAndrew Kelley
see #463
2017-10-01fix codegen on windowsAndrew Kelley
2017-09-30remove zigrtAndrew Kelley
adds test case for #394 partially reverts a32b5929ccf8cbf79396d8924097a1a911985dac
2017-09-30don't try to use cold calling convention on windowsAndrew Kelley
it just causes a segfault
2017-09-30better divTrunc codegenAndrew Kelley
branch and phi instead of select instruction fixes division test for windows. See #302
2017-09-30workaround for invalid binary created on windowsAndrew Kelley
when target native features are used. See #508
2017-09-24fix i386 windows stdcallAndrew Kelley
2017-09-24windows gui hello worldAndrew Kelley
2017-09-20Merge branch 'master' into c-to-zigAndrew Kelley
2017-09-17add -mllvm supportAndrew Kelley
useful for debugging crashes in llvm optimizer
2017-09-13fix up msvc stuff to make it work on linux and macos tooAndrew Kelley
2017-09-12fix error messagesAndrew Kelley
2017-09-11Add support for MSVCJonathan Marler
2017-09-05rename parseh to parsecAndrew Kelley
2017-09-05add OpaqueType builtinAndrew Kelley
closes #326
2017-08-31Opaque ptr patchRaul Leal