Commit Graph

1938 Commits

Author SHA1 Message Date
Jordan Rose
8b8c88e258 Improve swift::TransformRange enough to delete TransformArrayRef
We have a lot of "transform a range" types already:
llvm::mapped_iterator, swift::TransformRange and
swift::TransformIterator, and swift::ArrayRefView for static
transformations. This gets rid of one more layer without losing
any real functionality.
2019-10-02 10:23:05 -07:00
swift-ci
4e5ee3c6c0 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-30 09:03:42 -07:00
Joe Groff
4012a207c8 MetadataReader: Add an API for reading absolute pointers.
Pointer data in some remote reflection targets may required relocation, or may not be
fully resolvable, such as when we're dumping info from a single image on disk that
references other dynamic libraries. Add a `RemoteAbsolutePointer` type that can hold a
symbol, offset, or combination of both, and add APIs to `MemoryReader` and `MetadataReader`
for reading pointers that can get unresolved relocation info from an image, or apply
relocations to pointer information. MetadataReader can use the symbol name information to
fill in demanglings of symbolic-reference-bearing mangled names by using the information
from the symbol name to fill in the name even though the context descriptors are not
available.

For now, this is NFC (MemoryReader::resolvePointer just forwards the pointer data), but
lays the groundwork for implementation of relocation in ObjectMemoryReader.
2019-09-28 16:53:34 -07:00
swift-ci
e010cb4cd4 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-24 20:43:47 -07:00
Xi Ge
3103b5cec1 Frontend: set up output file .swiftsourceinfo
This patch will focus on teaching driver and frontend to emit this file.
The actual content and de-serialization parts will come later.

