forked from OSchip/llvm-project
Remove a temporary variable and just construct a unique_ptr directly using make_unique.
llvm-svn: 217655
This commit is contained in:
parent
d59becbc07
commit
fec61ef391
|
|
@ -304,14 +304,12 @@ public:
|
||||||
setAvailableFeatures(ComputeAvailableFeatures(STI.getFeatureBits()));
|
setAvailableFeatures(ComputeAvailableFeatures(STI.getFeatureBits()));
|
||||||
|
|
||||||
// Remember the initial assembler options. The user can not modify these.
|
// Remember the initial assembler options. The user can not modify these.
|
||||||
MipsAssemblerOptions *TmpAOPtr =
|
AssemblerOptions.push_back(
|
||||||
new MipsAssemblerOptions(getAvailableFeatures());
|
make_unique<MipsAssemblerOptions>(getAvailableFeatures()));
|
||||||
AssemblerOptions.push_back(std::unique_ptr<MipsAssemblerOptions>(TmpAOPtr));
|
|
||||||
|
|
||||||
// Create an assembler options environment for the user to modify.
|
// Create an assembler options environment for the user to modify.
|
||||||
TmpAOPtr = new MipsAssemblerOptions(getAvailableFeatures());
|
AssemblerOptions.push_back(
|
||||||
AssemblerOptions.push_back(std::unique_ptr<MipsAssemblerOptions>(TmpAOPtr));
|
make_unique<MipsAssemblerOptions>(getAvailableFeatures()));
|
||||||
TmpAOPtr = nullptr;
|
|
||||||
|
|
||||||
getTargetStreamer().updateABIInfo(*this);
|
getTargetStreamer().updateABIInfo(*this);
|
||||||
|
|
||||||
|
|
@ -2700,9 +2698,8 @@ bool MipsAsmParser::parseSetPushDirective() {
|
||||||
return reportParseError("unexpected token, expected end of statement");
|
return reportParseError("unexpected token, expected end of statement");
|
||||||
|
|
||||||
// Create a copy of the current assembler options environment and push it.
|
// Create a copy of the current assembler options environment and push it.
|
||||||
MipsAssemblerOptions *TmpAOPtr =
|
AssemblerOptions.push_back(
|
||||||
new MipsAssemblerOptions(AssemblerOptions.back().get());
|
make_unique<MipsAssemblerOptions>(AssemblerOptions.back().get()));
|
||||||
AssemblerOptions.push_back(std::unique_ptr<MipsAssemblerOptions>(TmpAOPtr));
|
|
||||||
|
|
||||||
getTargetStreamer().emitDirectiveSetPush();
|
getTargetStreamer().emitDirectiveSetPush();
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue