[cfe-dev] clang: doing without argv, argv + argc, hard wire?

Paul Griffiths gafferuk at gmail.com
Wed Aug 18 15:02:32 PDT 2010


im using clang, and my project is based on interpreter example. I
don't want to supply the c-code file path from the command line, so
don't want to use argv, argv + argc.

in the interpreter example the line:

llvm::sys::Path Path = GetExecutablePath(argv[0]);

I presume I can hard wire that to for example :

llvm::sys::Path Path = GetExecutablePath("MyFile.c");

but, what do I do for:

llvm::SmallVector<const char *, 16> Args(argv, argv + argc);
  Args.push_back("-fsyntax-only");
  llvm::OwningPtr<Compilation> C(TheDriver.BuildCompilation(Args.size(),
                                                            Args.data()));

Can I do without argv, argv + argc? can I hard wire these too?

Any ideas?



More information about the cfe-dev mailing list