summary refs log tree commit diff stats
path: root/compiler/semfold.nim
Commit message (Collapse)AuthorAgeFilesLines
* https://reproducible-builds.org/ support via SOURCE_DATE_EPOCH (#7644) (#7661)tersec2018-04-201-2/+17
|
* introduce nkTupleConstr AST node for unary tuple construction; breaking changeAndreas Rumpf2018-04-131-3/+3
|
* fixes #3985Araq2018-02-101-1/+6
|
* Fixes codegen bug with literal negative zero, fixes #7079 (#7158)GULPF2018-01-311-0/+1
| | | | | | * Fixes #7079 * Fix handling of neg zero during constant folding
* fixes #6989Andreas Rumpf2018-01-271-1/+6
|
* preparations for language extensions: 'sink' and 'lent' typesAndreas Rumpf2018-01-071-1/+1
|
* first steps in adding template/macro calls to stack tracesAraq2017-12-211-0/+3
|
* fixes the second example of #6757Andreas Rumpf2017-11-171-7/+7
|
* Merge branch 'devel' into araqAndreas Rumpf2017-10-021-2/+4
|\
| * first implementation of the 'func' keywordAndreas Rumpf2017-09-231-2/+2
| |
| * NimScript: added buildOS and buildCPU constantsAndreas Rumpf2017-09-221-0/+2
| |
* | no interval arithmetic anymore to construct implicit range types; breaking ↵Andreas Rumpf2017-07-131-130/+0
|/ | | | change
* fix #1082Zahary Karadjov2017-06-201-2/+4
|
* introduce a pre-processing pass for the concept bodiesZahary Karadjov2017-06-201-2/+5
| | | | | | | fixes #4982 fixes #3805 close #3414
* removed compiler internal list implementation (#5371)Arne Döring2017-02-221-1/+1
|
* fixes #5399Araq2017-02-161-1/+1
|
* make more tests greenAraq2017-02-161-1/+4
|
* fixes #5216Araq2017-01-271-5/+5
|
* fixes #3434Andreas Rumpf2017-01-191-1/+1
|
* Merge branch 'devel' into sighashesAraq2016-12-191-1/+1
|\
| * fixes nimsuggest issue #40Araq2016-12-181-1/+1
| |
* | removed tyArrayConstr completely from the compiler; introduced tyAlias ↵Araq2016-11-141-1/+2
|/ | | | instead in preparation for further bugfixes
* fixes a compiler crash; refs #4699Andreas Rumpf2016-09-031-1/+2
|
* remove unused stuffJacek Sieka2016-08-091-26/+0
|
* remove sfFakeConstJacek Sieka2016-07-301-1/+1
|
* stdlib and compiler don't use .immediate anymoreAndreas Rumpf2016-07-291-2/+2
|
* get rid of deprecated toLower/toUpperAndreas Rumpf2016-07-191-2/+2
|
* fixes #3545Andreas Rumpf2016-07-151-6/+7
|
* Add the ability to pass a value with the -d flagJeff Ciesielski2016-07-041-0/+6
| | | | | | | This allows the end user to use the {.magic: "IntDefine"/"StrDefine"} pragmas to pass values into code at compile time. This has a nice side effect of also allowing/requiring a default value to be assigned in the code (see osalloc.nim/StandaloneHeapSize for an example)
* Modification to implementation of round() such that it returns a float and ↵A. S. Budden2016-05-311-1/+1
| | | | | | accepts a places argument (fixes #3473). This also involved moving some functions around to get the hierarchy correct and the documentation for frexp was modified such that it was clear that it can return a float in either the range [-1, -0.5] or [0.5, 1].
* fixes #4040Andreas Rumpf2016-05-111-1/+8
|
* fixes #2599Araq2015-09-131-8/+1
|
* fixes #3230Araq2015-09-091-1/+1
|
* Fixed nimvm in generics.Yuriy Glukhov2015-09-071-2/+0
|
* nimvm is magicYuriy Glukhov2015-09-041-0/+2
|
* fixes #3140Araq2015-08-031-8/+8
|
* fixes #3099Araq2015-07-211-1/+1
|
* fixes #1463Araq2015-07-011-1/+1
|
* fixes #2985Araq2015-06-251-0/+3
|
* Removed magics: mAbsI64rku2015-06-101-2/+2
|
* Removed magics: mBitnotI64rku2015-06-101-1/+1
|
* Removed magics: mEqI64 mLtI64 mLeI64rku2015-06-101-3/+3
|
* Removed magics: mShrI64, mShlI64, mBitandI64, mBitorI64, mBitxorI64rku2015-06-101-8/+8
| | | | Author: rku <rokups@zoho.com>
* Removed magics: mAddI64, mSubI64, mMulI64, mDivI64, mModI64rku2015-06-101-10/+10
| | | | Author: rku <rokups@zoho.com>
* fixes #2629, fixes #2641, fixes #2632, fixes #2630Araq2015-05-031-1/+1
|
* minor bugfixes to the new 'len(nil)==0' featureAraq2015-05-031-2/+5
|
* compiler\ccgexprs.nimAraq2015-05-031-1/+1
| | | | fixes 'nil' literal echoing
* fixes #2470, fixes #1354Araq2015-04-281-2/+3
|
* fixes #2589Araq2015-04-231-1/+1
|
* added '..^' and '..<' operators; 'nil' is allowed for 'len'; added plugin ↵Araq2015-04-221-2/+3
| | | | system to the compiler
an>0x00); // e_version O(0x01); O(0x00); O(0x00); O(0x00); // e_entry uint32_t e_entry = find(p, "code")->start; // Override e_entry emit(e_entry); // e_phoff -- immediately after ELF header uint32_t e_phoff = 0x34; emit(e_phoff); // e_shoff; unused uint32_t dummy32 = 0; emit(dummy32); // e_flags; unused emit(dummy32); // e_ehsize uint16_t e_ehsize = 0x34; emit(e_ehsize); // e_phentsize uint16_t e_phentsize = 0x20; emit(e_phentsize); // e_phnum uint16_t e_phnum = SIZE(p.segments); emit(e_phnum); // e_shentsize uint16_t dummy16 = 0x0; emit(dummy16); // e_shnum emit(dummy16); // e_shstrndx emit(dummy16); uint32_t p_offset = /*size of ehdr*/0x34 + SIZE(p.segments)*0x20/*size of each phdr*/; for (int i = 0; i < SIZE(p.segments); ++i) { const segment& curr = p.segments.at(i); //// phdr // p_type uint32_t p_type = 0x1; emit(p_type); // p_offset emit(p_offset); // p_vaddr uint32_t p_start = curr.start; emit(p_start); // p_paddr emit(p_start); // p_filesz uint32_t size = num_words(curr); assert(p_offset + size < SEGMENT_ALIGNMENT); emit(size); // p_memsz emit(size); // p_flags uint32_t p_flags = (curr.name == "code") ? /*r-x*/0x5 : /*rw-*/0x6; emit(p_flags); // p_align // "As the system creates or augments a process image, it logically copies // a file's segment to a virtual memory segment. When—and if— the system // physically reads the file depends on the program's execution behavior, // system load, and so on. A process does not require a physical page // unless it references the logical page during execution, and processes // commonly leave many pages unreferenced. Therefore delaying physical // reads frequently obviates them, improving system performance. To obtain // this efficiency in practice, executable and shared object files must // have segment images whose file offsets and virtual addresses are // congruent, modulo the page size." -- http://refspecs.linuxbase.org/elf/elf.pdf (page 95) uint32_t p_align = 0x1000; // default page size on linux emit(p_align); if (p_offset % p_align != p_start % p_align) { raise << "segment starting at 0x" << HEXWORD << p_start << " is improperly aligned; alignment for p_offset " << p_offset << " should be " << (p_offset % p_align) << " but is " << (p_start % p_align) << '\n' << end(); return; } // prepare for next segment p_offset += size; } #undef O #undef emit } void write_segment(const segment& s, ostream& out) { for (int i = 0; i < SIZE(s.lines); ++i) { const vector<word>& w = s.lines.at(i).words; for (int j = 0; j < SIZE(w); ++j) { uint8_t x = hex_byte(w.at(j).data); // we're done with metadata by this point out.write(reinterpret_cast<const char*>(&x), /*sizeof(byte)*/1); } } } uint32_t num_words(const segment& s) { uint32_t sum = 0; for (int i = 0; i < SIZE(s.lines); ++i) sum += SIZE(s.lines.at(i).words); return sum; } :(before "End Includes") using std::ios;