summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCDwarf.cpp
diff options
context:
space:
mode:
authorPaul Robinson <paul.robinson@sony.com>2018-06-20 17:08:46 +0000
committerPaul Robinson <paul.robinson@sony.com>2018-06-20 17:08:46 +0000
commit8e3e374e5f72d7a89a0903b0d1c8fbd18b2b8f9d (patch)
treea5fdd199c481f8b6e318fd0a15db769e54e7abc1 /llvm/lib/MC/MCDwarf.cpp
parent34b91122166186669bd52abaf04c1b294055b8a7 (diff)
downloadbcm5719-llvm-8e3e374e5f72d7a89a0903b0d1c8fbd18b2b8f9d.tar.gz
bcm5719-llvm-8e3e374e5f72d7a89a0903b0d1c8fbd18b2b8f9d.zip
[DWARF] Don't keep a ref to possibly stack allocated data.
llvm-svn: 335146
Diffstat (limited to 'llvm/lib/MC/MCDwarf.cpp')
-rw-r--r--llvm/lib/MC/MCDwarf.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index e7c805da9a9..37e1263be65 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -389,8 +389,8 @@ void MCDwarfLineTableHeader::emitV5FileDirTables(
: dwarf::DW_FORM_string);
MCOS->EmitULEB128IntValue(MCDwarfDirs.size() + 1);
// Try not to emit an empty compilation directory.
- const StringRef &CompDir =
- CompilationDir.empty() ? CtxCompilationDir : CompilationDir;
+ const StringRef CompDir =
+ CompilationDir.empty() ? CtxCompilationDir : StringRef(CompilationDir);
if (LineStr) {
// Record path strings, emit references here.
LineStr->emitRef(MCOS, CompDir);
OpenPOWER on IntegriCloud