From 197871d5322f6a294d58bfa54c25772808170fbb Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sun, 17 Apr 2016 18:56:49 +0000 Subject: Fix a use after move. llvm-svn: 266566 --- llvm/tools/gold/gold-plugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/tools') diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp index a93fc930d58..bb146afe92f 100644 --- a/llvm/tools/gold/gold-plugin.cpp +++ b/llvm/tools/gold/gold-plugin.cpp @@ -880,6 +880,7 @@ public: private: const Target *TheTarget; + std::string TripleStr; std::string FeaturesString; TargetOptions Options; @@ -923,7 +924,7 @@ static CodeGenOpt::Level getCGOptLevel() { } void CodeGen::initTargetMachine() { - const std::string &TripleStr = M->getTargetTriple(); + TripleStr = M->getTargetTriple(); Triple TheTriple(TripleStr); std::string ErrMsg; @@ -939,7 +940,6 @@ void CodeGen::initTargetMachine() { } std::unique_ptr CodeGen::createTargetMachine() { - const std::string &TripleStr = M->getTargetTriple(); CodeGenOpt::Level CGOptLevel = getCGOptLevel(); return std::unique_ptr(TheTarget->createTargetMachine( -- cgit v1.2.3