Improve LLVM symbol name clash detection for classes
This commit is contained in:
committed by
SvyatoslavScherbina
parent
bcf1722ecd
commit
226a97bbf6
+6
-1
@@ -247,7 +247,12 @@ private class DeclarationsGeneratorVisitor(override val context: Context) :
|
|||||||
typeInfoGlobal.pointer.getElementPtr(0).llvm,
|
typeInfoGlobal.pointer.getElementPtr(0).llvm,
|
||||||
typeInfoSymbolName)!!
|
typeInfoSymbolName)!!
|
||||||
|
|
||||||
if (!descriptor.isExported()) {
|
if (descriptor.isExported()) {
|
||||||
|
if (llvmTypeInfoPtr.name != typeInfoSymbolName) {
|
||||||
|
// So alias name has been mangled by LLVM to avoid name clash.
|
||||||
|
throw IllegalArgumentException("Global '$typeInfoSymbolName' already exists")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
LLVMSetLinkage(llvmTypeInfoPtr, LLVMLinkage.LLVMInternalLinkage)
|
LLVMSetLinkage(llvmTypeInfoPtr, LLVMLinkage.LLVMInternalLinkage)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user