diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
commit | 9092c3e0fa01f3139b016d05d267a89e3b07747a (patch) | |
tree | 137ebebcae16fb0ce7ab4af456992bbd8d22fced /include/clang/Driver | |
parent | 4981926bf654fe5a2c3893f24ca44106b217e71e (diff) | |
download | FreeBSD-src-9092c3e0fa01f3139b016d05d267a89e3b07747a.zip FreeBSD-src-9092c3e0fa01f3139b016d05d267a89e3b07747a.tar.gz |
Update clang to r84119.
Diffstat (limited to 'include/clang/Driver')
-rw-r--r-- | include/clang/Driver/Action.h | 38 | ||||
-rw-r--r-- | include/clang/Driver/Arg.h | 46 | ||||
-rw-r--r-- | include/clang/Driver/ArgList.h | 55 | ||||
-rw-r--r-- | include/clang/Driver/Compilation.h | 18 | ||||
-rw-r--r-- | include/clang/Driver/Driver.h | 37 | ||||
-rw-r--r-- | include/clang/Driver/DriverDiagnostic.h | 2 | ||||
-rw-r--r-- | include/clang/Driver/HostInfo.h | 55 | ||||
-rw-r--r-- | include/clang/Driver/Job.h | 22 | ||||
-rw-r--r-- | include/clang/Driver/Option.h | 88 | ||||
-rw-r--r-- | include/clang/Driver/Options.def | 23 | ||||
-rw-r--r-- | include/clang/Driver/Options.h | 4 | ||||
-rw-r--r-- | include/clang/Driver/Tool.h | 8 | ||||
-rw-r--r-- | include/clang/Driver/ToolChain.h | 15 | ||||
-rw-r--r-- | include/clang/Driver/Types.def | 5 |
14 files changed, 234 insertions, 182 deletions
diff --git a/include/clang/Driver/Action.h b/include/clang/Driver/Action.h index ceef189..679704c 100644 --- a/include/clang/Driver/Action.h +++ b/include/clang/Driver/Action.h @@ -26,7 +26,7 @@ namespace clang { namespace driver { class Arg; -/// Action - Represent an abstract compilation step to perform. +/// Action - Represent an abstract compilation step to perform. /// /// An action represents an edge in the compilation graph; typically /// it is a job to transform an input using some tool. @@ -63,15 +63,15 @@ private: /// The output type of this action. types::ID Type; - + ActionList Inputs; protected: Action(ActionClass _Kind, types::ID _Type) : Kind(_Kind), Type(_Type) {} - Action(ActionClass _Kind, Action *Input, types::ID _Type) + Action(ActionClass _Kind, Action *Input, types::ID _Type) : Kind(_Kind), Type(_Type), Inputs(&Input, &Input + 1) {} - Action(ActionClass _Kind, const ActionList &_Inputs, types::ID _Type) - : Kind(_Kind), Type(_Type), Inputs(_Inputs) {} + Action(ActionClass _Kind, const ActionList &_Inputs, types::ID _Type) + : Kind(_Kind), Type(_Type), Inputs(_Inputs) {} public: virtual ~Action(); @@ -90,7 +90,7 @@ public: const_iterator begin() const { return Inputs.begin(); } const_iterator end() const { return Inputs.end(); } - static bool classof(const Action *) { return true; } + static bool classof(const Action *) { return true; } }; class InputAction : public Action { @@ -100,8 +100,8 @@ public: const Arg &getInputArg() const { return Input; } - static bool classof(const Action *A) { - return A->getKind() == InputClass; + static bool classof(const Action *A) { + return A->getKind() == InputClass; } static bool classof(const InputAction *) { return true; } }; @@ -116,8 +116,8 @@ public: const char *getArchName() const { return ArchName; } - static bool classof(const Action *A) { - return A->getKind() == BindArchClass; + static bool classof(const Action *A) { + return A->getKind() == BindArchClass; } static bool classof(const BindArchAction *) { return true; } }; @@ -128,9 +128,9 @@ protected: JobAction(ActionClass Kind, const ActionList &Inputs, types::ID Type); public: - static bool classof(const Action *A) { + static bool classof(const Action *A) { return (A->getKind() >= JobClassFirst && - A->getKind() <= JobClassLast); + A->getKind() <= JobClassLast); } static bool classof(const JobAction *) { return true; } }; @@ -139,7 +139,7 @@ class PreprocessJobAction : public JobAction { public: PreprocessJobAction(Action *Input, types::ID OutputType); - static bool classof(const Action *A) { + static bool classof(const Action *A) { return A->getKind() == PreprocessJobClass; } static bool classof(const PreprocessJobAction *) { return true; } @@ -149,7 +149,7 @@ class PrecompileJobAction : public JobAction { public: PrecompileJobAction(Action *Input, types::ID OutputType); - static bool classof(const Action *A) { + static bool classof(const Action *A) { return A->getKind() == PrecompileJobClass; } static bool classof(const PrecompileJobAction *) { return true; } @@ -159,7 +159,7 @@ class AnalyzeJobAction : public JobAction { public: AnalyzeJobAction(Action *Input, types::ID OutputType); - static bool classof(const Action *A) { + static bool classof(const Action *A) { return A->getKind() == AnalyzeJobClass; } static bool classof(const AnalyzeJobAction *) { return true; } @@ -169,7 +169,7 @@ class CompileJobAction : public JobAction { public: CompileJobAction(Action *Input, types::ID OutputType); - static bool classof(const Action *A) { + static bool classof(const Action *A) { return A->getKind() == CompileJobClass; } static bool classof(const CompileJobAction *) { return true; } @@ -179,7 +179,7 @@ class AssembleJobAction : public JobAction { public: AssembleJobAction(Action *Input, types::ID OutputType); - static bool classof(const Action *A) { + static bool classof(const Action *A) { return A->getKind() == AssembleJobClass; } static bool classof(const AssembleJobAction *) { return true; } @@ -189,7 +189,7 @@ class LinkJobAction : public JobAction { public: LinkJobAction(ActionList &Inputs, types::ID Type); - static bool classof(const Action *A) { + static bool classof(const Action *A) { return A->getKind() == LinkJobClass; } static bool classof(const LinkJobAction *) { return true; } @@ -199,7 +199,7 @@ class LipoJobAction : public JobAction { public: LipoJobAction(ActionList &Inputs, types::ID Type); - static bool classof(const Action *A) { + static bool classof(const Action *A) { return A->getKind() == LipoJobClass; } static bool classof(const LipoJobAction *) { return true; } diff --git a/include/clang/Driver/Arg.h b/include/clang/Driver/Arg.h index 6bed2b8..ebf40d4 100644 --- a/include/clang/Driver/Arg.h +++ b/include/clang/Driver/Arg.h @@ -49,7 +49,7 @@ namespace driver { /// The option this argument is an instance of. const Option *Opt; - + /// The argument this argument was derived from (during tool chain /// argument translation), if any. const Arg *BaseArg; @@ -66,7 +66,7 @@ namespace driver { protected: Arg(ArgClass Kind, const Option *Opt, unsigned Index, const Arg *BaseArg = 0); - + public: Arg(const Arg &); virtual ~Arg(); @@ -74,12 +74,12 @@ namespace driver { ArgClass getKind() const { return Kind; } const Option &getOption() const { return *Opt; } unsigned getIndex() const { return Index; } - + /// getBaseArg - Return the base argument which generated this /// arg; this is either the argument itself or the argument it was /// derived from during tool chain specific argument translation. - const Arg &getBaseArg() const { - return BaseArg ? *BaseArg : *this; + const Arg &getBaseArg() const { + return BaseArg ? *BaseArg : *this; } void setBaseArg(const Arg *_BaseArg) { BaseArg = _BaseArg; @@ -88,14 +88,14 @@ namespace driver { bool isClaimed() const { return getBaseArg().Claimed; } /// claim - Set the Arg claimed bit. - + // FIXME: We need to deal with derived arguments and set the bit // in the original argument; not the derived one. void claim() const { getBaseArg().Claimed = true; } virtual unsigned getNumValues() const = 0; virtual const char *getValue(const ArgList &Args, unsigned N=0) const = 0; - + /// render - Append the argument onto the given array as strings. virtual void render(const ArgList &Args, ArgStringList &Output) const = 0; @@ -105,7 +105,7 @@ namespace driver { /// (e.g., Xlinker). void renderAsInput(const ArgList &Args, ArgStringList &Output) const; - static bool classof(const Arg *) { return true; } + static bool classof(const Arg *) { return true; } void dump() const; @@ -124,8 +124,8 @@ namespace driver { virtual unsigned getNumValues() const { return 0; } virtual const char *getValue(const ArgList &Args, unsigned N=0) const; - static bool classof(const Arg *A) { - return A->getKind() == Arg::FlagClass; + static bool classof(const Arg *A) { + return A->getKind() == Arg::FlagClass; } static bool classof(const FlagArg *) { return true; } }; @@ -140,8 +140,8 @@ namespace driver { virtual unsigned getNumValues() const { return 1; } virtual const char *getValue(const ArgList &Args, unsigned N=0) const; - static bool classof(const Arg *A) { - return A->getKind() == Arg::PositionalClass; + static bool classof(const Arg *A) { + return A->getKind() == Arg::PositionalClass; } static bool classof(const PositionalArg *) { return true; } }; @@ -157,8 +157,8 @@ namespace driver { virtual unsigned getNumValues() const { return 1; } virtual const char *getValue(const ArgList &Args, unsigned N=0) const; - static bool classof(const Arg *A) { - return A->getKind() == Arg::JoinedClass; + static bool classof(const Arg *A) { + return A->getKind() == Arg::JoinedClass; } static bool classof(const JoinedArg *) { return true; } }; @@ -169,7 +169,7 @@ namespace driver { unsigned NumValues; public: - SeparateArg(const Option *Opt, unsigned Index, unsigned NumValues, + SeparateArg(const Option *Opt, unsigned Index, unsigned NumValues, const Arg *BaseArg = 0); virtual void render(const ArgList &Args, ArgStringList &Output) const; @@ -177,8 +177,8 @@ namespace driver { virtual unsigned getNumValues() const { return NumValues; } virtual const char *getValue(const ArgList &Args, unsigned N=0) const; - static bool classof(const Arg *A) { - return A->getKind() == Arg::SeparateClass; + static bool classof(const Arg *A) { + return A->getKind() == Arg::SeparateClass; } static bool classof(const SeparateArg *) { return true; } }; @@ -193,7 +193,7 @@ namespace driver { std::vector<std::string> Values; public: - CommaJoinedArg(const Option *Opt, unsigned Index, const char *Str, + CommaJoinedArg(const Option *Opt, unsigned Index, const char *Str, const Arg *BaseArg = 0); virtual void render(const ArgList &Args, ArgStringList &Output) const; @@ -201,8 +201,8 @@ namespace driver { virtual unsigned getNumValues() const { return Values.size(); } virtual const char *getValue(const ArgList &Args, unsigned N=0) const; - static bool classof(const Arg *A) { - return A->getKind() == Arg::CommaJoinedClass; + static bool classof(const Arg *A) { + return A->getKind() == Arg::CommaJoinedClass; } static bool classof(const CommaJoinedArg *) { return true; } }; @@ -211,7 +211,7 @@ namespace driver { /// values. class JoinedAndSeparateArg : public Arg { public: - JoinedAndSeparateArg(const Option *Opt, unsigned Index, + JoinedAndSeparateArg(const Option *Opt, unsigned Index, const Arg *BaseArg = 0); virtual void render(const ArgList &Args, ArgStringList &Output) const; @@ -219,8 +219,8 @@ namespace driver { virtual unsigned getNumValues() const { return 2; } virtual const char *getValue(const ArgList &Args, unsigned N=0) const; - static bool classof(const Arg *A) { - return A->getKind() == Arg::JoinedAndSeparateClass; + static bool classof(const Arg *A) { + return A->getKind() == Arg::JoinedAndSeparateClass; } static bool classof(const JoinedAndSeparateArg *) { return true; } }; diff --git a/include/clang/Driver/ArgList.h b/include/clang/Driver/ArgList.h index a9c890b..dcb6038 100644 --- a/include/clang/Driver/ArgList.h +++ b/include/clang/Driver/ArgList.h @@ -14,8 +14,14 @@ #include "clang/Driver/Util.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringRef.h" #include <list> +#include <string> + +namespace llvm { + class Twine; +} namespace clang { namespace driver { @@ -64,17 +70,17 @@ namespace driver { const_iterator begin() const { return Args.begin(); } const_iterator end() const { return Args.end(); } - + const_reverse_iterator rbegin() const { return Args.rbegin(); } const_reverse_iterator rend() const { return Args.rend(); } /// hasArg - Does the arg list contain any option matching \arg Id. /// /// \arg Claim Whether the argument should be claimed, if it exists. - bool hasArg(options::ID Id, bool Claim=true) const { + bool hasArg(options::ID Id, bool Claim=true) const { return getLastArg(Id, Claim) != 0; } - bool hasArg(options::ID Id0, options::ID Id1, bool Claim=true) const { + bool hasArg(options::ID Id0, options::ID Id1, bool Claim=true) const { return getLastArg(Id0, Id1, Claim) != 0; } @@ -104,15 +110,15 @@ namespace driver { /// AddAllArgs - Render all arguments matching the given ids. void AddAllArgs(ArgStringList &Output, options::ID Id0) const; - void AddAllArgs(ArgStringList &Output, options::ID Id0, + void AddAllArgs(ArgStringList &Output, options::ID Id0, options::ID Id1) const; - void AddAllArgs(ArgStringList &Output, options::ID Id0, options::ID Id1, + void AddAllArgs(ArgStringList &Output, options::ID Id0, options::ID Id1, options::ID Id2) const; /// AddAllArgValues - Render the argument values of all arguments /// matching the given ids. void AddAllArgValues(ArgStringList &Output, options::ID Id0) const; - void AddAllArgValues(ArgStringList &Output, options::ID Id0, + void AddAllArgValues(ArgStringList &Output, options::ID Id0, options::ID Id1) const; /// AddAllArgsTranslated - Render all the arguments matching the @@ -122,7 +128,7 @@ namespace driver { /// \param Joined - If true, render the argument as joined with /// the option specifier. void AddAllArgsTranslated(ArgStringList &Output, options::ID Id0, - const char *Translation, + const char *Translation, bool Joined = false) const; /// ClaimAllArgs - Claim all arguments which match the given @@ -135,7 +141,14 @@ namespace driver { /// MakeArgString - Construct a constant string pointer whose /// lifetime will match that of the ArgList. - virtual const char *MakeArgString(const char *Str) const = 0; + virtual const char *MakeArgString(llvm::StringRef Str) const = 0; + const char *MakeArgString(const char *Str) const { + return MakeArgString(llvm::StringRef(Str)); + } + const char *MakeArgString(std::string Str) const { + return MakeArgString(llvm::StringRef(Str)); + } + const char *MakeArgString(const llvm::Twine &Str) const; /// @} }; @@ -167,8 +180,8 @@ namespace driver { InputArgList(const ArgList &); ~InputArgList(); - virtual const char *getArgString(unsigned Index) const { - return ArgStrings[Index]; + virtual const char *getArgString(unsigned Index) const { + return ArgStrings[Index]; } /// getNumInputArgStrings - Return the number of original input @@ -180,10 +193,10 @@ namespace driver { public: /// MakeIndex - Get an index for the given string(s). - unsigned MakeIndex(const char *String0) const; - unsigned MakeIndex(const char *String0, const char *String1) const; + unsigned MakeIndex(llvm::StringRef String0) const; + unsigned MakeIndex(llvm::StringRef String0, llvm::StringRef String1) const; - virtual const char *MakeArgString(const char *Str) const; + virtual const char *MakeArgString(llvm::StringRef Str) const; /// @} }; @@ -211,13 +224,13 @@ namespace driver { ~DerivedArgList(); virtual const char *getArgString(unsigned Index) const { - return BaseArgs.getArgString(Index); + return BaseArgs.getArgString(Index); } /// @name Arg Synthesis /// @{ - virtual const char *MakeArgString(const char *Str) const; + virtual const char *MakeArgString(llvm::StringRef Str) const; /// MakeFlagArg - Construct a new FlagArg for the given option /// \arg Id. @@ -225,18 +238,18 @@ namespace driver { /// MakePositionalArg - Construct a new Positional arg for the /// given option \arg Id, with the provided \arg Value. - Arg *MakePositionalArg(const Arg *BaseArg, const Option *Opt, - const char *Value) const; + Arg *MakePositionalArg(const Arg *BaseArg, const Option *Opt, + llvm::StringRef Value) const; /// MakeSeparateArg - Construct a new Positional arg for the /// given option \arg Id, with the provided \arg Value. - Arg *MakeSeparateArg(const Arg *BaseArg, const Option *Opt, - const char *Value) const; + Arg *MakeSeparateArg(const Arg *BaseArg, const Option *Opt, + llvm::StringRef Value) const; /// MakeJoinedArg - Construct a new Positional arg for the /// given option \arg Id, with the provided \arg Value. - Arg *MakeJoinedArg(const Arg *BaseArg, const Option *Opt, - const char *Value) const; + Arg *MakeJoinedArg(const Arg *BaseArg, const Option *Opt, + llvm::StringRef Value) const; /// @} }; diff --git a/include/clang/Driver/Compilation.h b/include/clang/Driver/Compilation.h index 6414ef1..56786a7 100644 --- a/include/clang/Driver/Compilation.h +++ b/include/clang/Driver/Compilation.h @@ -47,7 +47,8 @@ class Compilation { JobList Jobs; /// Cache of translated arguments for a particular tool chain. - llvm::DenseMap<const ToolChain*, DerivedArgList*> TCArgs; + llvm::DenseMap<std::pair<const ToolChain*, const char*>, + DerivedArgList*> TCArgs; /// Temporary files which should be removed on exit. ArgStringList TempFiles; @@ -56,7 +57,7 @@ class Compilation { ArgStringList ResultFiles; public: - Compilation(const Driver &D, const ToolChain &DefaultToolChain, + Compilation(const Driver &D, const ToolChain &DefaultToolChain, InputArgList *Args); ~Compilation(); @@ -79,12 +80,15 @@ public: /// getArgsForToolChain - Return the derived argument list for the /// tool chain \arg TC (or the default tool chain, if TC is not /// specified). - const DerivedArgList &getArgsForToolChain(const ToolChain *TC = 0); + /// + /// \param BoundArch - The bound architecture name, or 0. + const DerivedArgList &getArgsForToolChain(const ToolChain *TC, + const char *BoundArch); /// addTempFile - Add a file to remove on exit, and returns its /// argument. - const char *addTempFile(const char *Name) { - TempFiles.push_back(Name); + const char *addTempFile(const char *Name) { + TempFiles.push_back(Name); return Name; } @@ -99,7 +103,7 @@ public: /// /// \param IssueErrors - Report failures as errors. /// \return Whether all files were removed successfully. - bool CleanupFileList(const ArgStringList &Files, + bool CleanupFileList(const ArgStringList &Files, bool IssueErrors=false) const; /// PrintJob - Print one job in -### format. @@ -108,7 +112,7 @@ public: /// \param J - The job to print. /// \param Terminator - A string to print at the end of the line. /// \param Quote - Should separate arguments be quoted. - void PrintJob(llvm::raw_ostream &OS, const Job &J, + void PrintJob(llvm::raw_ostream &OS, const Job &J, const char *Terminator, bool Quote) const; /// ExecuteCommand - Execute an actual command. diff --git a/include/clang/Driver/Driver.h b/include/clang/Driver/Driver.h index c0def2b..c0327a2 100644 --- a/include/clang/Driver/Driver.h +++ b/include/clang/Driver/Driver.h @@ -15,12 +15,16 @@ #include "clang/Driver/Phases.h" #include "clang/Driver/Util.h" +#include "llvm/ADT/Triple.h" #include "llvm/System/Path.h" // FIXME: Kill when CompilationInfo // lands. #include <list> #include <set> #include <string> +namespace llvm { + class raw_ostream; +} namespace clang { namespace driver { class Action; @@ -51,11 +55,11 @@ public: public: /// The name the driver was invoked as. std::string Name; - + /// The path the driver executable was in, as invoked from the /// command line. std::string Dir; - + /// Default host triple. std::string DefaultHostTriple; @@ -71,7 +75,7 @@ public: /// Whether the driver should follow g++ like behavior. bool CCCIsCXX : 1; - + /// Echo commands while executing (in -v style). bool CCCEcho : 1; @@ -99,11 +103,11 @@ public: private: /// Only use clang for the given architectures (only used when /// non-empty). - std::set<std::string> CCCClangArchs; + std::set<llvm::Triple::ArchType> CCCClangArchs; /// Certain options suppress the 'no input files' warning. bool SuppressMissingInputWarning : 1; - + std::list<std::string> TempFiles; std::list<std::string> ResultFiles; @@ -111,7 +115,7 @@ public: Driver(const char *_Name, const char *_Dir, const char *_DefaultHostTriple, const char *_DefaultImageName, - Diagnostic &_Diags); + bool IsProduction, Diagnostic &_Diags); ~Driver(); /// @name Accessors @@ -185,14 +189,15 @@ public: void PrintOptions(const ArgList &Args) const; /// PrintVersion - Print the driver version. - void PrintVersion(const Compilation &C) const; + void PrintVersion(const Compilation &C, llvm::raw_ostream &OS) const; /// GetFilePath - Lookup \arg Name in the list of file search paths. /// /// \arg TC - The tool chain for additional information on /// directories to search. + // // FIXME: This should be in CompilationInfo. - llvm::sys::Path GetFilePath(const char *Name, const ToolChain &TC) const; + std::string GetFilePath(const char *Name, const ToolChain &TC) const; /// GetProgramPath - Lookup \arg Name in the list of program search /// paths. @@ -202,9 +207,10 @@ public: /// /// \arg WantFile - False when searching for an executable file, otherwise /// true. Defaults to false. + // // FIXME: This should be in CompilationInfo. - llvm::sys::Path GetProgramPath(const char *Name, const ToolChain &TC, - bool WantFile = false) const; + std::string GetProgramPath(const char *Name, const ToolChain &TC, + bool WantFile = false) const; /// HandleImmediateArgs - Handle any arguments which should be /// treated before building actions or binding tools. @@ -225,6 +231,7 @@ public: void BuildJobsForAction(Compilation &C, const Action *A, const ToolChain *TC, + const char *BoundArch, bool CanAcceptPipe, bool AtTopLevel, const char *LinkingOutput, @@ -239,7 +246,7 @@ public: /// \param BaseInput - The original input file that this action was /// triggered by. /// \param AtTopLevel - Whether this is a "top-level" action. - const char *GetNamedOutputPath(Compilation &C, + const char *GetNamedOutputPath(Compilation &C, const JobAction &JA, const char *BaseInput, bool AtTopLevel) const; @@ -249,15 +256,15 @@ public: /// /// GCC goes to extra lengths here to be a bit more robust. std::string GetTemporaryPath(const char *Suffix) const; - + /// GetHostInfo - Construct a new host info object for the given /// host triple. const HostInfo *GetHostInfo(const char *HostTriple) const; /// ShouldUseClangCompilar - Should the clang compiler be used to /// handle this action. - bool ShouldUseClangCompiler(const Compilation &C, const JobAction &JA, - const std::string &ArchName) const; + bool ShouldUseClangCompiler(const Compilation &C, const JobAction &JA, + const llvm::Triple &ArchName) const; /// @} @@ -268,7 +275,7 @@ public: /// \return True if the entire string was parsed (9.2), or all /// groups were parsed (10.3.5extrastuff). HadExtra is true if all /// groups were parsed but extra characters remain at the end. - static bool GetReleaseVersion(const char *Str, unsigned &Major, + static bool GetReleaseVersion(const char *Str, unsigned &Major, unsigned &Minor, unsigned &Micro, bool &HadExtra); }; diff --git a/include/clang/Driver/DriverDiagnostic.h b/include/clang/Driver/DriverDiagnostic.h index 705c342..d4a9da7 100644 --- a/include/clang/Driver/DriverDiagnostic.h +++ b/include/clang/Driver/DriverDiagnostic.h @@ -13,7 +13,7 @@ #include "clang/Basic/Diagnostic.h" namespace clang { - namespace diag { + namespace diag { enum { #define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,SFINAE) ENUM, #define DRIVERSTART diff --git a/include/clang/Driver/HostInfo.h b/include/clang/Driver/HostInfo.h index b5e80b0..bf67c34 100644 --- a/include/clang/Driver/HostInfo.h +++ b/include/clang/Driver/HostInfo.h @@ -20,13 +20,13 @@ namespace driver { class Driver; class ToolChain; -/// HostInfo - Config information about a particular host which may -/// interact with driver behavior. -/// -/// The host information is used for controlling the parts of the -/// driver which interact with the platform the driver is ostensibly -/// being run from. For testing purposes, the HostInfo used by the -/// driver may differ from the actual host. +/// HostInfo - Config information about a particular host which may interact +/// with driver behavior. +/// +/// The host information is used for controlling the parts of the driver which +/// interact with the platform the driver is ostensibly being run from. For +/// testing purposes, the HostInfo used by the driver may differ from the actual +/// host. class HostInfo { protected: const Driver &TheDriver; @@ -38,46 +38,49 @@ public: virtual ~HostInfo(); const Driver &getDriver() const { return TheDriver; } - + const llvm::Triple& getTriple() const { return Triple; } std::string getArchName() const { return Triple.getArchName(); } std::string getPlatformName() const { return Triple.getVendorName(); } std::string getOSName() const { return Triple.getOSName(); } - /// useDriverDriver - Whether the driver should act as a driver - /// driver for this host and support -arch, -Xarch, etc. + /// useDriverDriver - Whether the driver should act as a driver driver for + /// this host and support -arch, -Xarch, etc. virtual bool useDriverDriver() const = 0; - /// lookupTypeForExtension - Return the default language type to use - /// for the given extension. + /// lookupTypeForExtension - Return the default language type to use for the + /// given extension. virtual types::ID lookupTypeForExtension(const char *Ext) const = 0; - /// getToolChain - Construct the toolchain to use for this host. + /// CreateToolChain - Construct the toolchain to use for this host (which the + /// host retains ownership of). /// - /// \param Args - The argument list, which may be used to alter the - /// default toolchain, for example in the presence of -m32 or -m64. + /// \param Args - The argument list, which may be used to alter the default + /// toolchain, for example in the presence of -m32 or -m64. /// - /// \param ArchName - The architecture to return a toolchain for, or - /// 0 if unspecified. This will only ever be non-zero for hosts - /// which support a driver driver. + /// \param ArchName - The architecture to return a toolchain for, or 0 if + /// unspecified. This will only ever be non-zero for hosts which support a + /// driver driver. // FIXME: Pin down exactly what the HostInfo is allowed to use Args // for here. Currently this is for -m32 / -m64 defaulting. - virtual ToolChain *getToolChain(const ArgList &Args, - const char *ArchName=0) const = 0; + virtual ToolChain *CreateToolChain(const ArgList &Args, + const char *ArchName=0) const = 0; }; -const HostInfo *createDarwinHostInfo(const Driver &D, +const HostInfo *createAuroraUXHostInfo(const Driver &D, + const llvm::Triple& Triple); +const HostInfo *createDarwinHostInfo(const Driver &D, const llvm::Triple& Triple); -const HostInfo *createOpenBSDHostInfo(const Driver &D, +const HostInfo *createOpenBSDHostInfo(const Driver &D, const llvm::Triple& Triple); -const HostInfo *createFreeBSDHostInfo(const Driver &D, +const HostInfo *createFreeBSDHostInfo(const Driver &D, const llvm::Triple& Triple); -const HostInfo *createDragonFlyHostInfo(const Driver &D, +const HostInfo *createDragonFlyHostInfo(const Driver &D, const llvm::Triple& Triple); -const HostInfo *createLinuxHostInfo(const Driver &D, +const HostInfo *createLinuxHostInfo(const Driver &D, const llvm::Triple& Triple); -const HostInfo *createUnknownHostInfo(const Driver &D, +const HostInfo *createUnknownHostInfo(const Driver &D, const llvm::Triple& Triple); } // end namespace driver diff --git a/include/clang/Driver/Job.h b/include/clang/Driver/Job.h index a23babd..906d731 100644 --- a/include/clang/Driver/Job.h +++ b/include/clang/Driver/Job.h @@ -46,7 +46,7 @@ public: /// either a piped job or a job list. void addCommand(Command *C); - static bool classof(const Job *) { return true; } + static bool classof(const Job *) { return true; } }; /// Command - An executable path/name and argument vector to @@ -63,7 +63,7 @@ class Command : public Job { ArgStringList Arguments; public: - Command(const Action &_Source, const char *_Executable, + Command(const Action &_Source, const char *_Executable, const ArgStringList &_Arguments); /// getSource - Return the Action which caused the creation of this job. @@ -73,8 +73,8 @@ public: const ArgStringList &getArguments() const { return Arguments; } - static bool classof(const Job *J) { - return J->getKind() == CommandClass; + static bool classof(const Job *J) { + return J->getKind() == CommandClass; } static bool classof(const Command *) { return true; } }; @@ -97,15 +97,15 @@ public: void addCommand(Command *C) { Commands.push_back(C); } const list_type &getCommands() const { return Commands; } - + size_type size() const { return Commands.size(); } iterator begin() { return Commands.begin(); } const_iterator begin() const { return Commands.begin(); } iterator end() { return Commands.end(); } const_iterator end() const { return Commands.end(); } - static bool classof(const Job *J) { - return J->getKind() == PipedJobClass; + static bool classof(const Job *J) { + return J->getKind() == PipedJobClass; } static bool classof(const PipedJob *) { return true; } }; @@ -133,13 +133,13 @@ public: const_iterator begin() const { return Jobs.begin(); } iterator end() { return Jobs.end(); } const_iterator end() const { return Jobs.end(); } - - static bool classof(const Job *J) { - return J->getKind() == JobListClass; + + static bool classof(const Job *J) { + return J->getKind() == JobListClass; } static bool classof(const JobList *) { return true; } }; - + } // end namespace driver } // end namespace clang diff --git a/include/clang/Driver/Option.h b/include/clang/Driver/Option.h index c59faef..c70b648 100644 --- a/include/clang/Driver/Option.h +++ b/include/clang/Driver/Option.h @@ -24,7 +24,7 @@ namespace driver { class Arg; class InputArgList; class OptionGroup; - + /// Option - Abstract representation for a single form of driver /// argument. /// @@ -57,10 +57,10 @@ namespace driver { options::ID ID; /// The option name. - const char *Name; + const char *Name; /// Group this option is a member of, if any. - const OptionGroup *Group; + const OptionGroup *Group; /// Option that this is an alias for, if any. const Option *Alias; @@ -70,7 +70,7 @@ namespace driver { /// Treat this option like a linker input? bool LinkerInput : 1; - + /// When rendering as an input, don't render the option. // FIXME: We should ditch the render/renderAsInput distinction. @@ -78,18 +78,18 @@ namespace driver { /// Always render this option as separate form its value. bool ForceSeparateRender : 1; - + /// Always render this option joined with its value. - bool ForceJoinedRender : 1; + bool ForceJoinedRender : 1; /// This option is only consumed by the driver. - bool DriverOption : 1; + bool DriverOption : 1; /// This option should not report argument unused errors. - bool NoArgumentUnused : 1; + bool NoArgumentUnused : 1; protected: - Option(OptionClass Kind, options::ID ID, const char *Name, + Option(OptionClass Kind, options::ID ID, const char *Name, const OptionGroup *Group, const Option *Alias); public: virtual ~Option(); @@ -108,13 +108,13 @@ namespace driver { bool hasNoOptAsInput() const { return NoOptAsInput; } void setNoOptAsInput(bool Value) { NoOptAsInput = Value; } - + bool hasForceSeparateRender() const { return ForceSeparateRender; } void setForceSeparateRender(bool Value) { ForceSeparateRender = Value; } - + bool hasForceJoinedRender() const { return ForceJoinedRender; } void setForceJoinedRender(bool Value) { ForceJoinedRender = Value; } - + bool isDriverOption() const { return DriverOption; } void setDriverOption(bool Value) { DriverOption = Value; } @@ -125,7 +125,7 @@ namespace driver { /// getUnaliasedOption - Return the final option this option /// aliases (itself, if the option has no alias). - const Option *getUnaliasedOption() const { + const Option *getUnaliasedOption() const { if (Alias) return Alias->getUnaliasedOption(); return this; } @@ -149,12 +149,12 @@ namespace driver { /// Index to the position where argument parsing should resume /// (even if the argument is missing values). virtual Arg *accept(const InputArgList &Args, unsigned &Index) const = 0; - + void dump() const; static bool classof(const Option *) { return true; } }; - + /// OptionGroup - A set of options which are can be handled uniformly /// by the driver. class OptionGroup : public Option { @@ -163,14 +163,14 @@ namespace driver { virtual Arg *accept(const InputArgList &Args, unsigned &Index) const; - static bool classof(const Option *O) { - return O->getKind() == Option::GroupClass; + static bool classof(const Option *O) { + return O->getKind() == Option::GroupClass; } static bool classof(const OptionGroup *) { return true; } }; - + // Dummy option classes. - + /// InputOption - Dummy option class for representing driver inputs. class InputOption : public Option { public: @@ -178,8 +178,8 @@ namespace driver { virtual Arg *accept(const InputArgList &Args, unsigned &Index) const; - static bool classof(const Option *O) { - return O->getKind() == Option::InputClass; + static bool classof(const Option *O) { + return O->getKind() == Option::InputClass; } static bool classof(const InputOption *) { return true; } }; @@ -191,8 +191,8 @@ namespace driver { virtual Arg *accept(const InputArgList &Args, unsigned &Index) const; - static bool classof(const Option *O) { - return O->getKind() == Option::UnknownClass; + static bool classof(const Option *O) { + return O->getKind() == Option::UnknownClass; } static bool classof(const UnknownOption *) { return true; } }; @@ -201,52 +201,52 @@ namespace driver { class FlagOption : public Option { public: - FlagOption(options::ID ID, const char *Name, const OptionGroup *Group, + FlagOption(options::ID ID, const char *Name, const OptionGroup *Group, const Option *Alias); virtual Arg *accept(const InputArgList &Args, unsigned &Index) const; - static bool classof(const Option *O) { - return O->getKind() == Option::FlagClass; + static bool classof(const Option *O) { + return O->getKind() == Option::FlagClass; } static bool classof(const FlagOption *) { return true; } }; class JoinedOption : public Option { public: - JoinedOption(options::ID ID, const char *Name, const OptionGroup *Group, + JoinedOption(options::ID ID, const char *Name, const OptionGroup *Group, const Option *Alias); virtual Arg *accept(const InputArgList &Args, unsigned &Index) const; - static bool classof(const Option *O) { - return O->getKind() == Option::JoinedClass; + static bool classof(const Option *O) { + return O->getKind() == Option::JoinedClass; } static bool classof(const JoinedOption *) { return true; } }; class SeparateOption : public Option { public: - SeparateOption(options::ID ID, const char *Name, const OptionGroup *Group, + SeparateOption(options::ID ID, const char *Name, const OptionGroup *Group, const Option *Alias); virtual Arg *accept(const InputArgList &Args, unsigned &Index) const; - static bool classof(const Option *O) { - return O->getKind() == Option::SeparateClass; + static bool classof(const Option *O) { + return O->getKind() == Option::SeparateClass; } static bool classof(const SeparateOption *) { return true; } }; class CommaJoinedOption : public Option { public: - CommaJoinedOption(options::ID ID, const char *Name, + CommaJoinedOption(options::ID ID, const char *Name, const OptionGroup *Group, const Option *Alias); virtual Arg *accept(const InputArgList &Args, unsigned &Index) const; - static bool classof(const Option *O) { - return O->getKind() == Option::CommaJoinedClass; + static bool classof(const Option *O) { + return O->getKind() == Option::CommaJoinedClass; } static bool classof(const CommaJoinedOption *) { return true; } }; @@ -259,15 +259,15 @@ namespace driver { unsigned NumArgs; public: - MultiArgOption(options::ID ID, const char *Name, const OptionGroup *Group, + MultiArgOption(options::ID ID, const char *Name, const OptionGroup *Group, const Option *Alias, unsigned NumArgs); unsigned getNumArgs() const { return NumArgs; } virtual Arg *accept(const InputArgList &Args, unsigned &Index) const; - static bool classof(const Option *O) { - return O->getKind() == Option::MultiArgClass; + static bool classof(const Option *O) { + return O->getKind() == Option::MultiArgClass; } static bool classof(const MultiArgOption *) { return true; } }; @@ -276,13 +276,13 @@ namespace driver { /// prefixes its (non-empty) value, or is follwed by a value. class JoinedOrSeparateOption : public Option { public: - JoinedOrSeparateOption(options::ID ID, const char *Name, + JoinedOrSeparateOption(options::ID ID, const char *Name, const OptionGroup *Group, const Option *Alias); virtual Arg *accept(const InputArgList &Args, unsigned &Index) const; - static bool classof(const Option *O) { - return O->getKind() == Option::JoinedOrSeparateClass; + static bool classof(const Option *O) { + return O->getKind() == Option::JoinedOrSeparateClass; } static bool classof(const JoinedOrSeparateOption *) { return true; } }; @@ -291,13 +291,13 @@ namespace driver { /// value and is followed by another value. class JoinedAndSeparateOption : public Option { public: - JoinedAndSeparateOption(options::ID ID, const char *Name, + JoinedAndSeparateOption(options::ID ID, const char *Name, const OptionGroup *Group, const Option *Alias); virtual Arg *accept(const InputArgList &Args, unsigned &Index) const; - static bool classof(const Option *O) { - return O->getKind() == Option::JoinedAndSeparateClass; + static bool classof(const Option *O) { + return O->getKind() == Option::JoinedAndSeparateClass; } static bool classof(const JoinedAndSeparateOption *) { return true; } }; diff --git a/include/clang/Driver/Options.def b/include/clang/Driver/Options.def index af108a8..4084be6 100644 --- a/include/clang/Driver/Options.def +++ b/include/clang/Driver/Options.def @@ -223,6 +223,8 @@ OPTION("--print-prog-name", _print_prog_name, Separate, INVALID, print_prog_name OPTION("--print-search-dirs", _print_search_dirs, Flag, INVALID, print_search_dirs, "", 0, 0, 0) OPTION("--profile-blocks", _profile_blocks, Flag, INVALID, a, "", 0, 0, 0) OPTION("--profile", _profile, Flag, INVALID, p, "", 0, 0, 0) +OPTION("--relocatable-pch", _relocatable_pch, Flag, INVALID, INVALID, "", 0, + "Build a relocatable precompiled header", 0) OPTION("--resource=", _resource_EQ, Joined, INVALID, fcompile_resource_EQ, "", 0, 0, 0) OPTION("--resource", _resource, Separate, INVALID, fcompile_resource_EQ, "J", 0, 0, 0) OPTION("--save-temps", _save_temps, Flag, INVALID, save_temps, "", 0, 0, 0) @@ -322,6 +324,7 @@ OPTION("-Z", Z_Joined, Joined, INVALID, INVALID, "", 0, 0, 0) OPTION("-all_load", all__load, Flag, INVALID, INVALID, "", 0, 0, 0) OPTION("-allowable_client", allowable__client, Separate, INVALID, INVALID, "", 0, 0, 0) OPTION("-ansi", ansi, Flag, a_Group, INVALID, "", 0, 0, 0) +OPTION("-arch_errors_fatal", arch__errors__fatal, Flag, INVALID, INVALID, "", 0, 0, 0) OPTION("-arch", arch, Separate, INVALID, INVALID, "d", 0, 0, 0) OPTION("-a", a, Joined, a_Group, INVALID, "", 0, 0, 0) OPTION("-bind_at_load", bind__at__load, Flag, INVALID, INVALID, "", 0, 0, 0) @@ -351,6 +354,8 @@ OPTION("-dynamiclib", dynamiclib, Flag, INVALID, INVALID, "", 0, 0, 0) OPTION("-dynamic", dynamic, Flag, INVALID, INVALID, "q", 0, 0, 0) OPTION("-d", d_Flag, Flag, d_Group, INVALID, "", 0, 0, 0) OPTION("-d", d_Joined, Joined, d_Group, INVALID, "", 0, 0, 0) +OPTION("-emit-ast", emit_ast, Flag, INVALID, INVALID, "", 0, + "Emit Clang AST files for source inputs", 0) OPTION("-emit-llvm", emit_llvm, Flag, INVALID, INVALID, "", 0, "Use the LLVM representation for assembler and object files", 0) OPTION("-exported_symbols_list", exported__symbols__list, Separate, INVALID, INVALID, "", 0, 0, 0) @@ -365,12 +370,15 @@ OPTION("-fast", fast, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fasynchronous-unwind-tables", fasynchronous_unwind_tables, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fblocks", fblocks, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fbootclasspath=", fbootclasspath_EQ, Joined, f_Group, INVALID, "", 0, 0, 0) +OPTION("-fbuiltin-strcat", fbuiltin_strcat, Flag, f_Group, INVALID, "", 0, 0, 0) +OPTION("-fbuiltin-strcpy", fbuiltin_strcpy, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fbuiltin", fbuiltin, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fclasspath=", fclasspath_EQ, Joined, f_Group, INVALID, "", 0, 0, 0) OPTION("-fcolor-diagnostics", fcolor_diagnostics, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fcommon", fcommon, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fcompile-resource=", fcompile_resource_EQ, Joined, f_Group, INVALID, "", 0, 0, 0) OPTION("-fconstant-cfstrings", fconstant_cfstrings, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0) +OPTION("-fconstant-string-class=", fconstant_string_class_EQ, Joined, f_Group, INVALID, "", 0, 0, 0) OPTION("-fcreate-profile", fcreate_profile, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fdebug-pass-arguments", fdebug_pass_arguments, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fdebug-pass-structure", fdebug_pass_structure, Flag, f_Group, INVALID, "", 0, 0, 0) @@ -404,6 +412,8 @@ OPTION("-fnested-functions", fnested_functions, Flag, f_Group, INVALID, "", 0, 0 OPTION("-fnext-runtime", fnext_runtime, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-asynchronous-unwind-tables", fno_asynchronous_unwind_tables, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-blocks", fno_blocks, Flag, f_Group, INVALID, "", 0, 0, 0) +OPTION("-fno-builtin-strcat", fno_builtin_strcat, Flag, f_Group, INVALID, "", 0, 0, 0) +OPTION("-fno-builtin-strcpy", fno_builtin_strcpy, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-builtin", fno_builtin, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-caret-diagnostics", fno_caret_diagnostics, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-color-diagnostics", fno_color_diagnostics, Flag, f_Group, INVALID, "", 0, 0, 0) @@ -413,11 +423,14 @@ OPTION("-fno-diagnostics-fixit-info", fno_diagnostics_fixit_info, Flag, f_Group, OPTION("-fno-diagnostics-show-option", fno_diagnostics_show_option, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-dollars-in-identifiers", fno_dollars_in_identifiers, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-eliminate-unused-debug-symbols", fno_eliminate_unused_debug_symbols, Flag, f_Group, INVALID, "", 0, 0, 0) +OPTION("-fno-exceptions", fno_exceptions, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-inline-functions", fno_inline_functions, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-inline", fno_inline, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-keep-inline-functions", fno_keep_inline_functions, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-math-errno", fno_math_errno, Flag, f_Group, INVALID, "", 0, 0, 0) +OPTION("-fno-omit-frame-pointer", fno_omit_frame_pointer, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-pascal-strings", fno_pascal_strings, Flag, f_Group, INVALID, "", 0, 0, 0) +OPTION("-fno-rtti", fno_rtti, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-show-column", fno_show_column, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-show-source-location", fno_show_source_location, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-stack-protector", fno_stack_protector, Flag, f_Group, INVALID, "", 0, 0, 0) @@ -447,6 +460,7 @@ OPTION("-fpie", fpie, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fprofile-arcs", fprofile_arcs, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fprofile-generate", fprofile_generate, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-framework", framework, Separate, INVALID, INVALID, "l", 0, 0, 0) +OPTION("-frtti", frtti, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fshow-source-location", fshow_source_location, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fsigned-bitfields", fsigned_bitfields, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fsigned-char", fsigned_char, Flag, f_Group, INVALID, "", 0, 0, 0) @@ -457,7 +471,6 @@ OPTION("-fsyntax-only", fsyntax_only, Flag, INVALID, INVALID, "d", 0, 0, 0) OPTION("-ftemplate-depth-", ftemplate_depth_, Joined, f_Group, INVALID, "", 0, 0, 0) OPTION("-fterminated-vtables", fterminated_vtables, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-ftime-report", ftime_report, Flag, f_Group, INVALID, "", 0, 0, 0) -OPTION("-ftraditional", ftraditional, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-ftrapv", ftrapv, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-funit-at-a-time", funit_at_a_time, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-funsigned-bitfields", funsigned_bitfields, Flag, f_Group, INVALID, "", 0, 0, 0) @@ -497,10 +510,15 @@ OPTION("-m32", m32, Flag, m_Group, INVALID, "d", 0, 0, 0) OPTION("-m3dnowa", m3dnowa, Flag, m_x86_Features_Group, INVALID, "", 0, 0, 0) OPTION("-m3dnow", m3dnow, Flag, m_x86_Features_Group, INVALID, "", 0, 0, 0) OPTION("-m64", m64, Flag, m_Group, INVALID, "d", 0, 0, 0) +OPTION("-mabi=", mabi_EQ, Joined, m_Group, INVALID, "d", 0, 0, 0) OPTION("-march=", march_EQ, Joined, m_Group, INVALID, "d", 0, 0, 0) +OPTION("-mcmodel=", mcmodel_EQ, Joined, m_Group, INVALID, "d", 0, 0, 0) OPTION("-mconstant-cfstrings", mconstant_cfstrings, Flag, clang_ignored_m_Group, INVALID, "", 0, 0, 0) +OPTION("-mcpu=", mcpu_EQ, Joined, m_Group, INVALID, "d", 0, 0, 0) OPTION("-mdynamic-no-pic", mdynamic_no_pic, Joined, m_Group, INVALID, "q", 0, 0, 0) OPTION("-mfix-and-continue", mfix_and_continue, Flag, clang_ignored_m_Group, INVALID, "", 0, 0, 0) +OPTION("-mfloat-abi=", mfloat_abi_EQ, Joined, m_Group, INVALID, "", 0, 0, 0) +OPTION("-mhard-float", mhard_float, Flag, m_Group, INVALID, "", 0, 0, 0) OPTION("-miphoneos-version-min=", miphoneos_version_min_EQ, Joined, m_Group, INVALID, "", 0, 0, 0) OPTION("-mkernel", mkernel, Flag, m_Group, INVALID, "", 0, 0, 0) OPTION("-mllvm", mllvm, Separate, INVALID, INVALID, "", 0, 0, 0) @@ -519,6 +537,7 @@ OPTION("-mno-sse4a", mno_sse4a, Flag, m_x86_Features_Group, INVALID, "", 0, 0, 0 OPTION("-mno-sse4", mno_sse4, Flag, m_x86_Features_Group, INVALID, "", 0, 0, 0) OPTION("-mno-sse", mno_sse, Flag, m_x86_Features_Group, INVALID, "", 0, 0, 0) OPTION("-mno-ssse3", mno_ssse3, Flag, m_x86_Features_Group, INVALID, "", 0, 0, 0) +OPTION("-mno-thumb", mno_thumb, Flag, m_Group, INVALID, "", 0, 0, 0) OPTION("-mno-warn-nonportable-cfstrings", mno_warn_nonportable_cfstrings, Flag, m_Group, INVALID, "", 0, 0, 0) OPTION("-mpascal-strings", mpascal_strings, Flag, m_Group, INVALID, "", 0, 0, 0) OPTION("-mred-zone", mred_zone, Flag, m_Group, INVALID, "", 0, 0, 0) @@ -529,6 +548,7 @@ OPTION("-msse4a", msse4a, Flag, m_x86_Features_Group, INVALID, "", 0, 0, 0) OPTION("-msse4", msse4, Flag, m_x86_Features_Group, INVALID, "", 0, 0, 0) OPTION("-msse", msse, Flag, m_x86_Features_Group, INVALID, "", 0, 0, 0) OPTION("-mssse3", mssse3, Flag, m_x86_Features_Group, INVALID, "", 0, 0, 0) +OPTION("-mthumb", mthumb, Flag, m_Group, INVALID, "", 0, 0, 0) OPTION("-mtune=", mtune_EQ, Joined, m_Group, INVALID, "", 0, 0, 0) OPTION("-multi_module", multi__module, Flag, INVALID, INVALID, "", 0, 0, 0) OPTION("-multiply_defined_unused", multiply__defined__unused, Separate, INVALID, INVALID, "", 0, 0, 0) @@ -546,6 +566,7 @@ OPTION("-nomultidefs", nomultidefs, Flag, INVALID, INVALID, "", 0, 0, 0) OPTION("-noprebind", noprebind, Flag, INVALID, INVALID, "", 0, 0, 0) OPTION("-noseglinkedit", noseglinkedit, Flag, INVALID, INVALID, "", 0, 0, 0) OPTION("-nostartfiles", nostartfiles, Flag, INVALID, INVALID, "", 0, 0, 0) +OPTION("-nostdclanginc", nostdclanginc, Flag, INVALID, INVALID, "", 0, 0, 0) OPTION("-nostdinc", nostdinc, Flag, INVALID, INVALID, "", 0, 0, 0) OPTION("-nostdlib", nostdlib, Flag, INVALID, INVALID, "", 0, 0, 0) OPTION("-object", object, Flag, INVALID, INVALID, "", 0, 0, 0) diff --git a/include/clang/Driver/Options.h b/include/clang/Driver/Options.h index 8b959d3..7fcaf3f 100644 --- a/include/clang/Driver/Options.h +++ b/include/clang/Driver/Options.h @@ -24,7 +24,7 @@ namespace options { #undef OPTION }; } - + class Arg; class InputArgList; class Option; @@ -36,7 +36,7 @@ namespace options { /// few options will be needed at runtime; the OptTable class /// maintains enough information to parse command lines without /// instantiating Options, while letting other parts of the driver - /// still use Option instances where convient. + /// still use Option instances where convient. class OptTable { /// The table of options which have been constructed, indexed by /// option::ID - 1. diff --git a/include/clang/Driver/Tool.h b/include/clang/Driver/Tool.h index d8b37e9..8a89f01 100644 --- a/include/clang/Driver/Tool.h +++ b/include/clang/Driver/Tool.h @@ -22,7 +22,7 @@ namespace driver { class Job; class JobAction; class ToolChain; - + typedef llvm::SmallVector<InputInfo, 4> InputInfoList; /// Tool - Information on a specific compilation tool. @@ -57,9 +57,9 @@ public: /// linker, then this is the final output name of the linked image. virtual void ConstructJob(Compilation &C, const JobAction &JA, Job &Dest, - const InputInfo &Output, - const InputInfoList &Inputs, - const ArgList &TCArgs, + const InputInfo &Output, + const InputInfoList &Inputs, + const ArgList &TCArgs, const char *LinkingOutput) const = 0; }; diff --git a/include/clang/Driver/ToolChain.h b/include/clang/Driver/ToolChain.h index c9d0ef1..b7630d8 100644 --- a/include/clang/Driver/ToolChain.h +++ b/include/clang/Driver/ToolChain.h @@ -68,18 +68,21 @@ public: // Tool access. - /// TranslateArgs - Create a new derived argument list for any - /// argument translations this ToolChain may wish to perform. - virtual DerivedArgList *TranslateArgs(InputArgList &Args) const = 0; + /// TranslateArgs - Create a new derived argument list for any argument + /// translations this ToolChain may wish to perform. + /// + /// \param BoundArch - The bound architecture name, or 0. + virtual DerivedArgList *TranslateArgs(InputArgList &Args, + const char *BoundArch) const = 0; /// SelectTool - Choose a tool to use to handle the action \arg JA. virtual Tool &SelectTool(const Compilation &C, const JobAction &JA) const = 0; // Helper methods - llvm::sys::Path GetFilePath(const Compilation &C, const char *Name) const; - llvm::sys::Path GetProgramPath(const Compilation &C, const char *Name, - bool WantFile = false) const; + std::string GetFilePath(const Compilation &C, const char *Name) const; + std::string GetProgramPath(const Compilation &C, const char *Name, + bool WantFile = false) const; // Platform defaults information diff --git a/include/clang/Driver/Types.def b/include/clang/Driver/Types.def index 8d24e50..e01a04c 100644 --- a/include/clang/Driver/Types.def +++ b/include/clang/Driver/Types.def @@ -67,8 +67,9 @@ TYPE("f95-cpp-input", Fortran, PP_Fortran, 0, "u") TYPE("java", Java, INVALID, 0, "u") // Misc. -TYPE("llvm-asm", LLVMAsm, INVALID, "s", "") -TYPE("llvm-bc", LLVMBC, INVALID, "o", "") +TYPE("ast", AST, INVALID, "ast", "u") +TYPE("llvm-asm", LLVMAsm, INVALID, "s", "") +TYPE("llvm-bc", LLVMBC, INVALID, "o", "") TYPE("plist", Plist, INVALID, "plist", "") TYPE("precompiled-header", PCH, INVALID, "gch", "A") TYPE("object", Object, INVALID, "o", "") |