From b3375cba7938e01895bb504e7e48ad94a2e07dd1 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Tue, 17 Nov 2009 06:02:29 +0000 Subject: Add initial cut at CompilerInvocation::toArgs, which "serializes" the CompilerInvocation into a list of arguments which can be passed to clang-cc (eventually, clang -cc1). - Unfortunately, this is currently a tedious and manual translation. Eventually it would be nice to automatically generate this code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89049 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Frontend/CompilerInvocation.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'include/clang/Frontend/CompilerInvocation.h') diff --git a/include/clang/Frontend/CompilerInvocation.h b/include/clang/Frontend/CompilerInvocation.h index 33234ec898..9d068c523c 100644 --- a/include/clang/Frontend/CompilerInvocation.h +++ b/include/clang/Frontend/CompilerInvocation.h @@ -20,8 +20,14 @@ #include "clang/Frontend/HeaderSearchOptions.h" #include "clang/Frontend/PreprocessorOptions.h" #include "clang/Frontend/PreprocessorOutputOptions.h" +#include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringMap.h" #include +#include + +namespace llvm { + template class SmallVectorImpl; +} namespace clang { @@ -65,6 +71,23 @@ class CompilerInvocation { public: CompilerInvocation() {} + /// @name Utility Methods + /// @{ + + /// CreateFromArgs - Create a compiler invocation from a list of input + /// options. + /// + /// FIXME: Documenting error behavior. + /// + /// \param Res [out] - The resulting invocation. + /// \param Args - The input argument strings. + static void CreateFromArgs(CompilerInvocation &Res, + const llvm::SmallVectorImpl &Args); + + /// toArgs - Convert the CompilerInvocation to a list of strings suitable for + /// passing to CreateFromArgs. + void toArgs(std::vector &Res); + /// @} /// @name Option Subgroups /// @{ -- cgit v1.2.3-18-g5258