Skip to content

Commit 60bffeb

Browse files
committed
---
yaml --- r: 347486 b: refs/heads/master c: 36b9cac h: refs/heads/master
1 parent 8ba00b8 commit 60bffeb

39 files changed

+216
-767
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 178fca49792d023b1b2cab85e20df5993c870f24
2+
refs/heads/master: 36b9cac6a1c92f74c0ce61b600558b370569ebfc
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/include/swift/AST/DebuggerClient.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,6 @@ class DebuggerClient {
6161
SourceLoc Loc, bool IsTypeLookup,
6262
ResultVector &RV) = 0;
6363

64-
/// The following functions allow the debugger to modify the results of a
65-
/// qualfied lookup as needed. These methods may add, remove or modify the
66-
/// entries in `decls`. See the corresponding DeclContext::lookupInXYZ
67-
/// functions defined in NameLookup.cpp for more context.
68-
///
69-
70-
virtual void finishLookupInNominals(const DeclContext *dc,
71-
ArrayRef<NominalTypeDecl *> types,
72-
DeclName member, NLOptions options,
73-
SmallVectorImpl<ValueDecl *> &decls) {}
74-
75-
virtual void finishLookupInModule(const DeclContext *dc, ModuleDecl *module,
76-
DeclName member, NLOptions options,
77-
SmallVectorImpl<ValueDecl *> &decls) {}
78-
79-
virtual void finishLookupInAnyObject(const DeclContext *dc, DeclName member,
80-
NLOptions options,
81-
SmallVectorImpl<ValueDecl *> &decls) {}
82-
8364
/// When evaluating an expression in the context of an existing source file,
8465
/// we may want to prefer declarations from that source file.
8566
/// The DebuggerClient can return a private-discriminator to tell lookup to

trunk/include/swift/AST/NameLookup.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,10 @@ void forAllVisibleModules(const DeclContext *DC, const Fn &fn) {
367367
->forAllVisibleModules(ModuleDecl::AccessPathTy(), fn);
368368
}
369369

370-
/// Once name lookup has gathered a set of results, perform any necessary
370+
/// Only name lookup has gathered a set of results, perform any necessary
371371
/// steps to prune the result set before returning it to the caller.
372-
void pruneLookupResultSet(const DeclContext *dc, NLOptions options,
373-
SmallVectorImpl<ValueDecl *> &decls);
372+
bool finishLookup(const DeclContext *dc, NLOptions options,
373+
SmallVectorImpl<ValueDecl *> &decls);
374374

375375
/// Do nothing if debugClient is null.
376376
template <typename Result>

