aboutsummaryrefslogtreecommitdiff
path: root/src/zig_llvm.cpp
AgeCommit message (Collapse)Author
2018-11-05update to build against llvm trunkAndrew Kelley
2018-10-09support building static librariesAndrew Kelley
closes #1493 closes #54
2018-09-30fixed native target detectionemekoi
2018-09-24Ignore class-memaccess error for gcc 8 and aboveWink Saville
On Arch Linux the current default compiler is gcc 8.2.1 and this change is needed to ignore the following errors: In file included from /home/wink/local/include/llvm/ADT/STLExtras.h:21, from /home/wink/local/include/llvm/ADT/StringRef.h:13, from /home/wink/local/include/llvm/ADT/StringMap.h:17, from /home/wink/local/include/llvm/Support/Host.h:17, from /home/wink/local/include/llvm/ADT/Hashing.h:49, from /home/wink/local/include/llvm/ADT/ArrayRef.h:13, from /home/wink/local/include/llvm/ADT/APFloat.h:21, from /home/wink/local/include/clang/AST/APValue.h:18, from /home/wink/local/include/clang/AST/Decl.h:17, from /home/wink/local/include/clang/AST/ASTTypeTraits.h:20, from /home/wink/local/include/clang/AST/ASTContext.h:18, from /home/wink/local/include/clang/Frontend/ASTUnit.h:18, from /home/wink/prgs/ziglang/zig/src/translate_c.cpp:18: /home/wink/local/include/llvm/ADT/SmallVector.h: In instantiation of ‘void llvm::SmallVectorTemplateBase<T, true>::push_back(const T&) [with T = std::pair<void*, long unsigned int>]’: /home/wink/local/include/llvm/Support/Allocator.h:249:33: required from ‘void* llvm::BumpPtrAllocatorImpl<AllocatorT, SlabSize, SizeThreshold>::Allocate(size_t, size_t) [with AllocatorT = llvm::MallocAllocator; long unsigned int SlabSize = 4096; long unsigned int SizeThreshold = 4096; size_t = long unsigned int]’ /home/wink/local/include/clang/AST/ASTContext.h:659:42: required from here /home/wink/local/include/llvm/ADT/SmallVector.h:313:11: error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct std::pair<void*, long unsigned int>’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess] memcpy(this->end(), &Elt, sizeof(T)); ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/8.2.1/utility:70, from /home/wink/local/include/llvm/Support/type_traits.h:19, from /home/wink/local/include/llvm/Support/Casting.h:19, from /home/wink/local/include/clang/Basic/LLVM.h:22, from /home/wink/local/include/clang/AST/APValue.h:17, from /home/wink/local/include/clang/AST/Decl.h:17, from /home/wink/local/include/clang/AST/ASTTypeTraits.h:20, from /home/wink/local/include/clang/AST/ASTContext.h:18, from /home/wink/local/include/clang/Frontend/ASTUnit.h:18, from /home/wink/prgs/ziglang/zig/src/translate_c.cpp:18: /usr/include/c++/8.2.1/bits/stl_pair.h:198:12: note: ‘struct std::pair<void*, long unsigned int>’ declared here struct pair ^~~~
2018-09-16Merge remote-tracking branch 'origin/master' into llvm7Andrew Kelley
2018-09-11rename --enable-timing-info to -ftime-report to match clangAndrew Kelley
and have it print llvm's internal timing info
2018-07-24Merge remote-tracking branch 'origin/master' into llvm7Andrew Kelley
2018-07-16self-hosted: create tmp dir for .o files and emit .o file for fnAndrew Kelley
2018-07-03update for latest llvmAndrew Kelley
2018-06-14llvm7: find external liblldWasm and update for newest lld macho APIAndrew Kelley
2018-06-14Merge remote-tracking branch 'origin/master' into llvm7Andrew Kelley
2018-06-09support `--target-arch wasm32` (#1094)Ben Noordhuis
Add wasm32 support to the build-obj, build-exe and build-lib commands of the stage 1 compiler. Wasm64 should work transparently once it's supported in upstream LLVM. To export a function: // lib.zig - for exposition, not necessary for this example pub use @import("add.zig"); // add.zig export fn add(a: i32, b: i32) i32 { return a + b; } To import a function: // cube.zig extern fn square(x: i32) i32; export fn cube(x: i32) i32 { return x * square(x); }
2018-05-26update to latest LLVM APIAndrew Kelley
2018-04-26Merge remote-tracking branch 'origin/master' into llvm7Andrew Kelley
2018-04-18improve cmpxchgAndrew Kelley
* remove @cmpxchg, add @cmpxchgWeak and @cmpxchgStrong - See explanations in the langref. * add operand type as first parameter * return type is ?T where T is the operand type closes #461
2018-04-16Set SizeLevel to 2 in ReleaseSmall modeAlexandros Naskos
2018-04-16Added ReleaseSmall modeAlexandros Naskos
2018-04-04update to latest llvm APIAndrew Kelley
2018-03-22use the llvm API for creating memcpy and memset instructionsAndrew Kelley
2018-03-01Merge remote-tracking branch 'origin/master' into llvm6Andrew Kelley
2018-02-25add coroutine LLVM passesAndrew Kelley
2018-02-25codegen for coro_id instructionAndrew Kelley
See #727
2018-02-13Merge remote-tracking branch 'origin/master' into llvm6Andrew Kelley
2018-02-13zig_llvm.cpp uses new(std::nothrow)Andrew Kelley
This fixes a mismatched malloc/delete because we were allocating with malloc and then llvm was freeing with delete.
2018-02-11Merge remote-tracking branch 'origin/master' into llvm6Andrew Kelley
2018-01-31*WIP* error setsAndrew Kelley
2018-01-06Merge branch 'master' into llvm6Andrew Kelley
2018-01-06disable NewGVNAndrew Kelley
closes #673
2017-12-26Merge branch 'master' into llvm6Andrew Kelley
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-23Merge remote-tracking branch 'origin/master' into llvm6Andrew 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-04Merge branch 'master' into llvm6Andrew Kelley
2017-12-01update to LLVM 5.0.1rc2Andrew Kelley
2017-11-29update fast math llvm API to latestAndrew Kelley
2017-11-29Merge remote-tracking branch 'origin/master' into llvm6Andrew Kelley
2017-11-15basic union supportAndrew Kelley
See #144
2017-11-06Merge remote-tracking branch 'origin/master' into llvm6Andrew Kelley
2017-11-03Add emit command-line option (#580)Marc Tiehuis
Add emit command-line option
2017-11-02update to llvm masterAndrew Kelley
2017-10-23remove CXX ABI workaroundAndrew Kelley
the actual solution is you must compile zig with the same compiler that compiled llvm, lld, and clang. reverts 8d60ffe314306e5295fb76338c6391e5fe986dea
2017-10-15clean up some resourcesAndrew Kelley
2017-10-10add module flag to emit CodeView for COFF object filesAndrew Kelley
see #516
2017-09-17add -mllvm supportAndrew Kelley
useful for debugging crashes in llvm optimizer
2017-09-01cleanup whitespaceJosh Wolfe
2017-08-30codegen: all stores specify align valueAndrew Kelley
See #37
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-26update for llvm 5.0.0rc1Andrew Kelley
2017-08-09more intuitive left shift and right shift operatorsAndrew Kelley
Before: * << is left shift, not allowed to shift 1 bits out * <<% is left shift, allowed to shift 1 bits out * >> is right shift, allowed to shift 1 bits out After: * << is left shift, allowed to shift 1 bits out * >> is right shift, allowed to shift 1 bits out * @shlExact is left shift, not allowed to shift 1 bits out * @shrExact is right shift, not allowed to shift 1 bits out Closes #413
2017-06-14progress toward windows hello world workingAndrew Kelley