Commit Graph

4049 Commits

Author SHA1 Message Date
Dmitri Gribenko
79a6f33213 Merge pull request #1868 from danra/patch-32-fix
operator!= DRY
2016-03-25 22:36:23 -07:00
Jordan Rose
90f91a4219 Merge pull request #1842 from danra/patch-37
Fix includes order - system should follow local
2016-03-25 16:47:12 -07:00
Michael Ilseman
b01caa01c6 Merge remote-tracking branch 'origin/master' into import-as-member 2016-03-25 15:47:47 -07:00
Dan Raviv
703cd37067 Add missing periods in comments (NFC) 2016-03-25 14:14:19 -07:00
danra
17dc943081 Fix includes order 2016-03-25 14:14:19 -07:00
Dan Raviv
8b2028d630 Add missing word in DiverseListImpl comment 2016-03-25 14:14:19 -07:00
John McCall
0afd09eaf3 Only use metadata patterns for generic types; perform other
initialization in-place on demand.  Initialize parent metadata
references correctly on struct and enum metadata.

Also includes several minor improvements related to relative
pointers that I was using before deciding to simply switch the
parent reference to an absolute reference to get better access
patterns.

Includes a fix since the earlier commit to make enum metadata
writable if they have an unfilled payload size.  This didn't show
up on Darwin because "constant" is currently unenforced there in
global data containing relocations.

This patch requires an associated LLDB change which is being
submitted in parallel.
2016-03-25 14:14:19 -07:00
danra
f2a339386c Use auto instead of repeating explicit class names 2016-03-25 14:14:19 -07:00
danra
4e11ce58c5 Use auto instead of repeating explicit class names 2016-03-25 14:14:19 -07:00
danra
c76cd68811 operator!= DRY 2016-03-25 14:14:19 -07:00
danra
bb3631dbd0 Remove redundant else 2016-03-25 14:14:19 -07:00
danra
d1250857fd Add missing period in comment 2016-03-25 14:14:19 -07:00
danra
5a1da59741 Compact getEnd implementation 2016-03-25 14:14:19 -07:00
danra
ed31834229 isInvalid methods DRY 2016-03-25 14:14:19 -07:00
danra
d8cb0b664a Remove extra spaces in empty-body ctors
Currently some empty-body ctors in the file have a space, some don't. Canonized it.
2016-03-25 14:14:19 -07:00
danra
f77393c06b operator!= DRY 2016-03-25 14:14:19 -07:00
danra
6f195f025a move copy-append before move-append overload
This is consistent with the usual convention of having copy methods before move methods (which is also used in this file in previous methods).
2016-03-25 14:14:19 -07:00
danra
2272897c5d Improve template typenames consistency
Rename BlotMapVector's template typenames: MapTy -> MapT and VectorTy -> VectorT. This is consistent both with BlotMapVector's other template typename KeyT and ValueT, and with SmallBlotMapVector's MapT and VectorT template typenames.
2016-03-25 14:14:19 -07:00
Dan Raviv
89545329b5 Consistently name stacks as 'stack' instead of 'queue'
Currently some stacks are named 'stack' and some are named 'queue' with a comment saying 'actually a stack'. Just call these a 'stack' as well.
2016-03-25 21:26:45 +03:00
Dan Raviv
3948212413 Refactor DemanglePrinter to eliminate the possibility of storing a dangling reference.
Before the refactor, a dangling reference to a string may be stored in a DemanglePrinter in at least the following cases:
1) If an lvalue DemanglePrinter is initialized with an rvalue string:
DemanglePrinter printer("abc");
2) If an lvalue DemanglePrinter is initialized with an lvalue string which doesn't live as long as the printer:
unique_ptr<DemanglePrinter> printer;
{
  std::string s = "abc";
  printer = make_unique<DemanglePrinter>(s);
}
// Reference stored in printer is dangling

In addition, in all existing cases in the code where an lvalue DemanglePrinter is used, an empty string is initialized just before it, which isn't DRY, and is related to the previous problem - the coder shouldn't be expected to maintain the lifetime of a string separate from the DemanglePrinter which references it.

In addition, before the refactor, in any in-line use of DemanglePrinter it is constructed with an empty string parameter (in which to construct the string), but this doesn't look very clean.

