$OpenBSD: patch-iwyu_driver_cc,v 1.1 2017/02/10 09:39:21 ajacoutot Exp $

Update to reflect changes in Clang

r291184 switched the CompilerInvocation argument to a shared_ptr.

--- iwyu_driver.cc.orig	Sat Jan 14 19:49:43 2017
+++ iwyu_driver.cc	Sat Jan 14 19:50:21 2017
@@ -207,7 +207,7 @@ CompilerInstance* CreateCompilerInstance(int argc, con
   const ArgStringList &cc_arguments = command.getArguments();
   const char** args_start = const_cast<const char**>(cc_arguments.data());
   const char** args_end = args_start + cc_arguments.size();
-  unique_ptr<CompilerInvocation> invocation(new CompilerInvocation);
+  std::shared_ptr<CompilerInvocation> invocation(new CompilerInvocation);
   CompilerInvocation::CreateFromArgs(*invocation,
                                      args_start, args_end, diagnostics);
   invocation->getFrontendOpts().DisableFree = false;
@@ -238,7 +238,7 @@ CompilerInstance* CreateCompilerInstance(int argc, con
   // Create a compiler instance to handle the actual work.
   // The caller will be responsible for freeing this.
   CompilerInstance* compiler = new CompilerInstance;
-  compiler->setInvocation(invocation.release());
+  compiler->setInvocation(invocation);
 
   // Create the compilers actual diagnostics engine.
   compiler->createDiagnostics();
