summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Grasman <kim.grasman@gmail.com>2019-10-24 21:25:47 +0200
committerKim Grasman <kim.grasman@gmail.com>2019-10-24 21:47:52 +0200
commit232795ba513c5d04ec500e59ca378dd69c02d8d8 (patch)
treea31c1d78495a46c0a46232e08ae5e88a9e9a3961
parentdcc47ba62a7c1aed97cd8725a6de8892ea15d24b (diff)
Revert "Clang r370122: ArrayRef in CompilerInvocation::CreateFromArgs"
This reverts commit b8edb821f252799b5584ed048caec5480de0244e. This breaking change happened after the branch point for Clang 9.
-rw-r--r--iwyu_driver.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/iwyu_driver.cc b/iwyu_driver.cc
index bd16314..eaeba46 100644
--- a/iwyu_driver.cc
+++ b/iwyu_driver.cc
@@ -205,8 +205,11 @@ CompilerInstance* CreateCompilerInstance(int argc, const char **argv) {
// Initialize a compiler invocation object from the clang (-cc1) arguments.
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();
std::shared_ptr<CompilerInvocation> invocation(new CompilerInvocation);
- CompilerInvocation::CreateFromArgs(*invocation, cc_arguments, diagnostics);
+ CompilerInvocation::CreateFromArgs(*invocation,
+ args_start, args_end, diagnostics);
invocation->getFrontendOpts().DisableFree = false;
// Use libc++ headers bundled with Xcode.app on macOS.