Skip to content

Commit a3b2bb1

Browse files
authored
Merge pull request #19726 from adrian-prantl/43439465
2 parents 6e0d1d3 + 0b32799 commit a3b2bb1

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
361361
StringRef File = llvm::sys::path::filename(Filename);
362362
llvm::SmallString<512> Path(Filename);
363363
llvm::sys::path::remove_filename(Path);
364+
llvm::sys::path::remove_dots(Path);
364365
llvm::DIFile *F = DBuilder.createFile(DebugPrefixMap.remapPath(File),
365366
DebugPrefixMap.remapPath(Path));
366367

test/DebugInfo/ClangPathDots.swift

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// REQUIRES: objc_interop
2+
// RUN: rm -rf %t.cache
3+
// RUN: %target-swift-frontend -emit-ir %s -g -I %S/Inputs -o - \
4+
// RUN: -module-cache-path %t.cache | %FileCheck %s --check-prefix=FIRST
5+
// RUN: %target-swift-frontend -emit-ir %s -g -I %S/Inputs -o - \
6+
// RUN: -module-cache-path %t.cache | %FileCheck %s --check-prefix=CACHED
7+
8+
// FIRST: !DIFile(filename: "NSObject.h", directory: {{.*}}/include/objc")
9+
// CACHED: !DIFile(filename: "NSObject.h", directory: {{.*}}/include/objc")
10+
11+
import ObjectiveC
12+
13+
extension NSObject : CVarArg {
14+
/// Transform `self` into a series of machine words that can be
15+
/// appropriately interpreted by C varargs
16+
public var _cVarArgEncoding: [Int] {
17+
_autorelease(self)
18+
return _encodeBitsAsWords(self)
19+
}
20+
}
21+

0 commit comments

Comments
 (0)