From e2f17f0a1cba634a627bbf666920c8d74d0bfaa1 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Fri, 12 Dec 2014 07:52:09 +0000 Subject: [PATCH] Remove unnecessary calls to unique_ptr::get. llvm-svn: 224105 --- llvm/tools/opt/opt.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp index 831018d0abd0..39e8946dd559 100644 --- a/llvm/tools/opt/opt.cpp +++ b/llvm/tools/opt/opt.cpp @@ -340,7 +340,7 @@ int main(int argc, char **argv) { // Load the input module... std::unique_ptr M = parseIRFile(InputFilename, Err, Context); - if (!M.get()) { + if (!M) { Err.print(argv[0], errs()); return 1; } @@ -389,7 +389,7 @@ int main(int argc, char **argv) { // The user has asked to use the new pass manager and provided a pipeline // string. Hand off the rest of the functionality to the new code for that // layer. - return runPassPipeline(argv[0], Context, *M.get(), Out.get(), PassPipeline, + return runPassPipeline(argv[0], Context, *M, Out.get(), PassPipeline, OK, VK) ? 0 : 1; @@ -409,10 +409,10 @@ int main(int argc, char **argv) { Passes.add(TLI); // Add an appropriate DataLayout instance for this module. - const DataLayout *DL = M.get()->getDataLayout(); + const DataLayout *DL = M->getDataLayout(); if (!DL && !DefaultDataLayout.empty()) { M->setDataLayout(DefaultDataLayout); - DL = M.get()->getDataLayout(); + DL = M->getDataLayout(); } if (DL) @@ -425,7 +425,7 @@ int main(int argc, char **argv) { std::unique_ptr TM(Machine); // Add internal analysis passes from the target machine. - if (TM.get()) + if (TM) TM->addAnalysisPasses(Passes); std::unique_ptr FPasses; @@ -433,7 +433,7 @@ int main(int argc, char **argv) { FPasses.reset(new FunctionPassManager(M.get())); if (DL) FPasses->add(new DataLayoutPass()); - if (TM.get()) + if (TM) TM->addAnalysisPasses(*FPasses); } @@ -578,7 +578,7 @@ int main(int argc, char **argv) { cl::PrintOptionValues(); // Now that we have all of the passes ready, run them. - Passes.run(*M.get()); + Passes.run(*M); // Declare success. if (!NoOutput || PrintBreakpoints)