trunk/include/swift/AST/Pattern.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,7 @@ class alignas(8) Pattern {
221221

222222
void print(llvm::raw_ostream &OS,
223223
const PrintOptions &Options = PrintOptions()) const;
224-
LLVM_ATTRIBUTE_DEPRECATED(
225-
void dump() const LLVM_ATTRIBUTE_USED,
226-
"only for use within the debugger");
224+
void dump() const;
227225

228226
/// walk - This recursively walks the AST rooted at this pattern.
229227
Pattern *walk(ASTWalker &walker);

trunk/include/swift/AST/TypeRepr.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ class alignas(8) TypeRepr {
160160

161161
void print(raw_ostream &OS, const PrintOptions &Opts = PrintOptions()) const;
162162
void print(ASTPrinter &Printer, const PrintOptions &Opts) const;
163-
LLVM_ATTRIBUTE_DEPRECATED(
164-
void dump() const LLVM_ATTRIBUTE_USED,
165-
"only for use within the debugger");
163+
void dump() const;
166164

167165
/// Clone the given type representation.
168166
TypeRepr *clone(const ASTContext &ctx) const;

trunk/include/swift/LLVMPasses/Passes.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ namespace swift {
3131

3232
using AAResultBase::getModRefInfo;
3333
llvm::ModRefInfo getModRefInfo(const llvm::CallBase *Call,
34-
const llvm::MemoryLocation &Loc);
34+
const llvm::MemoryLocation &Loc) {
35+
llvm::AAQueryInfo AAQI;
36+
return getModRefInfo(Call, Loc, AAQI);
37+
}
38+
llvm::ModRefInfo getModRefInfo(const llvm::CallBase *Call,
39+
const llvm::MemoryLocation &Loc,
40+
llvm::AAQueryInfo &AAQI);
3541
};
3642

3743
class SwiftAAWrapperPass : public llvm::ImmutablePass {

trunk/include/swift/Reflection/ReflectionContext.h

Lines changed: 57 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ class ReflectionContext
202202
RangeEnd - RangeStart);
203203

204204
auto findMachOSectionByName = [&](std::string Name)
205-
-> std::pair<const char *, const char *> {
205+
-> std::pair<std::pair<const char *, const char *>, uint64_t> {
206206
for (unsigned I = 0; I < NumSect; ++I) {
207207
auto S = reinterpret_cast<typename T::Section *>(
208208
SectionsBuf + (I * sizeof(typename T::Section)));
@@ -213,9 +213,9 @@ class ReflectionContext
213213
auto LocalSectStart =
214214
reinterpret_cast<const char *>(SectBufData + RemoteSecStart - RangeStart);
215215
auto LocalSectEnd = reinterpret_cast<const char *>(LocalSectStart + S->size);
216-
return {LocalSectStart, LocalSectEnd};
216+
return {{LocalSectStart, LocalSectEnd}, 0};
217217
}
218-
return {nullptr, nullptr};
218+
return {{nullptr, nullptr}, 0};
219219
};
220220

221221
auto FieldMdSec = findMachOSectionByName("__swift5_fieldmd");
@@ -225,24 +225,24 @@ class ReflectionContext
225225
auto TypeRefMdSec = findMachOSectionByName("__swift5_typeref");
226226
auto ReflStrMdSec = findMachOSectionByName("__swift5_reflstr");
227227

228-
if (FieldMdSec.first == nullptr &&
229-
AssocTySec.first == nullptr &&
230-
BuiltinTySec.first == nullptr &&
231-
CaptureSec.first == nullptr &&
232-
TypeRefMdSec.first == nullptr &&
233-
ReflStrMdSec.first == nullptr)
228+
if (FieldMdSec.first.first == nullptr &&
229+
AssocTySec.first.first == nullptr &&
230+
BuiltinTySec.first.first == nullptr &&
231+
CaptureSec.first.first == nullptr &&
232+
TypeRefMdSec.first.first == nullptr &&
233+
ReflStrMdSec.first.first == nullptr)
234234
return false;
235235

236236
auto LocalStartAddress = reinterpret_cast<uint64_t>(SectBuf.get());
237237
auto RemoteStartAddress = static_cast<uint64_t>(RangeStart);
238238

239239
ReflectionInfo info = {
240-
{{FieldMdSec.first, FieldMdSec.second}, 0},
241-
{{AssocTySec.first, AssocTySec.second}, 0},
242-
{{BuiltinTySec.first, BuiltinTySec.second}, 0},
243-
{{CaptureSec.first, CaptureSec.second}, 0},
244-
{{TypeRefMdSec.first, TypeRefMdSec.second}, 0},
245-
{{ReflStrMdSec.first, ReflStrMdSec.second}, 0},
240+
{{FieldMdSec.first.first, FieldMdSec.first.second}, 0},
241+
{{AssocTySec.first.first, AssocTySec.first.second}, 0},
242+
{{BuiltinTySec.first.first, BuiltinTySec.first.second}, 0},
243+
{{CaptureSec.first.first, CaptureSec.first.second}, 0},
244+
{{TypeRefMdSec.first.first, TypeRefMdSec.first.second}, 0},
245+
{{ReflStrMdSec.first.first, ReflStrMdSec.first.second}, 0},
246246
LocalStartAddress,
247247
RemoteStartAddress};
248248

@@ -310,7 +310,7 @@ class ReflectionContext
310310
sizeof(llvm::object::coff_section) * COFFFileHdr->NumberOfSections);
311311

312312
auto findCOFFSectionByName = [&](llvm::StringRef Name)
313-
-> std::pair<const char *, const char *> {
313+
-> std::pair<std::pair<const char *, const char *>, uint32_t> {
314314
for (size_t i = 0; i < COFFFileHdr->NumberOfSections; ++i) {
315315
const llvm::object::coff_section *COFFSec =
316316
reinterpret_cast<const llvm::object::coff_section *>(
@@ -336,43 +336,45 @@ class ReflectionContext
336336
End -= 8;
337337
}
338338

339-
return {Begin, End};
339+
return {{Begin, End}, 0};
340340
}
341-
return {nullptr, nullptr};
341+
return {{nullptr, nullptr}, 0};
342342
};
343343

344-
std::pair<const char *, const char *> CaptureSec =
344+
std::pair<std::pair<const char *, const char *>, uint32_t> CaptureSec =
345345
findCOFFSectionByName(".sw5cptr");
346-
std::pair<const char *, const char *> TypeRefMdSec =
346+
std::pair<std::pair<const char *, const char *>, uint32_t> TypeRefMdSec =
347347
findCOFFSectionByName(".sw5tyrf");
348-
std::pair<const char *, const char *> FieldMdSec =
348+
std::pair<std::pair<const char *, const char *>, uint32_t> FieldMdSec =
349349
findCOFFSectionByName(".sw5flmd");
350-
std::pair<const char *, const char *> AssocTySec =
350+
std::pair<std::pair<const char *, const char *>, uint32_t> AssocTySec =
351351
findCOFFSectionByName(".sw5asty");
352-
std::pair<const char *, const char *> BuiltinTySec =
352+
std::pair<std::pair<const char *, const char *>, uint32_t> BuiltinTySec =
353353
findCOFFSectionByName(".sw5bltn");
354-
std::pair<const char *, const char *> ReflStrMdSec =
354+
std::pair<std::pair<const char *, const char *>, uint32_t> ReflStrMdSec =
355355
findCOFFSectionByName(".sw5rfst");
356356

357-
if (FieldMdSec.first == nullptr &&
358-
AssocTySec.first == nullptr &&
359-
BuiltinTySec.first == nullptr &&
360-
CaptureSec.first == nullptr &&
361-
TypeRefMdSec.first == nullptr &&
362-
ReflStrMdSec.first == nullptr)
357+
if (FieldMdSec.first.first == nullptr &&
358+
AssocTySec.first.first == nullptr &&
359+
BuiltinTySec.first.first == nullptr &&
360+
CaptureSec.first.first == nullptr &&
361+
TypeRefMdSec.first.first == nullptr &&
362+
ReflStrMdSec.first.first == nullptr)
363363
return false;
364-
365364
auto LocalStartAddress = reinterpret_cast<uintptr_t>(DOSHdrBuf.get());
366365
auto RemoteStartAddress =
367366
static_cast<uintptr_t>(ImageStart.getAddressData());
368367

369368
ReflectionInfo Info = {
370-
{{FieldMdSec.first, FieldMdSec.second}, 0},
371-
{{AssocTySec.first, AssocTySec.second}, 0},
372-
{{BuiltinTySec.first, BuiltinTySec.second}, 0},
373-
{{CaptureSec.first, CaptureSec.second}, 0},
374-
{{TypeRefMdSec.first, TypeRefMdSec.second}, 0},
375-
{{ReflStrMdSec.first, ReflStrMdSec.second}, 0},
369+
{{FieldMdSec.first.first, FieldMdSec.first.second}, FieldMdSec.second},
370+
{{AssocTySec.first.first, AssocTySec.first.second}, AssocTySec.second},
371+
{{BuiltinTySec.first.first, BuiltinTySec.first.second},
372+
BuiltinTySec.second},
373+
{{CaptureSec.first.first, CaptureSec.first.second}, CaptureSec.second},
374+
{{TypeRefMdSec.first.first, TypeRefMdSec.first.second},
375+
TypeRefMdSec.second},
376+
{{ReflStrMdSec.first.first, ReflStrMdSec.first.second},
377+
ReflStrMdSec.second},
376378
LocalStartAddress,
377379
RemoteStartAddress};
378380
this->addReflectionInfo(Info);
@@ -448,7 +450,7 @@ class ReflectionContext
448450
auto StrTab = reinterpret_cast<const char *>(StrTabBuf.get());
449451

450452
auto findELFSectionByName = [&](std::string Name)
451-
-> std::pair<const char *, const char *> {
453+
-> std::pair<std::pair<const char *, const char *>, uint64_t> {
452454
// Now for all the sections, find their name.
453455
for (const typename T::Section *Hdr : SecHdrVec) {
454456
uint32_t Offset = Hdr->sh_name;
@@ -460,9 +462,9 @@ class ReflectionContext
460462
auto SecSize = Hdr->sh_size;
461463
auto SecBuf = this->getReader().readBytes(SecStart, SecSize);
462464
auto SecContents = reinterpret_cast<const char *>(SecBuf.get());
463-
return {SecContents, SecContents + SecSize};
465+
return {{SecContents, SecContents + SecSize}, 0};
464466
}
465-
return {nullptr, nullptr};
467+
return {{nullptr, nullptr}, 0};
466468
};
467469

468470
auto FieldMdSec = findELFSectionByName("swift5_fieldmd");
@@ -474,25 +476,28 @@ class ReflectionContext
474476

475477
// We succeed if at least one of the sections is present in the
476478
// ELF executable.
477-
if (FieldMdSec.first == nullptr &&
478-
AssocTySec.first == nullptr &&
479-
BuiltinTySec.first == nullptr &&
480-
CaptureSec.first == nullptr &&
481-
TypeRefMdSec.first == nullptr &&
482-
ReflStrMdSec.first == nullptr)
479+
if (FieldMdSec.first.first == nullptr &&
480+
AssocTySec.first.first == nullptr &&
481+
BuiltinTySec.first.first == nullptr &&
482+
CaptureSec.first.first == nullptr &&
483+
TypeRefMdSec.first.first == nullptr &&
484+
ReflStrMdSec.first.first == nullptr)
483485
return false;
484486

485487
auto LocalStartAddress = reinterpret_cast<uint64_t>(Buf.get());
486488
auto RemoteStartAddress =
487489
static_cast<uint64_t>(ImageStart.getAddressData());
488490

489491
ReflectionInfo info = {
490-
{{FieldMdSec.first, FieldMdSec.second}, 0},
491-
{{AssocTySec.first, AssocTySec.second}, 0},
492-
{{BuiltinTySec.first, BuiltinTySec.second}, 0},
493-
{{CaptureSec.first, CaptureSec.second}, 0},
494-
{{TypeRefMdSec.first, TypeRefMdSec.second}, 0},
495-
{{ReflStrMdSec.first, ReflStrMdSec.second}, 0},
492+
{{FieldMdSec.first.first, FieldMdSec.first.second}, FieldMdSec.second},
493+
{{AssocTySec.first.first, AssocTySec.first.second}, AssocTySec.second},
494+
{{BuiltinTySec.first.first, BuiltinTySec.first.second},
495+
BuiltinTySec.second},
496+
{{CaptureSec.first.first, CaptureSec.first.second}, CaptureSec.second},
497+
{{TypeRefMdSec.first.first, TypeRefMdSec.first.second},
498+
TypeRefMdSec.second},
499+
{{ReflStrMdSec.first.first, ReflStrMdSec.first.second},
500+
ReflStrMdSec.second},
496501
LocalStartAddress,
497502
RemoteStartAddress};
498503

trunk/include/swift/SIL/SILLocation.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,8 +687,6 @@ class MandatoryInlinedLocation : public SILLocation {
687687
: SILLocation(D, MandatoryInlinedKind, F) {}
688688
MandatoryInlinedLocation(SourceLoc L, unsigned F)
689689
: SILLocation(L, MandatoryInlinedKind, F) {}
690-
MandatoryInlinedLocation(DebugLoc L, unsigned F)
691-
: SILLocation(L, MandatoryInlinedKind, F) {}
692690
};
693691

694692
/// Used on the instruction performing auto-generated cleanup such as

trunk/include/swift/Serialization/SerializedModuleLoader.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,6 @@ class SerializedModuleLoaderBase : public ModuleLoader {
5151
std::unique_ptr<llvm::MemoryBuffer> *moduleDocBuffer,
5252
bool &isFramework);
5353

54-
/// Attempts to search the provided directory for a loadable serialized
55-
/// .swiftmodule with the provided `ModuleFilename`. Subclasses must
56-
/// override this method to perform their custom module lookup behavior.
57-
///
58-
/// If such a module could not be loaded, the subclass must return a
59-
/// `std::error_code` indicating the failure. There are two specific error
60-
/// codes that will be treated specially:
61-
/// - `errc::no_such_file_or_directory`: The module loader will stop looking
62-
/// for loadable modules and will diagnose the lookup failure.
63-
/// - `errc::not_supported`: The module loader will stop looking for loadable
64-
/// modules and will defer to the remaining module loaders to look up this
65-
/// module.
6654
virtual std::error_code findModuleFilesInDirectory(
6755
AccessPathElem ModuleID, StringRef DirPath, StringRef ModuleFilename,
6856
StringRef ModuleDocFilename,

trunk/lib/AST/ASTPrinter.cpp

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -985,33 +985,6 @@ void PrintAST::printTypedPattern(const TypedPattern *TP) {
985985
printTypeLoc(TP->getTypeLoc());
986986
}
987987

988-
/// Determines if we are required to print the name of a property declaration,
989-
/// or if we can elide it by printing a '_' instead.
990-
static bool mustPrintPropertyName(VarDecl *decl, PrintOptions opts) {
991-
// If we're not allowed to omit the name, we must print it.
992-
if (!opts.OmitNameOfInaccessibleProperties) return true;
993-
994-
// If it contributes to the parent's storage, we must print it because clients
995-
// need to be able to directly access the storage.
996-
// FIXME: We might be able to avoid printing names for some of these
997-
// if we serialized references to them using field indices.
998-
if (contributesToParentTypeStorage(decl)) return true;
999-
1000-
// If it's public or @usableFromInline, we must print the name because it's a
1001-
// visible entry-point.
1002-
if (isPublicOrUsableFromInline(decl)) return true;
1003-
1004-
// If it has an initial value, we must print the name because it's used in
1005-
// the mangled name of the initializer expression generator function.
1006-
// FIXME: We _could_ figure out a way to generate an entry point
1007-
// for the initializer expression without revealing the name. We just
1008-
// don't have a mangling for it.
1009-
if (decl->hasInitialValue()) return true;
1010-
1011-
// If none of those are true, we can elide the name of the variable.
1012-
return false;
1013-
}
1014-
1015988
void PrintAST::printPattern(const Pattern *pattern) {
1016989
switch (pattern->getKind()) {
1017990
case PatternKind::Any:
@@ -1022,13 +995,16 @@ void PrintAST::printPattern(const Pattern *pattern) {
1022995
auto named = cast<NamedPattern>(pattern);
1023996
auto decl = named->getDecl();
1024997
recordDeclLoc(decl, [&]{
1025-
// FIXME: This always returns true now, because of the FIXMEs listed in
1026-
// mustPrintPropertyName.
1027-
if (mustPrintPropertyName(decl, Options))
1028-
Printer.printName(named->getBoundName());
1029-
else
998+
if (Options.OmitNameOfInaccessibleProperties &&
999+
contributesToParentTypeStorage(decl) &&
1000+
!isPublicOrUsableFromInline(decl) &&
1001+
// FIXME: We need to figure out a way to generate an entry point
1002+
// for the initializer expression without revealing the name.
1003+
!decl->hasInitialValue())
10301004
Printer << "_";
1031-
});
1005+
else
1006+
Printer.printName(named->getBoundName());
1007+
});
10321008
break;
10331009
}
10341010

0 commit comments

Comments
 (0)