Remove a temporary variable and just construct a unique_ptr directly using make_unique.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217655 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper 2014-09-12 05:17:20 +00:00
parent ddf2ec4d4b
commit 275458e7da

View File

@ -304,14 +304,12 @@ public:
setAvailableFeatures(ComputeAvailableFeatures(STI.getFeatureBits()));
// Remember the initial assembler options. The user can not modify these.
MipsAssemblerOptions *TmpAOPtr =
new MipsAssemblerOptions(getAvailableFeatures());
AssemblerOptions.push_back(std::unique_ptr<MipsAssemblerOptions>(TmpAOPtr));
AssemblerOptions.push_back(
make_unique<MipsAssemblerOptions>(getAvailableFeatures()));
// Create an assembler options environment for the user to modify.
TmpAOPtr = new MipsAssemblerOptions(getAvailableFeatures());
AssemblerOptions.push_back(std::unique_ptr<MipsAssemblerOptions>(TmpAOPtr));
TmpAOPtr = nullptr;
AssemblerOptions.push_back(
make_unique<MipsAssemblerOptions>(getAvailableFeatures()));
getTargetStreamer().updateABIInfo(*this);
@ -2700,9 +2698,8 @@ bool MipsAsmParser::parseSetPushDirective() {
return reportParseError("unexpected token, expected end of statement");
// Create a copy of the current assembler options environment and push it.
MipsAssemblerOptions *TmpAOPtr =
new MipsAssemblerOptions(AssemblerOptions.back().get());
AssemblerOptions.push_back(std::unique_ptr<MipsAssemblerOptions>(TmpAOPtr));
AssemblerOptions.push_back(
make_unique<MipsAssemblerOptions>(AssemblerOptions.back().get()));
getTargetStreamer().emitDirectiveSetPush();
return false;