Remove unnecessary calls to unique_ptr::get.

llvm-svn: 224105
This commit is contained in:
Craig Topper 2014-12-12 07:52:09 +00:00
parent 0d114c5450
commit e2f17f0a1c
1 changed files with 7 additions and 7 deletions

View File

@ -340,7 +340,7 @@ int main(int argc, char **argv) {
// Load the input module... // Load the input module...
std::unique_ptr<Module> M = parseIRFile(InputFilename, Err, Context); std::unique_ptr<Module> M = parseIRFile(InputFilename, Err, Context);
if (!M.get()) { if (!M) {
Err.print(argv[0], errs()); Err.print(argv[0], errs());
return 1; 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 // 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 // string. Hand off the rest of the functionality to the new code for that
// layer. // layer.
return runPassPipeline(argv[0], Context, *M.get(), Out.get(), PassPipeline, return runPassPipeline(argv[0], Context, *M, Out.get(), PassPipeline,
OK, VK) OK, VK)
? 0 ? 0
: 1; : 1;
@ -409,10 +409,10 @@ int main(int argc, char **argv) {
Passes.add(TLI); Passes.add(TLI);
// Add an appropriate DataLayout instance for this module. // Add an appropriate DataLayout instance for this module.
const DataLayout *DL = M.get()->getDataLayout(); const DataLayout *DL = M->getDataLayout();
if (!DL && !DefaultDataLayout.empty()) { if (!DL && !DefaultDataLayout.empty()) {
M->setDataLayout(DefaultDataLayout); M->setDataLayout(DefaultDataLayout);
DL = M.get()->getDataLayout(); DL = M->getDataLayout();
} }
if (DL) if (DL)
@ -425,7 +425,7 @@ int main(int argc, char **argv) {
std::unique_ptr<TargetMachine> TM(Machine); std::unique_ptr<TargetMachine> TM(Machine);
// Add internal analysis passes from the target machine. // Add internal analysis passes from the target machine.
if (TM.get()) if (TM)
TM->addAnalysisPasses(Passes); TM->addAnalysisPasses(Passes);
std::unique_ptr<FunctionPassManager> FPasses; std::unique_ptr<FunctionPassManager> FPasses;
@ -433,7 +433,7 @@ int main(int argc, char **argv) {
FPasses.reset(new FunctionPassManager(M.get())); FPasses.reset(new FunctionPassManager(M.get()));
if (DL) if (DL)
FPasses->add(new DataLayoutPass()); FPasses->add(new DataLayoutPass());
if (TM.get()) if (TM)
TM->addAnalysisPasses(*FPasses); TM->addAnalysisPasses(*FPasses);
} }
@ -578,7 +578,7 @@ int main(int argc, char **argv) {
cl::PrintOptionValues(); cl::PrintOptionValues();
// Now that we have all of the passes ready, run them. // Now that we have all of the passes ready, run them.
Passes.run(*M.get()); Passes.run(*M);
// Declare success. // Declare success.
if (!NoOutput || PrintBreakpoints) if (!NoOutput || PrintBreakpoints)