Skip to content

Commit 53f859c

Browse files
committed
---
yaml --- r: 318959 b: refs/heads/master-rebranch c: 9b1e760 h: refs/heads/master i: 318957: f7b5d80 318955: fdc4896 318951: 80a001a 318943: 85b9a5e
1 parent 6db4029 commit 53f859c

File tree

6 files changed

+27
-25
lines changed

6 files changed

+27
-25
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1457,4 +1457,4 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-02-a: ddd2b2976aa9bfde5f20fe37f6bd2
14571457
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-03-a: 171cc166f2abeb5ca2a4003700a8a78a108bd300
14581458
refs/heads/benlangmuir-patch-1: baaebaf39d52f3bf36710d4fe40cf212e996b212
14591459
refs/heads/i-do-redeclare: 8c4e6d5de5c1e3f0a2cedccf319df713ea22c48e
1460-
refs/heads/master-rebranch: 71ffa2251536a7663cad3854a298a3f4a556205c
1460+
refs/heads/master-rebranch: 9b1e760db4f6d6eb825fd3c6624a848c452070ae

branches/master-rebranch/lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,22 +637,25 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
637637
if (Val != DIModuleCache.end())
638638
return cast<llvm::DIModule>(Val->second);
639639

640+
std::string RemappedIncludePath = DebugPrefixMap.remapPath(IncludePath);
641+
640642
// For Clang modules / PCH, create a Skeleton CU pointing to the PCM/PCH.
641643
bool CreateSkeletonCU = !ASTFile.empty();
642644
bool IsRootModule = !Parent;
643645
if (CreateSkeletonCU && IsRootModule) {
644646
llvm::DIBuilder DIB(M);
645647
DIB.createCompileUnit(IGM.ObjCInterop ? llvm::dwarf::DW_LANG_ObjC
646648
: llvm::dwarf::DW_LANG_C99,
647-
DIB.createFile(Name, IncludePath),
649+
DIB.createFile(Name, RemappedIncludePath),
648650
TheCU->getProducer(), true, StringRef(), 0, ASTFile,
649651
llvm::DICompileUnit::FullDebug, Signature);
650652
DIB.finalize();
651653
}
652654

653655
StringRef Sysroot = IGM.Context.SearchPathOpts.SDKPath;
654656
llvm::DIModule *M =
655-
DBuilder.createModule(Parent, Name, ConfigMacros, IncludePath, Sysroot);
657+
DBuilder.createModule(Parent, Name, ConfigMacros, RemappedIncludePath,
658+
Sysroot);
656659
DIModuleCache.insert({Key, llvm::TrackingMDNodeRef(M)});
657660
return M;
658661
}

branches/master-rebranch/stdlib/public/Darwin/Foundation/NSDictionary.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ extension Dictionary : _ObjectiveCBridgeable {
238238
let handleDuplicates = (Key.self == String.self)
239239

240240
result = Dictionary(_unsafeUninitializedCapacity: numElems,
241-
allowingDuplicates: handleDuplicates) { (keys, vals, outCount) in
241+
allowingDuplicates: handleDuplicates) { keys, vals in
242242

243243
let objectKeys = UnsafeMutableRawPointer(mutating:
244244
keys.baseAddress!).assumingMemoryBound(to: AnyObject.self)
@@ -253,7 +253,7 @@ extension Dictionary : _ObjectiveCBridgeable {
253253
_forceBridge(objectKeys, count: numElems, to: Key.self)
254254
_forceBridge(objectVals, count: numElems, to: Value.self)
255255

256-
outCount = numElems
256+
return numElems
257257
}
258258
}
259259
}
@@ -293,7 +293,7 @@ extension Dictionary : _ObjectiveCBridgeable {
293293
let handleDuplicates = (Key.self == String.self)
294294

295295
let tmpResult = Dictionary(_unsafeUninitializedCapacity: numElems,
296-
allowingDuplicates: handleDuplicates) { (keys, vals, outCount) in
296+
allowingDuplicates: handleDuplicates) { keys, vals in
297297

298298
let objectKeys = UnsafeMutableRawPointer(mutating:
299299
keys.baseAddress!).assumingMemoryBound(to: AnyObject.self)
@@ -314,7 +314,7 @@ extension Dictionary : _ObjectiveCBridgeable {
314314
Key.self)).deinitialize(count: numElems)
315315
}
316316
}
317-
outCount = success ? numElems : 0
317+
return success ? numElems : 0
318318
}
319319

320320
result = success ? tmpResult : nil