More details: https://forums.swift.org/t/proposal-emitting-source-information-file-during-compilation/28794
2019-09-24 13:52:17 -07:00
swift-ci
e2182dc166 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-22 20:44:27 -07:00
swift-ci
25488fea80 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-22 19:24:20 -07:00
David Ungar
4a265a91d7 Turn on ASTScopes 2019-09-22 19:17:49 -07:00
David Ungar
a9a9069591 change compare-to-astScope-lookup to crosscheck-unqualified-lookup 2019-09-22 17:59:39 -07:00
swift-ci
a2684816bb Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-14 19:04:01 -07:00
David Ungar
c7be2def90 Merge pull request #27143 from davidungar/A-9-12-eager-off
[NFC NameLookup ASTScope] Fixes for large app, eager primary tree creation, memberCount fix.
2019-09-14 18:46:17 -07:00
David Ungar
3afd6a7146 add flag to stress scope creation 2019-09-13 22:30:49 -07:00
swift-ci
a9e39bdb21 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-13 21:03:33 -07:00
Harlan Haskins
c82c9b8210 [ModuleInterfaces] Remove references to 'parseable' interfaces everywhere
Now that we've settled on Module Interface as the name, let's remove the
vestiges of "Parseable Interfaces"
2019-09-13 14:55:48 -07:00
Brent Royal-Gordon
8734092923 Merge branch 'master' into master-rebranch
# Conflicts:
#	lib/IRGen/GenExistential.cpp
2019-09-11 20:12:03 -07:00
Jordan Rose
111fb37f74 Remove swift::DoAtScopeExit in favor of llvm::make_scope_exit (#27113)
Keep the SWIFT_DEFER macro, though, which is what everyone in the
Swift codebase actually uses. No functionality change.
2019-09-10 18:30:30 -07:00
swift-ci
5aeb95af94 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-09 19:24:21 -07:00
Michael Gottesman
8e110108d3 [semantic-arc-opts] Eliminate dead trivial instructions /after/ the main loop to avoid issues around adding/removing things from the worklist.
rdar://55127027
2019-09-09 14:52:36 -07:00
swift-ci
866e20ad6a Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-07 02:23:41 -07:00
Michael Gottesman
4c803c9583 [gardening] LLVM has its own enumerate impl now. Use that and delete the one swift had.
NFCI.
2019-09-07 00:13:29 -07:00
swift-ci
98ec9bf194 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-07 00:03:39 -07:00
Michael Gottesman
bfec410b19 Merge pull request #27060 from gottesmm/pr-6e8972071ad9a8006749aecd85e288ae0cfb3a5f
[sil] Add new API ValueBase:getUsersOfType<T>().
2019-09-06 23:46:34 -07:00
swift-ci
5b3fdba240 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-06 17:23:34 -07:00
Michael Gottesman
7b2fc076f7 [sil] Add new API ValueBase:getUsersOfType<T>().
For some time now we have had the API ValueBase::getSingleUserOfType<T>() but we
never implemented getUsersOfType<T>() using transform/filter iterators.

Since there wasn't a specific API, several incarnations of this API have been
created for BeginBorrow, LoadBorrow, BeginAccess.

In this commit, I introduce the API and use it to excise the redundant code in
those above mentioned 3 instructions.
2019-09-06 16:40:51 -07:00
Slava Pestov
0405ab5ffc AST: GenericContexts store a GenericSignature instead of a GenericEnvironment
This eliminates the entire 'lazy generic environment' concept;
essentially, all generic environments are now lazy, and since
each signature has exactly one environment, their construction
no longer needs to be co-ordinated with deserialization.
2019-09-06 17:16:04 -04:00
swift-ci
dbbd7d584b Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-06 12:43:50 -07:00
swift-ci
b9d1078bf6 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-06 11:23:41 -07:00
Robert Widmann
087e2f2746 [Evaluator Ergonomics] Add location information options to the requests 2019-09-06 11:16:17 -07:00
swift-ci
902da317e2 Merge pull request #27028 from nate-chandler/update-instruction-worklist 2019-09-06 11:10:00 -07:00
swift-ci
4b84f44584 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-06 09:23:39 -07:00
Michael Gottesman
681a203e2f Merge pull request #27051 from gottesmm/pr-e2c4cb6f4381f6d58f10ec9729cadfb4407574df
[opt-transform-range] Do not assume that Range::iterator exists.
2019-09-06 09:16:26 -07:00
Nate Chandler
d2270b9e85 [SIL] Updated instruction worklist.
- Replaced usage of raw map and vector with the type that wraps the
  combination (BlotSetVector); that provided a significant deduplication
  since a sizeable portion of the worklist's implementation was in
  vector and map management now provided by the BlotSetVector.
- Templated over the type of map and vector used by the blot set vector.
- Added SmallSILInstructionWorklist where the map and vector are
  specified to be SmallDenseMap and SmallVector respectively.
- Replaced usages of bare ValueBase with usages of SILValue.
- Renamed zap to resetChecked.

Added a bit of functionality to BlotSetVector, specifically to support
SILInstructionWorklist:

- Made insert return not just the index that the potentially-inserted
  item is at on return but additionally whether an insertion occurred,
  matching the behavior of llvm::DenseMap::insert.
- Added a method to reserve capacity in the backing vector and map:
  BlotSetVector::reserve.
- Added a method to free extra storage used by the backing vector and
  map: BlotSetVector::clear.
- Modified SmallBlotSetVector's template parameters so that only a value
  and size can be specified--that type will always use SmallVector and
  SmallDenseMap for its superclass' VectorT and MapT template
  parameters.
- Updated variable names.
2019-09-06 09:10:26 -07:00
Michael Gottesman
69f6000921 [opt-transform-range] Do not assume that Range::iterator exists.
The reason not to do this is that some important range
adapters (e.x. llvm::iterator_range) do not have such a typedef. Rather than
changing upstream this commit just fixes the problem by inferring the iterator
type from the result of Range::begin().

TLDR: This makes OptionalTransformRange work with llvm::iterator_range.
2019-09-05 19:52:20 -07:00
swift-ci
358090f9d1 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-05 14:43:47 -07:00
Robert Widmann
7a51cfcb87 [Evaluator Ergonomics] Add Request Signatures
Also add their caching kinds.  This information will be used to remove
the need to define classes at all.
2019-09-05 13:15:02 -07:00
swift-ci
0591c81677 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-31 19:24:16 -07:00
Doug Gregor
1cd5d2edb3 Bring back SourceManager::rangeContainsCodeCompletionLoc() 2019-08-31 16:22:03 -07:00
swift-ci
f924efdc47 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-30 18:04:21 -07:00
Rintaro Ishizaki
8bd9fde575 Revert "[code-completion] Disable diagnostics in @functionBuilder bodies"
This reverts commit c6eade1c44.
2019-08-30 15:25:12 -07:00
swift-ci
d3ca90f4f2 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-29 19:25:39 -07:00
Michael Gottesman
dee2627d0e [semantic-arc-opts] Change semantic arc opts to use a SmallBlotSetVector instead of a SmallSetVector.
Blotting is a trick with Map/Set vectors that involves one assigning None to the
vector at the index mapped to an entry instead of deleting the entry itself from
the vector. This ensures that we do not need to move elements of the vector down
when erasing elements from the worklist.
2019-08-29 17:13:32 -07:00
swift-ci
86bdfeb467 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-29 14:04:23 -07:00
Doug Gregor
d8f7c9e72c [Parser] Introduce a request for parsing type and extension members.
Ensure that lazy parsing of the members of nominal type definitions
and extensions is handled through a request. Most of the effort here
is in establishing a new request zone for parser requests.
2019-08-28 21:39:56 -07:00
swift-ci
7bca7291e2 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-28 18:04:17 -07:00
Slava Pestov
da8ef333c6 Merge pull request #26791 from slavapestov/new-shadowing-rule-part-1
New shadowing rule, part 1
2019-08-28 20:53:32 -04:00
swift-ci
3ca9d535ae Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-28 15:04:18 -07:00
Slava Pestov
acf5371dfc AST: Introduce a new ImportCache singleton 2019-08-28 16:29:49 -04:00
David Ungar
1415f2f7f9 LazyASTScopes only matters when ASTScopes are enabled 2019-08-28 11:31:17 -07:00
swift-ci
f45e1c980c Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-27 20:24:32 -07:00
Robert Widmann
a19a70e5c9 Switch all request infrastructure to SWIFT_REQUEST
Formally define the Zones in the TypeID header.  This is not its final
resting place.
2019-08-27 17:38:14 -07:00