diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-11-20 22:47:55 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-11-20 22:47:55 +0000 |
commit | 20be8c4551d49fe66835baf1200be85ac2fd0c86 (patch) | |
tree | d5811191929d37db14cf41318f8d151620fa7707 /tools/driver/cc1_main.cpp | |
parent | fc97102a80bfe0afaa25883a2aa6b5e1d7307d0a (diff) |
Switch CompilerInvocation::CreateFromArgs to take const char** arguments until Driver itself switches to StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89503 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/driver/cc1_main.cpp')
-rw-r--r-- | tools/driver/cc1_main.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/driver/cc1_main.cpp b/tools/driver/cc1_main.cpp index a0bd492a10..93adf579f9 100644 --- a/tools/driver/cc1_main.cpp +++ b/tools/driver/cc1_main.cpp @@ -51,18 +51,17 @@ int cc1_main(Diagnostic &Diags, const char **ArgBegin, const char **ArgEnd) { // Create a compiler invocation. llvm::errs() << "cc1 creating invocation.\n"; CompilerInvocation Invocation; - CompilerInvocation::CreateFromArgs(Invocation, - llvm::SmallVector<llvm::StringRef, 32>(ArgBegin, ArgEnd)); + CompilerInvocation::CreateFromArgs(Invocation, ArgBegin, ArgEnd); // Convert the invocation back to argument strings. std::vector<std::string> InvocationArgs; Invocation.toArgs(InvocationArgs); // Dump the converted arguments. - llvm::SmallVector<llvm::StringRef, 32> Invocation2Args; + llvm::SmallVector<const char*, 32> Invocation2Args; llvm::errs() << "invocation argv :"; for (unsigned i = 0, e = InvocationArgs.size(); i != e; ++i) { - Invocation2Args.push_back(InvocationArgs[i]); + Invocation2Args.push_back(InvocationArgs[i].c_str()); llvm::errs() << " \"" << InvocationArgs[i] << '"'; } llvm::errs() << "\n"; @@ -70,7 +69,8 @@ int cc1_main(Diagnostic &Diags, const char **ArgBegin, const char **ArgEnd) { // Convert those arguments to another invocation, and check that we got the // same thing. CompilerInvocation Invocation2; - CompilerInvocation::CreateFromArgs(Invocation2, Invocation2Args); + CompilerInvocation::CreateFromArgs(Invocation2, Invocation2Args.begin(), + Invocation2Args.end()); // FIXME: Implement CompilerInvocation comparison. if (true) { |