Skip to content

Commit 5ea090b

Browse files
committed
---
yaml --- r: 349439 b: refs/heads/master-next c: b025c30 h: refs/heads/master i: 349437: 0bae2a4 349435: 3895644 349431: 2390852 349423: 5c42fe5 349407: e23d442 349375: 077951a 349311: a906671 349183: 6bc6df8
1 parent 53a853d commit 5ea090b

File tree

4 files changed

+24
-5
lines changed

4 files changed

+24
-5
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: 3574c513bbc5578dd9346b4ea9ab5995c5927bb5
3-
refs/heads/master-next: 37ceae2d22abb41a8af0d2a6d680d76e002d6608
3+
refs/heads/master-next: b025c3099de503660c74e8d9a19613f84564ee37
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/lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,10 +2141,7 @@ void IRGenDebugInfoImpl::emitVariableDeclaration(
21412141
IRBuilder &Builder, ArrayRef<llvm::Value *> Storage, DebugTypeInfo DbgTy,
21422142
const SILDebugScope *DS, ValueDecl *VarDecl, StringRef Name, unsigned ArgNo,
21432143
IndirectionKind Indirection, ArtificialKind Artificial) {
2144-
// FIXME: Make this an assertion.
2145-
// assert(DS && "variable has no scope");
2146-
if (!DS)
2147-
return;
2144+
assert(DS && "variable has no scope");
21482145

21492146
if (Opts.DebugInfoLevel <= IRGenDebugInfoLevel::LineTables)
21502147
return;

branches/master-next/lib/SILOptimizer/Transforms/SpecializeOpaqueArchetypes.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,21 @@ class OpaqueSpecializerCloner
256256
Inst->isInitializationOfDest()));
257257
}
258258

259+
SILValue remapResultType(SILLocation loc, SILValue val) {
260+
auto specializedTy = remapType(val->getType());
261+
if (val->getType() == specializedTy)
262+
return val;
263+
return createCast(loc, val, specializedTy);
264+
}
265+
266+
void visitThinToThickFunctionInst(ThinToThickFunctionInst *Inst) {
267+
getBuilder().setCurrentDebugScope(getOpScope(Inst->getDebugScope()));
268+
auto loc = getOpLocation(Inst->getLoc());
269+
auto opd = remapResultType(loc, getOpValue(Inst->getOperand()));
270+
recordClonedInstruction(Inst, getBuilder().createThinToThickFunction(
271+
loc, opd, getOpType(Inst->getType())));
272+
}
273+
259274
void visitStoreInst(StoreInst *Inst) {
260275
auto src = getOpValue(Inst->getSrc());
261276
auto dst = getOpValue(Inst->getDest());

branches/master-next/test/SILOptimizer/specialize_opaque_type_archetypes.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,3 +539,10 @@ struct Test : RandomAccessCollection {
539539
return foos[i.offset].p
540540
}
541541
}
542+
543+
@inline(never)
544+
func useAbstractFunction<T: P>(_ fn: (Int64) -> T) {}
545+
546+
public func testThinToThick() {
547+
useAbstractFunction(bar)
548+
}

0 commit comments

Comments
 (0)