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

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


Too be honist I would like to supply the c code to be called by the
JIT in a char array or std::string.
Has anyone any code?

On 18 August 2010 22:02, Paul Griffiths <gafferuk at gmail.com> wrote:
> 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