branches/master-rebranch/stdlib/public/core/DictionaryBuilder.swift

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,14 @@ extension Dictionary {
7272
/// closure must return the count of the initialized elements, starting at
7373
/// the beginning of the buffer.
7474
@_alwaysEmitIntoClient // Introduced in 5.1
75-
@inlinable
7675
public // SPI(Foundation)
7776
init(
7877
_unsafeUninitializedCapacity capacity: Int,
7978
allowingDuplicates: Bool,
8079
initializingWith initializer: (
8180
_ keys: UnsafeMutableBufferPointer<Key>,
82-
_ values: UnsafeMutableBufferPointer<Value>,
83-
_ initializedCount: inout Int
84-
) -> Void
81+
_ values: UnsafeMutableBufferPointer<Value>
82+
) -> Int
8583
) {
8684
self.init(_native: _NativeDictionary(
8785
_unsafeUninitializedCapacity: capacity,
@@ -92,23 +90,19 @@ extension Dictionary {
9290

9391
extension _NativeDictionary {
9492
@_alwaysEmitIntoClient // Introduced in 5.1
95-
@inlinable
9693
internal init(
9794
_unsafeUninitializedCapacity capacity: Int,
9895
allowingDuplicates: Bool,
9996
initializingWith initializer: (
10097
_ keys: UnsafeMutableBufferPointer<Key>,
101-
_ values: UnsafeMutableBufferPointer<Value>,
102-
_ initializedCount: inout Int
103-
) -> Void
98+
_ values: UnsafeMutableBufferPointer<Value>
99+
) -> Int
104100
) {
105101
self.init(capacity: capacity)
106-
var initializedCount = 0
107-
initializer(
102+
let initializedCount = initializer(
108103
UnsafeMutableBufferPointer(start: _keys, count: capacity),
109-
UnsafeMutableBufferPointer(start: _values, count: capacity),
110-
&initializedCount)
111-
_precondition(count >= 0 && count <= capacity)
104+
UnsafeMutableBufferPointer(start: _values, count: capacity))
105+
_precondition(initializedCount >= 0 && initializedCount <= capacity)
112106
_storage._count = initializedCount
113107

114108
// Hash initialized elements and move each of them into their correct
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
// RUN: %swiftc_driver -g -debug-prefix-map %/S=/var/empty %/s -emit-ir -o - | %FileCheck %s
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-frontend -emit-module-path %t/Globals.swiftmodule %S/Globals.swift
3+
// RUN: %target-swiftc_driver -g -debug-prefix-map %/S=/var/empty -debug-prefix-map %t=/var/empty %/s -I %t -emit-ir -o - | %FileCheck %s
4+
5+
import Globals
26

37
func square(_ n: Int) -> Int {
48
return n * n
59
}
610

711
// CHECK: !DIFile(filename: "/var/empty/debug_prefix_map.swift"
12+
// CHECK: !DIModule(scope: null, name: "Globals", includePath: "/var/empty/Globals.swiftmodule"

branches/master-rebranch/validation-test/stdlib/Dictionary.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5700,14 +5700,14 @@ DictionaryTestSuite.test("BulkLoadingInitializer.Unique") {
57005700
let d1 = Dictionary<TestKeyTy, TestEquatableValueTy>(
57015701
_unsafeUninitializedCapacity: c,
57025702
allowingDuplicates: false
5703-
) { keys, values, count in
5703+
) { keys, values in
57045704
let k = keys.baseAddress!
57055705
let v = values.baseAddress!
57065706
for i in 0 ..< c {
57075707
(k + i).initialize(to: TestKeyTy(i))
57085708
(v + i).initialize(to: TestEquatableValueTy(i))
5709-
count += 1
57105709
}
5710+
return c
57115711
}
57125712

57135713
let d2 = Dictionary(
@@ -5727,14 +5727,14 @@ DictionaryTestSuite.test("BulkLoadingInitializer.Nonunique") {
57275727
let d1 = Dictionary<TestKeyTy, TestEquatableValueTy>(
57285728
_unsafeUninitializedCapacity: c,
57295729
allowingDuplicates: true
5730-
) { keys, values, count in
5730+
) { keys, values in
57315731
let k = keys.baseAddress!
57325732
let v = values.baseAddress!
57335733
for i in 0 ..< c {
57345734
(k + i).initialize(to: TestKeyTy(i / 2))
57355735
(v + i).initialize(to: TestEquatableValueTy(i / 2))
5736-
count += 1
57375736
}
5737+
return c
57385738
}
57395739

57405740
let d2 = Dictionary(

0 commit comments

Comments
 (0)