summaryrefslogtreecommitdiff
path: root/source/slang/slang-serialize-factory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-serialize-factory.cpp')
-rw-r--r--source/slang/slang-serialize-factory.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/source/slang/slang-serialize-factory.cpp b/source/slang/slang-serialize-factory.cpp
index 2bb7b047e..f93fbba69 100644
--- a/source/slang/slang-serialize-factory.cpp
+++ b/source/slang/slang-serialize-factory.cpp
@@ -73,18 +73,11 @@ SerialIndex ModuleSerialFilter::writePointer(SerialWriter* writer, const NodeBas
{
ASTBuilder* astBuilder = m_moduleDecl->module->getASTBuilder();
- // It's a reference to a declaration in another module, so create an ImportExternalDecl.
-
+ // It's a reference to a declaration in another module, so first get the symbol name.
String mangledName = getMangledName(astBuilder, decl);
- ImportExternalDecl* importDecl = astBuilder->create<ImportExternalDecl>();
- importDecl->mangledName = mangledName;
- const SerialIndex index = writer->addPointer(importDecl);
-
- // Set as the index of this
- writer->setPointerIndex(ptr, index);
-
- return index;
+ // Add as an import symbol
+ return writer->addImportSymbol(mangledName);
}
else
{