[llc] Fix sanitizer failure.

Store the string on the stack rather than just the StringRef.

Fix sanitizer bots:

  http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/19948
  http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/5500

llvm-svn: 335423
This commit is contained in:
Jonas Devlieghere 2018-06-23 19:04:10 +00:00
parent 12728474b3
commit 77fa07264a
1 changed files with 1 additions and 1 deletions

View File

@ -504,7 +504,7 @@ static int compileModule(char **argv, LLVMContext &Context) {
// Verify module immediately to catch problems before doInitialization() is // Verify module immediately to catch problems before doInitialization() is
// called on any passes. // called on any passes.
if (!NoVerify && verifyModule(*M, &errs())) { if (!NoVerify && verifyModule(*M, &errs())) {
StringRef Prefix = std::string Prefix =
(Twine(argv[0]) + Twine(": ") + Twine(InputFilename)).str(); (Twine(argv[0]) + Twine(": ") + Twine(InputFilename)).str();
WithColor::error(errs(), Prefix) << "input module is broken!\n"; WithColor::error(errs(), Prefix) << "input module is broken!\n";
return 1; return 1;