Skip to content

[IRGen] Fix lifetime extension issue with StringRef. #5393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/IRGen/IRGenDebugInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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.
Expand Down