Skip to content

Commit f04b868

Browse files
committed
---
yaml --- r: 275327 b: refs/heads/master-next c: b993c6e h: refs/heads/master i: 275325: 157ef7e 275323: adaaf9f 275319: 425f2d1 275311: 71658f3 275295: 6571057 275263: 55c766b 275199: 8aa8ecf
1 parent d8da00b commit f04b868

File tree

73 files changed

+705
-1471
lines changed

Some content is hidden

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

73 files changed

+705
-1471
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: 65b3164726f2e62dff31e90a5cb5e3fb67cc82bf
3-
refs/heads/master-next: e584416210827d9b72c670703a8cfdab6a91c51f
3+
refs/heads/master-next: b993c6e07692d9f63533bda2da32f7080b426224
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/docs/SIL.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4311,7 +4311,7 @@ open_existential_addr
43114311
// type P
43124312
// $*@opened P must be a unique archetype that refers to an opened
43134313
// existential type P.
4314-
// %1 will be of type $*@opened P
4314+
// %1 will be of type $*P
43154315

43164316
Obtains the address of the concrete value inside the existential
43174317
container referenced by ``%0``. The protocol conformances associated
@@ -4334,7 +4334,7 @@ open_existential_value
43344334
// type P
43354335
// $@opened P must be a unique archetype that refers to an opened
43364336
// existential type P.
4337-
// %1 will be of type $@opened P
4337+
// %1 will be of type $P
43384338

43394339
Loadable version of the above: Opens-up the existential
43404340
container associated with ``%0``. The protocol conformances associated

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace swift {
3030
const llvm::PreservedAnalyses &) { return false; }
3131

3232
using AAResultBase::getModRefInfo;
33-
llvm::ModRefInfo getModRefInfo(const llvm::CallBase *Call,
33+
llvm::ModRefInfo getModRefInfo(llvm::ImmutableCallSite CS,
3434
const llvm::MemoryLocation &Loc);
3535
};
3636

