Commit Graph

55376 Commits

Author SHA1 Message Date
Mattias Gaertner
75bf1e4291 fcl-passrc: resolver: added GetSelfScope
git-svn-id: trunk@41234 -
2019-02-06 10:15:31 +00:00
nickysn
c728a1204a + added additional notes in the comments for HeapSort
git-svn-id: trunk@41233 -
2019-02-05 18:25:27 +00:00
nickysn
f32748a8e7 + added comment with information about QuickSort and its specific implementation in unit SortBase
git-svn-id: trunk@41232 -
2019-02-05 18:02:48 +00:00
nickysn
eca60a0a89 * partition elements equal to the pivot on both sides of the pivot, since that
leads to much better performance when sorting lots of repeating elements

git-svn-id: trunk@41231 -
2019-02-05 17:32:28 +00:00
nickysn
bea9961d2d * use SizeUInt instead of longint for the array indices in the quicksort
implementations. This:
  1) allows sorting arrays with >4G elements on 64-bit systems
  2) allows sorting arrays with up to 4G (>2G) elements on 32-bit systems
  3) uses 16-bit instead of the less efficient 32-bit indices on 16-bit and
     8-bit platforms

git-svn-id: trunk@41230 -
2019-02-05 16:20:56 +00:00
nickysn
f5f25f7ae6 * use a more robust QuickSort implementation, that is guaranteed to never loop
forever and never access index out of bounds elements from the array when
  being passed an incorrect comparison function. The resulting sort order is
  still undefined in this case, though.

git-svn-id: trunk@41229 -
2019-02-05 16:00:42 +00:00
nickysn
de80621e1e * use a try..finally block to protect against memory leaks if the comparison
callback function raises an exception in QuickSort_ItemList_Context

git-svn-id: trunk@41228 -
2019-02-05 12:14:09 +00:00
joost
e5492d8992 * Fixed version-number without build-number, bug #29055
git-svn-id: trunk@41226 -
2019-02-04 21:36:36 +00:00
Mattias Gaertner
9a878f99db fcl-passrc: fixed parsing (expr).name()
git-svn-id: trunk@41225 -
2019-02-04 16:49:07 +00:00
Mattias Gaertner
bf1af93938 pastojs: typecast string(unicodestring), unicodestring(string)
git-svn-id: trunk@41224 -
2019-02-04 16:02:42 +00:00
Mattias Gaertner
cfe65c8cd8 fcl-passrc: resolver: typecast string(unicodestring), unicodestring(string)
git-svn-id: trunk@41223 -
2019-02-04 16:02:28 +00:00
nickysn
26486bbaea + keep track of the pivot index in all quicksort implementations. No functional changes,
but will be used to prevent overlap in the divided subregions and also infinite loops
  in case of an incorrect compare function.

git-svn-id: trunk@41222 -
2019-02-04 15:32:41 +00:00
Mattias Gaertner
b47c58dddc fcl-passrc: fixed case of widechar
git-svn-id: trunk@41221 -
2019-02-04 15:08:50 +00:00
pierre
15fc7b3510 Programs can also have import libraries
git-svn-id: trunk@41220 -
2019-02-04 15:02:42 +00:00
nickysn
ec45f0069a + added unit SortAlgs to rtl-extra. It implements extra sorting algorithms
that can be used in place of the default QuickSort implementation from unit
  SortBase. Currently, only HeapSort is implemented, but others will be added
  in the future.

git-svn-id: trunk@41219 -
2019-02-04 14:34:13 +00:00
Mattias Gaertner
57ece7b0f5 fcl-passrc: fixed set literal of widechar, issue #35001
git-svn-id: trunk@41218 -
2019-02-04 12:34:25 +00:00
Jonas Maebe
13ce27cc1d * fixed the default external assembler for llvm when using -s
git-svn-id: trunk@41207 -
2019-02-03 21:01:13 +00:00
Jonas Maebe
1abea6451c * fixed thlcgobj.g_rangecheck() for cpuhighleveltarget when targetting a
cpu32bitalu

git-svn-id: trunk@41206 -
2019-02-03 21:01:08 +00:00
Jonas Maebe
7af95cbf06 * LLVM does not support 128 bits arithmetic on 32 bit platforms, which we
need for overflow checking -> use RTL built-ins

git-svn-id: trunk@41205 -
2019-02-03 21:01:02 +00:00
Jonas Maebe
353be907c7 * update the stack alignment field of parameters when doing so for paralocs
git-svn-id: trunk@41204 -
2019-02-03 21:00:57 +00:00
Jonas Maebe
7a65e1f393 * fixed ARM paraloc defs (for LLVM)
git-svn-id: trunk@41203 -
2019-02-03 21:00:51 +00:00
Jonas Maebe
da0deae9ae * removed unnecessary replacements of the paraloc def with arraydefs on ARM
git-svn-id: trunk@41202 -
2019-02-03 21:00:46 +00:00
Jonas Maebe
8c362eac67 * always emit UAL when using LLVM (clang does not and will not support
pre-UAL)

git-svn-id: trunk@41201 -
2019-02-03 21:00:41 +00:00
Jonas Maebe
ab51e8637c * set default Mac OS X target version to 10.6 for LLVM (earlier versions did
not include libunwind in libSystem, causing linking errors when compiling
    on later versions)

