[llvm] r266566 - Fix a use after move.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 17 11:56:50 PDT 2016
Author: rafael
Date: Sun Apr 17 13:56:49 2016
New Revision: 266566
URL: http://llvm.org/viewvc/llvm-project?rev=266566&view=rev
Log:
Fix a use after move.
Modified:
llvm/trunk/tools/gold/gold-plugin.cpp
Modified: llvm/trunk/tools/gold/gold-plugin.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=266566&r1=266565&r2=266566&view=diff
==============================================================================
--- llvm/trunk/tools/gold/gold-plugin.cpp (original)
+++ llvm/trunk/tools/gold/gold-plugin.cpp Sun Apr 17 13:56:49 2016
@@ -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<TargetMachine> CodeGen::createTargetMachine() {
- const std::string &TripleStr = M->getTargetTriple();
CodeGenOpt::Level CGOptLevel = getCGOptLevel();
return std::unique_ptr<TargetMachine>(TheTarget->createTargetMachine(
More information about the llvm-commits
mailing list