branches/master-next/include/swift/SIL/SILBuilder.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,7 @@ class SILBuilder {
198198
SILModule &getModule() const { return C.Module; }
199199
ASTContext &getASTContext() const { return getModule().getASTContext(); }
200200
const Lowering::TypeLowering &getTypeLowering(SILType T) const {
201-
// FIXME: Expansion
202-
return getModule().Types.getTypeLowering(T,
203-
ResilienceExpansion::Minimal);
201+
return getModule().getTypeLowering(T);
204202
}
205203

206204
void setOpenedArchetypesTracker(SILOpenedArchetypesTracker *Tracker) {
@@ -2157,15 +2155,13 @@ class SILBuilder {
21572155
if (!SILModuleConventions(M).useLoweredAddresses())
21582156
return true;
21592157

2160-
// FIXME: Just call getTypeLowering() here, and move this code there
2161-
21622158
auto expansion = ResilienceExpansion::Maximal;
21632159
// If there's no current SILFunction, we're inserting into a global
21642160
// variable initializer.
21652161
if (F)
21662162
expansion = F->getResilienceExpansion();
21672163

2168-
return M.Types.getTypeLowering(Ty, expansion).isLoadable();
2164+
return M.getTypeLowering(Ty, expansion).isLoadable();
21692165
}
21702166

21712167
void appendOperandTypeName(SILType OpdTy, llvm::SmallString<16> &Name) {

branches/master-next/include/swift/SIL/SILModule.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,13 @@ class SILModule {
315315
/// This converts Swift types to SILTypes.
316316
mutable Lowering::TypeConverter Types;
317317

318+
/// Look up the TypeLowering for a SILType.
319+
const Lowering::TypeLowering &
320+
getTypeLowering(SILType t, ResilienceExpansion expansion =
321+
ResilienceExpansion::Minimal) {
322+
return Types.getTypeLowering(t, expansion);
323+
}
324+
318325
/// Invalidate cached entries in SIL Loader.
319326
void invalidateSILLoaderCaches();
320327

branches/master-next/include/swift/SIL/TypeLowering.h

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -216,29 +216,26 @@ class TypeLowering {
216216
};
217217

218218
private:
219-
friend class TypeConverter;
220-
221219
/// The SIL type of values with this Swift type.
222220
SILType LoweredType;
223221

224222
RecursiveProperties Properties;
225223
unsigned ReferenceCounted : 1;
226224

225+
public:
227226
/// The resilience expansion for this type lowering.
228227
/// If the type is not resilient at all, this is always Minimal.
229-
unsigned ForExpansion : 1;
228+
ResilienceExpansion forExpansion = ResilienceExpansion::Minimal;
230229

231230
/// A single linked list of lowerings for different resilience expansions.
232231
/// The first lowering is always for ResilientExpansion::Minimal.
233-
mutable const TypeLowering *NextExpansion = nullptr;
232+
mutable const TypeLowering *nextExpansion = nullptr;
234233

235234
protected:
236235
TypeLowering(SILType type, RecursiveProperties properties,
237-
IsReferenceCounted_t isRefCounted,
238-
ResilienceExpansion forExpansion)
236+
IsReferenceCounted_t isRefCounted)
239237
: LoweredType(type), Properties(properties),
240-
ReferenceCounted(isRefCounted),
241-
ForExpansion(unsigned(forExpansion)) {}
238+
ReferenceCounted(isRefCounted) {}
242239

243240
public:
244241
TypeLowering(const TypeLowering &) = delete;
@@ -250,22 +247,12 @@ class TypeLowering {
250247
/// convention?
251248
///
252249
/// This is independent of whether the SIL argument is address type.
253-
bool isFormallyPassedIndirectly() const {
254-
assert(!isResilient() ||
255-
getResilienceExpansion() == ResilienceExpansion::Minimal &&
256-
"calling convention uses minimal resilience expansion");
257-
return isAddressOnly();
258-
}
250+
bool isFormallyPassedIndirectly() const { return isAddressOnly(); }
259251

260252
/// Are r-values of this type returned indirectly by formal convention?
261253
///
262254
/// This is independent of whether the SIL result is address type.
263-
bool isFormallyReturnedIndirectly() const {
264-
assert(!isResilient() ||
265-
getResilienceExpansion() == ResilienceExpansion::Minimal &&
266-
"calling convention uses minimal resilience expansion");
267-
return isAddressOnly();
268-
}
255+
bool isFormallyReturnedIndirectly() const { return isAddressOnly(); }
269256

270257
RecursiveProperties getRecursiveProperties() const {
271258
return Properties;
@@ -319,10 +306,6 @@ class TypeLowering {
319306
return Properties.isResilient();
320307
}
321308

322-
ResilienceExpansion getResilienceExpansion() const {
323-
return ResilienceExpansion(ForExpansion);
324-
}
325-
326309
/// Produce an exact copy of the value in the given address as a
327310
/// scalar. The caller is responsible for destroying this value,
328311
/// e.g. by releasing it.
@@ -765,7 +748,8 @@ class TypeConverter {
765748
/// Lowers a Swift type to a SILType, and returns the SIL TypeLowering
766749
/// for that type.
767750
const TypeLowering &
768-
getTypeLowering(Type t, ResilienceExpansion forExpansion) {
751+
getTypeLowering(Type t, ResilienceExpansion forExpansion =
752+
ResilienceExpansion::Minimal) {
769753
AbstractionPattern pattern(getCurGenericContext(), t->getCanonicalType());
770754
return getTypeLowering(pattern, t, forExpansion);
771755
}
@@ -774,28 +758,33 @@ class TypeConverter {
774758
/// patterns of the given original type.
775759
const TypeLowering &getTypeLowering(AbstractionPattern origType,
776760
Type substType,
777-
ResilienceExpansion forExpansion);
761+
ResilienceExpansion forExpansion =
762+
ResilienceExpansion::Minimal);
778763

779764
/// Returns the SIL TypeLowering for an already lowered SILType. If the
780765
/// SILType is an address, returns the TypeLowering for the pointed-to
781766
/// type.
782767
const TypeLowering &
783-
getTypeLowering(SILType t, ResilienceExpansion forExpansion);
768+
getTypeLowering(SILType t, ResilienceExpansion forExpansion =
769+
ResilienceExpansion::Minimal);
784770

785771
// Returns the lowered SIL type for a Swift type.
786-
SILType getLoweredType(Type t, ResilienceExpansion forExpansion) {
772+
SILType getLoweredType(Type t, ResilienceExpansion forExpansion
773+
= ResilienceExpansion::Minimal) {
787774
return getTypeLowering(t, forExpansion).getLoweredType();
788775
}
789776

790777
// Returns the lowered SIL type for a Swift type.
791778
SILType getLoweredType(AbstractionPattern origType, Type substType,
792-
ResilienceExpansion forExpansion) {
779+
ResilienceExpansion forExpansion =
780+
ResilienceExpansion::Minimal) {
793781
return getTypeLowering(origType, substType, forExpansion)
794782
.getLoweredType();
795783
}
796784

797785
SILType getLoweredLoadableType(Type t,
798-
ResilienceExpansion forExpansion) {
786+
ResilienceExpansion forExpansion =
787+
ResilienceExpansion::Minimal) {
799788
const TypeLowering &ti = getTypeLowering(t, forExpansion);
800789
assert(
801790
(ti.isLoadable() || !SILModuleConventions(M).useLoweredAddresses()) &&
@@ -804,16 +793,11 @@ class TypeConverter {
804793
}
805794

806795
CanType getLoweredRValueType(Type t) {
807-
// We're ignoring the category (object vs address), so the resilience
808-
// expansion does not matter.
809-
return getLoweredType(t, ResilienceExpansion::Minimal).getASTType();
796+
return getLoweredType(t).getASTType();
810797
}
811798

812799
CanType getLoweredRValueType(AbstractionPattern origType, Type substType) {
813-
// We're ignoring the category (object vs address), so the resilience
814-
// expansion does not matter.
815-
return getLoweredType(origType, substType,
816-
ResilienceExpansion::Minimal).getASTType();
800+
return getLoweredType(origType, substType).getASTType();
817801
}
818802

819803
AbstractionPattern getAbstractionPattern(AbstractStorageDecl *storage,

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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ StringRef swift::getPlatformNameForTriple(const llvm::Triple &triple) {
142142
case llvm::Triple::AMDPAL:
143143
case llvm::Triple::HermitCore:
144144
case llvm::Triple::Hurd:
145-
case llvm::Triple::WASI:
146145
return "";
147146
case llvm::Triple::Darwin:
148147
case llvm::Triple::MacOSX:

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8053,7 +8053,6 @@ ClangImporter::Implementation::createConstant(Identifier name, DeclContext *dc,
80538053
case clang::APValue::Array:
80548054
case clang::APValue::ComplexFloat:
80558055
case clang::APValue::ComplexInt:
8056-
case clang::APValue::FixedPoint:
80578056
case clang::APValue::LValue:
80588057
case clang::APValue::MemberPointer:
80598058
case clang::APValue::Struct:

branches/master-next/lib/Frontend/ArgsToFrontendOutputsConverter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ SupplementaryOutputPathsComputer::computeOutputPathsForOneInput(
401401
ID emitModuleOption;
402402
std::string moduleExtension;
403403
std::string mainOutputIfUsableForModule;
404-
deriveModulePathParameters(outputFile, emitModuleOption, moduleExtension,
404+
deriveModulePathParameters(emitModuleOption, moduleExtension,
405405
mainOutputIfUsableForModule);
406406

407407
auto moduleOutputPath = determineSupplementaryOutputFilename(
@@ -458,7 +458,7 @@ SupplementaryOutputPathsComputer::determineSupplementaryOutputFilename(
458458
};
459459

460460
void SupplementaryOutputPathsComputer::deriveModulePathParameters(
461-
StringRef mainOutputFile, options::ID &emitOption, std::string &extension,
461+
options::ID &emitOption, std::string &extension,
462462
std::string &mainOutputIfUsable) const {
463463

464464
bool isSIB = RequestedAction == FrontendOptions::ActionType::EmitSIB ||
@@ -477,7 +477,7 @@ void SupplementaryOutputPathsComputer::deriveModulePathParameters(
477477
isSIB ? file_types::TY_SIB : file_types::TY_SwiftModuleFile);
478478

479479
mainOutputIfUsable =
480-
canUseMainOutputForModule && !OutputFiles.empty() ? mainOutputFile : "";
480+
canUseMainOutputForModule && !OutputFiles.empty() ? OutputFiles[0] : "";
481481
}
482482

483483
static SupplementaryOutputPaths

branches/master-next/lib/Frontend/ArgsToFrontendOutputsConverter.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ class SupplementaryOutputPathsComputer {
167167
file_types::ID type, StringRef mainOutputIfUsable,
168168
StringRef defaultSupplementaryOutputPathExcludingExtension) const;
169169

170-
void deriveModulePathParameters(StringRef mainOutputFile,
171-
options::ID &emitOption,
170+
void deriveModulePathParameters(options::ID &emitOption,
172171
std::string &extension,
173172
std::string &mainOutputIfUsable) const;
174173
};

0 commit comments

Comments
 (0)