diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index d6d04500477e9..505289c8e6200 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -1479,6 +1479,7 @@ llvm::DIType *IRGenDebugInfo::createType(DebugTypeInfo DbgTy, // Use "__ObjC" as default for implicit decls. // FIXME: Do something more clever based on the decl's mangled name. + std::string FullModuleNameBuffer; StringRef ModulePath; StringRef ModuleName = "__ObjC"; if (auto *OwningModule = ClangDecl->getImportedOwningModule()) @@ -1488,7 +1489,8 @@ llvm::DIType *IRGenDebugInfo::createType(DebugTypeInfo DbgTy, if (auto *ClangModule = SwiftModule->findUnderlyingClangModule()) { // FIXME: Clang submodules are not handled here. // FIXME: Clang module config macros are not handled here. - ModuleName = ClangModule->getFullModuleName(); + FullModuleNameBuffer = ClangModule->getFullModuleName(); + ModuleName = FullModuleNameBuffer; // FIXME: A clang module's Directory is supposed to be the // directory containing the module map, but ClangImporter // sets it to the module cache directory.