diff --git a/include/llvm/MC/MCContext.h b/include/llvm/MC/MCContext.h index 08ece2b4c48..b3df2252109 100644 --- a/include/llvm/MC/MCContext.h +++ b/include/llvm/MC/MCContext.h @@ -292,7 +292,7 @@ namespace llvm { const std::string &getMainFileName() const { return MainFileName; } /// \brief Set the main file name and override the default. - void setMainFileName(StringRef S) { MainFileName = S.str(); } + void setMainFileName(StringRef S) { MainFileName = S; } /// GetDwarfFile - creates an entry in the dwarf file and directory tables. unsigned GetDwarfFile(StringRef Directory, StringRef FileName,