Skip to content

Commit 2b32f7b

Browse files
committed
---
yaml --- r: 286334 b: refs/heads/master-next c: 52dc2e6 h: refs/heads/master
1 parent 12cc95d commit 2b32f7b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+397
-598
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: a67ffadd758dfc7a0f10a8afde063b8864663208
3-
refs/heads/master-next: 7887cfaa7b8fa9d7331feaf027d507ec8e394c37
3+
refs/heads/master-next: 52dc2e6d5b4de055584ea5eb629dcfb05c220b13
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/include/swift/AST/DiagnosticsFrontend.def

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,6 @@ ERROR(invalid_vfs_overlay_file,none,
261261
WARNING(module_interface_scoped_import_unsupported,none,
262262
"scoped imports are not yet supported in module interfaces",
263263
())
264-
WARNING(warn_unsupported_module_interface_swift_version,none,
265-
"module interfaces are only supported with Swift language version 5 "
266-
"or later (currently using -swift-version %0)",
267-
(StringRef))
268-
WARNING(warn_unsupported_module_interface_library_evolution,none,
269-
"module interfaces are only supported with -enable-library-evolution",
270-
())
271264
ERROR(error_extracting_version_from_module_interface,none,
272265
"error extracting version from module interface", ())
273266
ERROR(unsupported_version_of_module_interface,none,

branches/master-next/include/swift/AST/Types.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4828,10 +4828,11 @@ END_CAN_TYPE_WRAPPER(OpaqueTypeArchetypeType, ArchetypeType)
48284828
/// to their underlying types.
48294829
class ReplaceOpaqueTypesWithUnderlyingTypes {
48304830
public:
4831-
SILFunction *context;
4832-
ReplaceOpaqueTypesWithUnderlyingTypes(
4833-
SILFunction *context)
4834-
: context(context) {}
4831+
ModuleDecl *contextModule;
4832+
ResilienceExpansion contextExpansion;
4833+
ReplaceOpaqueTypesWithUnderlyingTypes(ModuleDecl *contextModule,
4834+
ResilienceExpansion contextExpansion)
4835+
: contextModule(contextModule), contextExpansion(contextExpansion) {}
48354836

48364837
/// TypeSubstitutionFn
48374838
Type operator()(SubstitutableType *maybeOpaqueType) const;
@@ -4844,7 +4845,8 @@ class ReplaceOpaqueTypesWithUnderlyingTypes {
48444845
bool shouldPerformSubstitution(OpaqueTypeDecl *opaque) const;
48454846

48464847
static bool shouldPerformSubstitution(OpaqueTypeDecl *opaque,
4847-
SILFunction *context);
4848+
ModuleDecl *contextModule,
4849+
ResilienceExpansion contextExpansion);
48484850
};
48494851

48504852
/// An archetype that represents the dynamic type of an opened existential.

branches/master-next/include/swift/LLVMPasses/Passes.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,8 @@ namespace swift {
3030
const llvm::PreservedAnalyses &) { return false; }
3131

3232
using AAResultBase::getModRefInfo;
33-
llvm::ModRefInfo getModRefInfo(const llvm::CallBase *Call,
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);
33+
llvm::ModRefInfo getModRefInfo(llvm::ImmutableCallSite CS,
34+
const llvm::MemoryLocation &Loc);
4135
};
4236

4337
class SwiftAAWrapperPass : public llvm::ImmutablePass {

branches/master-next/lib/AST/Type.cpp

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2474,12 +2474,36 @@ getArchetypeAndRootOpaqueArchetype(Type maybeOpaqueType) {
24742474

24752475
bool ReplaceOpaqueTypesWithUnderlyingTypes::shouldPerformSubstitution(
24762476
OpaqueTypeDecl *opaque) const {
2477-
return shouldPerformSubstitution(opaque, context);
2477+
return shouldPerformSubstitution(opaque, contextModule, contextExpansion);
24782478
}
24792479

2480-
static Type substOpaqueTypesWithUnderlyingTypes(
2481-
Type ty, SILFunction *context) {
2482-
ReplaceOpaqueTypesWithUnderlyingTypes replacer(context);
2480+
bool ReplaceOpaqueTypesWithUnderlyingTypes::shouldPerformSubstitution(
2481+
OpaqueTypeDecl *opaque, ModuleDecl *contextModule,
2482+
ResilienceExpansion contextExpansion) {
2483+
auto namingDecl = opaque->getNamingDecl();
2484+
2485+
// Allow replacement of opaque result types of inlineable function regardless
2486+
// of resilience and in which context.
2487+
if (namingDecl->getAttrs().hasAttribute<InlinableAttr>()) {
2488+
return true;
2489+
}
2490+
// Allow replacement of opaque result types in the context of maximal
2491+
// resilient expansion if the context's and the opaque type's module are the
2492+
// same.
2493+
auto module = namingDecl->getModuleContext();
2494+
if (contextExpansion == ResilienceExpansion::Maximal &&
2495+
module == contextModule)
2496+
return true;
2497+
2498+
// Allow general replacement from non resilient modules. Otherwise, disallow.
2499+
return !module->isResilient();
2500+
}
2501+
2502+
static Type
2503+
substOpaqueTypesWithUnderlyingTypes(Type ty, ModuleDecl *contextModule,
2504+
ResilienceExpansion contextExpansion) {
2505+
ReplaceOpaqueTypesWithUnderlyingTypes replacer(contextModule,
2506+
contextExpansion);
24832507
return ty.subst(replacer, replacer, SubstFlags::SubstituteOpaqueArchetypes);
24842508
}
24852509

@@ -2512,15 +2536,18 @@ operator()(SubstitutableType *maybeOpaqueType) const {
25122536

25132537
// If the type still contains opaque types, recur.
25142538
if (substTy->hasOpaqueArchetype()) {
2515-
return substOpaqueTypesWithUnderlyingTypes(substTy, context);
2539+
return substOpaqueTypesWithUnderlyingTypes(substTy, contextModule,
2540+
contextExpansion);
25162541
}
25172542
return substTy;
25182543
}
25192544

25202545
static ProtocolConformanceRef
25212546
substOpaqueTypesWithUnderlyingTypes(ProtocolConformanceRef ref, Type origType,
2522-
SILFunction *context) {
2523-
ReplaceOpaqueTypesWithUnderlyingTypes replacer(context);
2547+
ModuleDecl *contextModule,
2548+
ResilienceExpansion contextExpansion) {
2549+
ReplaceOpaqueTypesWithUnderlyingTypes replacer(contextModule,
2550+
contextExpansion);
25242551
return ref.subst(origType, replacer, replacer,
25252552
SubstFlags::SubstituteOpaqueArchetypes);
25262553
}
@@ -2562,7 +2589,8 @@ operator()(CanType maybeOpaqueType, Type replacementType,
25622589

25632590
// If the type still contains opaque types, recur.
25642591
if (substTy->hasOpaqueArchetype()) {
2565-
return substOpaqueTypesWithUnderlyingTypes(substRef, substTy, context);
2592+
return substOpaqueTypesWithUnderlyingTypes(substRef, substTy, contextModule,
2593+
contextExpansion);
25662594
}
25672595
return substRef;
25682596
}

branches/master-next/lib/Basic/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ macro(find_first_existing_vc_file out_var path)
3030
)
3131
endmacro()
3232

33-
set(generate_vcs_version_script "${LLVM_MAIN_SRC_DIR}/cmake/modules/GenerateVersionFromVCS.cmake")
33+
set(get_svn_script "${LLVM_MAIN_SRC_DIR}/cmake/modules/GetSVN.cmake")
3434

3535
function(generate_revision_inc revision_inc_var name dir)
3636
find_first_existing_vc_file(dep_file "${dir}")
@@ -39,12 +39,12 @@ function(generate_revision_inc revision_inc_var name dir)
3939
string(TOUPPER ${name} upper_name)
4040
if(DEFINED dep_file)
4141
add_custom_command(OUTPUT "${revision_inc}"
42-
DEPENDS "${dep_file}" "${generate_vcs_version_script}"
42+
DEPENDS "${dep_file}" "${get_svn_script}"
4343
COMMAND
44-
${CMAKE_COMMAND} "-DNAMES=${upper_name}"
45-
"-D${upper_name}_SOURCE_DIR=${dir}"
44+
${CMAKE_COMMAND} "-DFIRST_SOURCE_DIR=${dir}"
45+
"-DFIRST_NAME=${upper_name}"
4646
"-DHEADER_FILE=${revision_inc}"
47-
-P "${generate_vcs_version_script}")
47+
-P "${get_svn_script}")
4848
else()
4949
# Generate an empty Revision.inc file if we are not using git or SVN.
5050
file(WRITE "${revision_inc}" "")

branches/master-next/lib/Basic/Platform.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ StringRef swift::getPlatformNameForTriple(const llvm::Triple &triple) {
122122
case llvm::Triple::Ananas:
123123
case llvm::Triple::CloudABI:
124124
case llvm::Triple::DragonFly:
125-
case llvm::Triple::Emscripten:
126125
case llvm::Triple::Fuchsia:
127126
case llvm::Triple::KFreeBSD:
128127
case llvm::Triple::Lv2:
@@ -143,7 +142,6 @@ StringRef swift::getPlatformNameForTriple(const llvm::Triple &triple) {
143142
case llvm::Triple::AMDPAL:
144143
case llvm::Triple::HermitCore:
145144
case llvm::Triple::Hurd:
146-
case llvm::Triple::WASI:
147145
return "";
148146
case llvm::Triple::Darwin:
149147
case llvm::Triple::MacOSX:

branches/master-next/lib/ClangImporter/ClangImporter.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,17 +1010,16 @@ ClangImporter::create(ASTContext &ctx,
10101010

10111011
// Set up the file manager.
10121012
{
1013-
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS;
10141013
if (!ctx.SearchPathOpts.VFSOverlayFiles.empty()) {
10151014
// If the clang instance has overlays it means the user has provided
10161015
// -ivfsoverlay options and swift -vfsoverlay options. We're going to
10171016
// clobber their file system with our own, so warn about it.
10181017
if (!instance.getHeaderSearchOpts().VFSOverlayFiles.empty()) {
10191018
ctx.Diags.diagnose(SourceLoc(), diag::clang_vfs_overlay_is_ignored);
10201019
}
1021-
VFS = ctx.SourceMgr.getFileSystem();
1020+
instance.setVirtualFileSystem(ctx.SourceMgr.getFileSystem());
10221021
}
1023-
instance.createFileManager(std::move(VFS));
1022+
instance.createFileManager();
10241023
}
10251024

10261025
// Don't stop emitting messages if we ever can't load a module.
@@ -1034,7 +1033,8 @@ ClangImporter::create(ASTContext &ctx,
10341033
clangDiags.setSeverity(clang::diag::err_module_not_built,
10351034
clang::diag::Severity::Error,
10361035
clang::SourceLocation());
1037-
clangDiags.setFatalsAsError(ctx.Diags.getShowDiagnosticsAfterFatalError());
1036+
clangDiags.setSuppressAfterFatalError(
1037+
!ctx.Diags.getShowDiagnosticsAfterFatalError());
10381038

10391039

10401040
// Create the associated action.

branches/master-next/lib/ClangImporter/ImportDecl.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8103,7 +8103,6 @@ ClangImporter::Implementation::createConstant(Identifier name, DeclContext *dc,
81038103
case clang::APValue::Array:
81048104
case clang::APValue::ComplexFloat:
81058105
case clang::APValue::ComplexInt:
8106-
case clang::APValue::FixedPoint:
81078106
case clang::APValue::LValue:
81088107
case clang::APValue::MemberPointer:
81098108
case clang::APValue::Struct:

branches/master-next/lib/Demangling/Remangler.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,9 +2361,6 @@ void Remangler::mangleOpaqueReturnTypeOf(Node *node) {
23612361
Buffer << "QO";
23622362
}
23632363
void Remangler::mangleOpaqueType(Node *node) {
2364-
SubstitutionEntry entry;
2365-
if (trySubstitution(node, entry)) return;
2366-
23672364
mangle(node->getChild(0));
23682365
auto boundGenerics = node->getChild(2);
23692366
for (unsigned i = 0; i < boundGenerics->getNumChildren(); ++i) {
@@ -2378,8 +2375,6 @@ void Remangler::mangleOpaqueType(Node *node) {
23782375
}
23792376
Buffer << "Qo";
23802377
mangleIndex(node->getChild(1)->getIndex());
2381-
2382-
addSubstitution(entry);
23832378
}
23842379
void Remangler::mangleAccessorFunctionReference(Node *node) {
23852380
unreachable("can't remangle");

branches/master-next/lib/FrontendTool/FrontendTool.cpp

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -358,26 +358,12 @@ static bool printAsObjCIfNeeded(StringRef outputPath, ModuleDecl *M,
358358
/// \returns true if there were any errors
359359
///
360360
/// \see swift::emitParseableInterface
361-
static bool
362-
printParseableInterfaceIfNeeded(StringRef outputPath,
363-
ParseableInterfaceOptions const &Opts,
364-
LangOptions const &LangOpts,
365-
ModuleDecl *M) {
361+
static bool printParseableInterfaceIfNeeded(StringRef outputPath,
362+
ParseableInterfaceOptions const &Opts,
363+
ModuleDecl *M) {
366364
if (outputPath.empty())
367365
return false;
368-
369-
DiagnosticEngine &diags = M->getDiags();
370-
if (!LangOpts.isSwiftVersionAtLeast(5)) {
371-
assert(LangOpts.isSwiftVersionAtLeast(4));
372-
diags.diagnose(SourceLoc(),
373-
diag::warn_unsupported_module_interface_swift_version,
374-
LangOpts.isSwiftVersionAtLeast(4, 2) ? "4.2" : "4");
375-
}
376-
if (M->getResilienceStrategy() != ResilienceStrategy::Resilient) {
377-
diags.diagnose(SourceLoc(),
378-
diag::warn_unsupported_module_interface_library_evolution);
379-
}
380-
return withOutputFile(diags, outputPath,
366+
return withOutputFile(M->getDiags(), outputPath,
381367
[M, Opts](raw_ostream &out) -> bool {
382368
return swift::emitParseableInterface(out, Opts, M);
383369
});
@@ -935,7 +921,6 @@ static bool emitAnyWholeModulePostTypeCheckSupplementaryOutputs(
935921
hadAnyError |= printParseableInterfaceIfNeeded(
936922
Invocation.getParseableInterfaceOutputPathForWholeModule(),
937923
Invocation.getParseableInterfaceOptions(),
938-
Invocation.getLangOptions(),
939924
Instance.getMainModule());
940925
}
941926

branches/master-next/lib/IRGen/GenCall.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1609,7 +1609,7 @@ llvm::CallSite CallEmission::emitCallSite() {
16091609
{ opaqueCallee });
16101610
opaqueCallee =
16111611
IGF.Builder.CreateBitCast(opaqueCallee, origCallee->getType());
1612-
call->setCalledFunction(fn.getFunctionType(), opaqueCallee);
1612+
call->setCalledFunction(opaqueCallee);
16131613

16141614
// Reset the insert point to after the call.
16151615
IGF.Builder.SetInsertPoint(call->getParent());

branches/master-next/lib/IRGen/GenClass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1999,7 +1999,6 @@ namespace {
19991999
case llvm::Triple::MachO:
20002000
var->setSection("__DATA, __objc_const");
20012001
break;
2002-
case llvm::Triple::XCOFF:
20032002
case llvm::Triple::COFF:
20042003
var->setSection(".data");
20052004
break;

branches/master-next/lib/IRGen/GenDecl.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "llvm/IR/GlobalAlias.h"
4242
#include "llvm/IR/InlineAsm.h"
4343
#include "llvm/IR/Module.h"
44+
#include "llvm/IR/TypeBuilder.h"
4445
#include "llvm/IR/Value.h"
4546
#include "llvm/Support/Compiler.h"
4647
#include "llvm/Support/ConvertUTF.h"
@@ -872,7 +873,6 @@ std::string IRGenModule::GetObjCSectionName(StringRef Section,
872873
: ("__DATA," + Section + "," + MachOAttributes).str();
873874
case llvm::Triple::ELF:
874875
return Section.substr(2).str();
875-
case llvm::Triple::XCOFF:
876876
case llvm::Triple::COFF:
877877
return ("." + Section.substr(2) + "$B").str();
878878
case llvm::Triple::Wasm:
@@ -904,7 +904,6 @@ void IRGenModule::SetCStringLiteralSection(llvm::GlobalVariable *GV,
904904
}
905905
case llvm::Triple::ELF:
906906
return;
907-
case llvm::Triple::XCOFF:
908907
case llvm::Triple::COFF:
909908
return;
910909
case llvm::Triple::Wasm:
@@ -1305,7 +1304,6 @@ static std::string getDynamicReplacementSection(IRGenModule &IGM) {
13051304
case llvm::Triple::Wasm:
13061305
sectionName = "swift5_replace";
13071306
break;
1308-
case llvm::Triple::XCOFF:
13091307
case llvm::Triple::COFF:
13101308
sectionName = ".sw5repl$B";
13111309
break;
@@ -2880,7 +2878,6 @@ llvm::Constant *IRGenModule::emitSwiftProtocols() {
28802878
case llvm::Triple::Wasm:
28812879
sectionName = "swift5_protocols";
28822880
break;
2883-
case llvm::Triple::XCOFF:
28842881
case llvm::Triple::COFF:
28852882
sectionName = ".sw5prt$B";
28862883
break;
@@ -2941,7 +2938,6 @@ llvm::Constant *IRGenModule::emitProtocolConformances() {
29412938
case llvm::Triple::Wasm:
29422939
sectionName = "swift5_protocol_conformances";
29432940
break;
2944-
case llvm::Triple::XCOFF:
29452941
case llvm::Triple::COFF:
29462942
sectionName = ".sw5prtc$B";
29472943
break;
@@ -2967,7 +2963,6 @@ llvm::Constant *IRGenModule::emitTypeMetadataRecords() {
29672963
case llvm::Triple::Wasm:
29682964
sectionName = "swift5_type_metadata";
29692965
break;
2970-
case llvm::Triple::XCOFF:
29712966
case llvm::Triple::COFF:
29722967
sectionName = ".sw5tymd$B";
29732968
break;
@@ -3036,7 +3031,6 @@ llvm::Constant *IRGenModule::emitFieldDescriptors() {
30363031
case llvm::Triple::Wasm:
30373032
sectionName = "swift5_fieldmd";
30383033
break;
3039-
case llvm::Triple::XCOFF:
30403034
case llvm::Triple::COFF:
30413035
sectionName = ".sw5flmd$B";
30423036
break;
@@ -4308,10 +4302,7 @@ IRGenModule::getOrCreateHelperFunction(StringRef fnName, llvm::Type *resultTy,
43084302
llvm::FunctionType *fnTy =
43094303
llvm::FunctionType::get(resultTy, paramTys, false);
43104304

4311-
llvm::Constant *fn =
4312-
cast<llvm::Function>(Module.getOrInsertFunction(fnName, fnTy)
4313-
.getCallee()
4314-
->stripPointerCasts());
4305+
llvm::Constant *fn = Module.getOrInsertFunction(fnName, fnTy);
43154306

43164307
if (llvm::Function *def = shouldDefineHelper(*this, fn, setIsNoInline)) {
43174308
IRGenFunction IGF(*this, def);

0 commit comments

Comments
 (0)