diff options
Diffstat (limited to 'include/clang/Driver')
-rw-r--r-- | include/clang/Driver/Action.h | 2 | ||||
-rw-r--r-- | include/clang/Driver/ArgList.h | 2 | ||||
-rw-r--r-- | include/clang/Driver/Compilation.h | 33 | ||||
-rw-r--r-- | include/clang/Driver/Driver.h | 8 | ||||
-rw-r--r-- | include/clang/Driver/HostInfo.h | 2 | ||||
-rw-r--r-- | include/clang/Driver/Job.h | 10 | ||||
-rw-r--r-- | include/clang/Driver/Options.def | 5 |
7 files changed, 45 insertions, 17 deletions
diff --git a/include/clang/Driver/Action.h b/include/clang/Driver/Action.h index b9bf671db2bd..ceef189f7b7e 100644 --- a/include/clang/Driver/Action.h +++ b/include/clang/Driver/Action.h @@ -75,6 +75,8 @@ protected: public: virtual ~Action(); + const char *getClassName() const { return Action::getClassName(getKind()); } + ActionClass getKind() const { return Kind; } types::ID getType() const { return Type; } diff --git a/include/clang/Driver/ArgList.h b/include/clang/Driver/ArgList.h index 84e0329a375e..a9c890b0b899 100644 --- a/include/clang/Driver/ArgList.h +++ b/include/clang/Driver/ArgList.h @@ -83,6 +83,8 @@ namespace driver { /// \arg Claim Whether the argument should be claimed, if it exists. Arg *getLastArg(options::ID Id, bool Claim=true) const; Arg *getLastArg(options::ID Id0, options::ID Id1, bool Claim=true) const; + Arg *getLastArg(options::ID Id0, options::ID Id1, options::ID Id2, + bool Claim=true) const; /// getArgString - Return the input argument string at \arg Index. virtual const char *getArgString(unsigned Index) const = 0; diff --git a/include/clang/Driver/Compilation.h b/include/clang/Driver/Compilation.h index 4985f30ad553..6414ef13692b 100644 --- a/include/clang/Driver/Compilation.h +++ b/include/clang/Driver/Compilation.h @@ -32,10 +32,10 @@ namespace driver { /// invocation. class Compilation { /// The driver we were created by. - Driver &TheDriver; + const Driver &TheDriver; /// The default tool chain. - ToolChain &DefaultToolChain; + const ToolChain &DefaultToolChain; /// The original (untranslated) input argument list. InputArgList *Args; @@ -56,7 +56,8 @@ class Compilation { ArgStringList ResultFiles; public: - Compilation(Driver &D, ToolChain &DefaultToolChain, InputArgList *Args); + Compilation(const Driver &D, const ToolChain &DefaultToolChain, + InputArgList *Args); ~Compilation(); const Driver &getDriver() const { return TheDriver; } @@ -69,6 +70,11 @@ public: const ActionList &getActions() const { return Actions; } JobList &getJobs() { return Jobs; } + const JobList &getJobs() const { return Jobs; } + + const ArgStringList &getTempFiles() const { return TempFiles; } + + const ArgStringList &getResultFiles() const { return ResultFiles; } /// getArgsForToolChain - Return the derived argument list for the /// tool chain \arg TC (or the default tool chain, if TC is not @@ -89,11 +95,6 @@ public: return Name; } - /// Execute - Execute the compilation jobs and return an - /// appropriate exit code. - int Execute() const; - -private: /// CleanupFileList - Remove the files in the given list. /// /// \param IssueErrors - Report failures as errors. @@ -103,22 +104,26 @@ private: /// PrintJob - Print one job in -### format. /// - /// OS - The stream to print on. - /// J - The job to print. - /// Terminator - A string to print at the end of the line. - /// Quote - Should separate arguments be quoted. + /// \param OS - The stream to print on. + /// \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, const char *Terminator, bool Quote) const; /// ExecuteCommand - Execute an actual command. /// + /// \param FailingCommand - For non-zero results, this will be set to the + /// Command which failed, if any. /// \return The result code of the subprocess. - int ExecuteCommand(const Command &C) const; + int ExecuteCommand(const Command &C, const Command *&FailingCommand) const; /// ExecuteJob - Execute a single job. /// + /// \param FailingCommand - For non-zero results, this will be set to the + /// Command which failed. /// \return The accumulated result code of the job. - int ExecuteJob(const Job &J) const; + int ExecuteJob(const Job &J, const Command *&FailingCommand) const; }; } // end namespace driver diff --git a/include/clang/Driver/Driver.h b/include/clang/Driver/Driver.h index 66e3b9787594..c0def2bcca29 100644 --- a/include/clang/Driver/Driver.h +++ b/include/clang/Driver/Driver.h @@ -161,6 +161,14 @@ public: /// \arg C - The compilation that is being built. void BuildJobs(Compilation &C) const; + /// ExecuteCompilation - Execute the compilation according to the command line + /// arguments and return an appropriate exit code. + /// + /// This routine handles additional processing that must be done in addition + /// to just running the subprocesses, for example reporting errors, removing + /// temporary files, etc. + int ExecuteCompilation(const Compilation &C) const; + /// @} /// @name Helper Methods /// @{ diff --git a/include/clang/Driver/HostInfo.h b/include/clang/Driver/HostInfo.h index 3485f5fbfd76..b5e80b0c3bfe 100644 --- a/include/clang/Driver/HostInfo.h +++ b/include/clang/Driver/HostInfo.h @@ -69,6 +69,8 @@ public: const HostInfo *createDarwinHostInfo(const Driver &D, const llvm::Triple& Triple); +const HostInfo *createOpenBSDHostInfo(const Driver &D, + const llvm::Triple& Triple); const HostInfo *createFreeBSDHostInfo(const Driver &D, const llvm::Triple& Triple); const HostInfo *createDragonFlyHostInfo(const Driver &D, diff --git a/include/clang/Driver/Job.h b/include/clang/Driver/Job.h index f60f5146414c..a23babdbb31a 100644 --- a/include/clang/Driver/Job.h +++ b/include/clang/Driver/Job.h @@ -52,6 +52,9 @@ public: /// Command - An executable path/name and argument vector to /// execute. class Command : public Job { + /// Source - The action which caused the creation of this job. + const Action &Source; + /// The executable to run. const char *Executable; @@ -60,9 +63,14 @@ class Command : public Job { ArgStringList Arguments; public: - Command(const char *_Executable, const ArgStringList &_Arguments); + Command(const Action &_Source, const char *_Executable, + const ArgStringList &_Arguments); + + /// getSource - Return the Action which caused the creation of this job. + const Action &getSource() const { return Source; } const char *getExecutable() const { return Executable; } + const ArgStringList &getArguments() const { return Arguments; } static bool classof(const Job *J) { diff --git a/include/clang/Driver/Options.def b/include/clang/Driver/Options.def index abd07a92b1a2..af108a85ebdd 100644 --- a/include/clang/Driver/Options.def +++ b/include/clang/Driver/Options.def @@ -420,7 +420,7 @@ OPTION("-fno-math-errno", fno_math_errno, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-pascal-strings", fno_pascal_strings, 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, clang_ignored_f_Group, INVALID, "", 0, 0, 0) +OPTION("-fno-stack-protector", fno_stack_protector, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-strict-aliasing", fno_strict_aliasing, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-unit-at-a-time", fno_unit_at_a_time, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-unwind-tables", fno_unwind_tables, Flag, f_Group, INVALID, "", 0, 0, 0) @@ -450,7 +450,8 @@ OPTION("-framework", framework, Separate, INVALID, INVALID, "l", 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) -OPTION("-fstack-protector", fstack_protector, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0) +OPTION("-fstack-protector-all", fstack_protector_all, Flag, f_Group, INVALID, "", 0, 0, 0) +OPTION("-fstack-protector", fstack_protector, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fstrict-aliasing", fstrict_aliasing, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0) OPTION("-fsyntax-only", fsyntax_only, Flag, INVALID, INVALID, "d", 0, 0, 0) OPTION("-ftemplate-depth-", ftemplate_depth_, Joined, f_Group, INVALID, "", 0, 0, 0) |