Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit 56a3c30

Browse files
committed
Merge pull request #218 from pcc/mangling
Replace '.' character with '_' in package path mangling
2 parents 2bd840d + 157b3d3 commit 56a3c30

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

irgen/typemap.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,9 @@ func (ctx *manglerContext) mangleSignature(s *types.Signature, recv *types.Var,
483483
}
484484

485485
func (ctx *manglerContext) manglePackagePath(pkgpath string, b *bytes.Buffer) {
486-
b.WriteString(strings.Replace(pkgpath, "/", "_", -1))
486+
pkgpath = strings.Replace(pkgpath, "/", "_", -1)
487+
pkgpath = strings.Replace(pkgpath, ".", "_", -1)
488+
b.WriteString(pkgpath)
487489
}
488490

489491
func (ctx *manglerContext) mangleType(t types.Type, b *bytes.Buffer) {

test/irgen/mangling.go

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// RUN: llgo -fgo-pkgpath=llvm.org/llvm -S -emit-llvm -o - %s | FileCheck %s
2+
3+
package llvm
4+
5+
// CHECK: @llvm_org_llvm.F
6+
func F() {
7+
}

0 commit comments

Comments
 (0)