The refactor solves the above issues by maintaining its own string as a member, while still enabling the original intent of being able to use DemanglePrinter both as an lvalue constructively before getting its value, and in-line as an rvalue.
2016-03-25 16:11:53 +03:00
Dan Raviv
28491f3f03 Add missing periods in comments (NFC) 2016-03-25 12:02:13 +03:00
Dan Raviv
3a46559c1b operator!= DRY 2016-03-25 11:55:49 +03:00
Dmitri Gribenko
e9ab667e3a Merge pull request #1811 from danra/patch-21
move copy-append before move-append overload (NFC)
2016-03-25 00:51:27 -07:00
Dmitri Gribenko
70e4354868 Merge pull request #1787 from danra/patch-13
Improve template typenames consistency
2016-03-25 00:51:06 -07:00
Dmitri Gribenko
47fe51ddd0 Merge pull request #1836 from danra/patch-31
operator!= DRY
2016-03-25 00:48:54 -07:00
Chris Lattner
833f73a00b Merge pull request #1838 from danra/patch-33
Remove extra spaces in empty-body ctors
2016-03-24 22:52:59 -07:00
Chris Lattner
e0c9c1a163 Merge pull request #1840 from danra/patch-35
Compact getEnd implementation
2016-03-24 22:52:22 -07:00
Chris Lattner
d968c4dbf6 Merge pull request #1841 from danra/patch-36
Add missing period in comment
2016-03-24 22:50:49 -07:00
Chris Lattner
96dea07bdd Merge pull request #1848 from danra/patch-42
Use auto instead of repeating explicit class names
2016-03-24 22:38:54 -07:00
Chris Lattner
a4a0118e38 Merge pull request #1855 from danra/patch-43
Use auto instead of repeating explicit class names
2016-03-24 22:37:40 -07:00
Chris Lattner
2753606c3e Merge pull request #1843 from danra/patch-38
Remove redundant else
2016-03-24 22:37:26 -07:00
Chris Lattner
4d64953776 Merge pull request #1862 from danra/patch-44
Fix includes order
2016-03-24 22:27:17 -07:00
Ted Kremenek
93e518c167 Merge pull request #1839 from danra/patch-34
isInvalid methods DRY
2016-03-24 22:09:21 -07:00
swift-ci
ecf1e10e5a Merge pull request #1844 from danra/patch-39
Merge pull request #${ghprbPullId} from ${ghprbPullAuthorLogin}/${ghprbSourceBranch} requested by ${ghprbTriggerAuthorLogin}
2016-03-24 17:33:26 -07:00
danra
978e851a0e Add constexpr version of maximum to algorithm
Add the constexpr version of max which is only available in std since c++14.
Besides being a logical addition next to the already implemented constexpr version of min, there are actually other files, even in Swift/Basic itself, which re-implement this functionality, such as PrefixMap.h. Once this is implemented here, the functionality can be re-used in those other locations, instead of re-implemented each time.
2016-03-25 00:58:09 +02:00
danra
653b282682 Fix includes order 2016-03-25 00:49:03 +02:00
Dan Raviv
9942cfc6a2 Add missing word in DiverseListImpl comment 2016-03-25 00:42:59 +02:00
John McCall
0ffb7278bc Only use metadata patterns for generic types; perform other
initialization in-place on demand.  Initialize parent metadata
references correctly on struct and enum metadata.

Also includes several minor improvements related to relative
pointers that I was using before deciding to simply switch the
parent reference to an absolute reference to get better access
patterns.

Includes a fix since the earlier commit to make enum metadata
writable if they have an unfilled payload size.  This didn't show
up on Darwin because "constant" is currently unenforced there in
global data containing relocations.

This patch requires an associated LLDB change which is being
submitted in parallel.
2016-03-24 15:10:31 -07:00
Michael Ilseman
76f01b6473 Merge remote-tracking branch 'origin' into import-as-member 2016-03-24 12:46:13 -07:00
Michael Ilseman
8759905351 Merge remote-tracking branch 'origin' into import-as-member 2016-03-24 11:37:36 -07:00
danra
21b0c52ad6 Use auto instead of repeating explicit class names 2016-03-24 20:09:06 +02:00
danra
b41ccbd58a Add missing period in end of DiverseStack comment (NFC) 2016-03-24 19:41:42 +02:00
Dmitri Gribenko
7907b4b0de Merge pull request #1828 from danra/patch-25
Make nodeToString brief comment clearer (NFC)
2016-03-24 10:24:41 -07:00
danra
9ff4ee43a5 Use auto instead of repeating explicit class names 2016-03-24 18:18:51 +02:00
danra
25bda30cfd Fix DiverseListImpl comment grammar 2016-03-24 18:12:32 +02:00
danra
9cb3e763cd operator!= DRY 2016-03-24 18:07:59 +02:00
danra
2b1d4a763d Remove redundant else 2016-03-24 18:05:06 +02:00
danra
a8cbd1d190 Fix includes order - 3rd-party should follow local 2016-03-24 17:36:45 +02:00
danra
eb4930c5e1 Add missing period in comment 2016-03-24 17:34:48 +02:00
danra
6d14912cfa Compact getEnd implementation 2016-03-24 16:38:30 +02:00