From 56440fd8203f581b9aded68db3631ea11a72ccf2 Mon Sep 17 00:00:00 2001 From: Ahmed Charles Date: Thu, 6 Mar 2014 05:51:42 +0000 Subject: Replace OwningPtr with std::unique_ptr. This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083 --- llvm/tools/opt/opt.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/tools/opt/opt.cpp') diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp index 1501bde219c..14a40a4af76 100644 --- a/llvm/tools/opt/opt.cpp +++ b/llvm/tools/opt/opt.cpp @@ -356,7 +356,7 @@ int main(int argc, char **argv) { SMDiagnostic Err; // Load the input module... - OwningPtr M; + std::unique_ptr M; M.reset(ParseIRFile(InputFilename, Err, Context)); if (M.get() == 0) { @@ -369,7 +369,7 @@ int main(int argc, char **argv) { M->setTargetTriple(Triple::normalize(TargetTriple)); // Figure out what stream we are supposed to write to... - OwningPtr Out; + std::unique_ptr Out; if (NoOutput) { if (!OutputFilename.empty()) errs() << "WARNING: The -o (output filename) option is ignored when\n" @@ -442,13 +442,13 @@ int main(int argc, char **argv) { TargetMachine *Machine = 0; if (ModuleTriple.getArch()) Machine = GetTargetMachine(Triple(ModuleTriple)); - OwningPtr TM(Machine); + std::unique_ptr TM(Machine); // Add internal analysis passes from the target machine. if (TM.get()) TM->addAnalysisPasses(Passes); - OwningPtr FPasses; + std::unique_ptr FPasses; if (OptLevelO1 || OptLevelO2 || OptLevelOs || OptLevelOz || OptLevelO3) { FPasses.reset(new FunctionPassManager(M.get())); if (DL) -- cgit v1.2.3