git-svn-id: trunk@41200 -
2019-02-03 21:00:36 +00:00
Jonas Maebe
f9668f8c03 * let de LLVM parameter manager merge multiple paralocs used to represent a
single ordinal, as such splitting is handled by LLVM itself (and handling
    such split locations is currently not supported by our LLVM code generator)

git-svn-id: trunk@41199 -
2019-02-03 21:00:28 +00:00
Jonas Maebe
503ea604f3 + nolinline modifier to specify that a routine must never be inlined
git-svn-id: trunk@41198 -
2019-02-03 21:00:17 +00:00
joost
5341f6fc7a * Fixed the user-repository path on Windows
git-svn-id: trunk@41197 -
2019-02-03 20:08:21 +00:00
nickysn
1d7ff66602 + added .Sort() overloads with a SortingAlgorithm parameter to TFPGList,
TFPGObjectList, TFPGInterfacedObjectList and TFPSMap

git-svn-id: trunk@41196 -
2019-02-03 19:49:35 +00:00
nickysn
5c4af27a7a + added test for the sortbase unit
git-svn-id: trunk@41195 -
2019-02-03 19:16:48 +00:00
nickysn
d86da19570 * use the sort algorithm from sortbase for TStringList
git-svn-id: trunk@41194 -
2019-02-03 17:00:21 +00:00
Mattias Gaertner
d9954e410e pastojs: fixed case char of widechar_literal, issue #34993
git-svn-id: trunk@41192 -
2019-02-03 16:49:00 +00:00
nickysn
ea340b9481 * fixed bug in QuickSort_ItemList_CustomItemExchanger_Context and
QuickSort_ItemList_Context and which can cause wrong sort results, due to not
  taking into account that the pivot can be moved by the swap operation

git-svn-id: trunk@41191 -
2019-02-03 16:34:05 +00:00
Mattias Gaertner
79b82acfcc pas2js: docs lo|hi
git-svn-id: trunk@41190 -
2019-02-03 16:31:26 +00:00
Mattias Gaertner
c2671bdbb6 pastojs: helpers: access helper fields from method
git-svn-id: trunk@41189 -
2019-02-03 16:29:24 +00:00
Mattias Gaertner
07d6c5b688 fcl-passrc: resolver: check record/type helper static
git-svn-id: trunk@41188 -
2019-02-03 16:28:25 +00:00
marco
91fd2396fc * patch from mantis 34851 committed. use size in bits to set result of openbit instead of a fsize*32.
git-svn-id: trunk@41185 -
2019-02-03 14:06:40 +00:00
joost
6ffe906794 * Mover {CompilerVersion} from the fppkg.cfg template to samplecfg, because
on Windows it is possible to install fpc in a location without the 
   compilerversion in the path.

git-svn-id: trunk@41184 -
2019-02-03 13:32:43 +00:00
Károly Balogh
cb5a1ed727 build/install fixes for the new sortbase unit for amiga, atari, aros and morphos
git-svn-id: trunk@41183 -
2019-02-03 02:06:32 +00:00
nickysn
c7d8bd9666 + added a sort algorithm interface that accepts a custom callback function for
exchanging two elements. This is required for TStringList.Sort (and is the
  most generic form for a sort algorithm interface that I can think of).

git-svn-id: trunk@41182 -
2019-02-03 00:33:43 +00:00
nickysn
2a0eb54fd5 + added a simple test that tests TList.Sort
git-svn-id: trunk@41181 -
2019-02-02 23:56:24 +00:00
nickysn
178217821c + added sortbase as a dependency to unit fgl in the makefiles
git-svn-id: trunk@41180 -
2019-02-02 23:22:09 +00:00
nickysn
ad677070f4 * hook TFPSList.QuickSort to also call the default sorting algorithm from sortbase
git-svn-id: trunk@41179 -
2019-02-02 23:08:25 +00:00
nickysn
59a75ea429 * use Inc() and Dec() instead of v:=v+1
git-svn-id: trunk@41178 -
2019-02-02 22:58:52 +00:00
nickysn
63f9afa6bd * fixed TFPList.Sort. Scary news: turns out we don't have any tests for
TFPList.Sort or TList.Sort... :(

git-svn-id: trunk@41177 -
2019-02-02 22:52:08 +00:00
nickysn
4ea42ab6d2 * use the sortbase sorting algorithm in fgl as well
git-svn-id: trunk@41176 -
2019-02-02 22:49:39 +00:00
nickysn
4082b8c7fc + added and implemented QuickSort_ItemList_Context
git-svn-id: trunk@41175 -
2019-02-02 21:21:07 +00:00
nickysn
7f44f2535e * the Compare parameter renamed Comparer for consistency
git-svn-id: trunk@41174 -
2019-02-02 21:08:30 +00:00
nickysn
8cf5779297 * the first parameter of QuickSort_PtrList_NoContext renamed ItemPtrs for
consistency with the other similar procedures

git-svn-id: trunk@41173 -
2019-02-02 21:07:27 +00:00
nickysn
a2a0ed53b2 * the type of the ItemCount parameter changed from PtrUInt to SizeUInt
git-svn-id: trunk@41172 -
2019-02-02 21:05:02 +00:00
nickysn
848890e54b + added the TItemListSorter_NoContext and TItemListSorter_Context procedure
types to sortbase. No implementation for them yet. They will allow sorting
  an array with elements of arbitrary size (e.g. array of records).

git-svn-id: trunk@41171 -
2019-02-02 21:03:10 +00:00