diff options
author | Bob Wilson <bob.wilson@apple.com> | 2012-11-23 06:14:39 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2012-11-23 06:14:39 +0000 |
commit | 66b8a6671bb5df540dd7200a5286f7ed7a72c1cc (patch) | |
tree | 7f6dc980f302a3e820746f41a9c986b13fdba8be /lib/Driver/Tools.h | |
parent | 4d9f4e5bfa701fc870e3c481f93f1fcc52d327bb (diff) |
Reapply a subset of r167567 to clean up Darwin-specific code for invoking gcc.
Unlike my previous attempt at this, this patch leaves intact the check for
whether clang can handle the input file type, and for non-Darwin toolchains it
will invoke gcc for things it cannot handle. For Darwin toolchains, the
behavior reported in pr14338 still occurs with this patch, but that is a
definite improvement from what happens currently, where it just crashes with
an assertion failure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168505 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.h')
-rw-r--r-- | lib/Driver/Tools.h | 64 |
1 files changed, 7 insertions, 57 deletions
diff --git a/lib/Driver/Tools.h b/lib/Driver/Tools.h index 5898c660a4..cef7d80d98 100644 --- a/lib/Driver/Tools.h +++ b/lib/Driver/Tools.h @@ -31,6 +31,13 @@ namespace tools { /// \brief Clang compiler tool. class LLVM_LIBRARY_VISIBILITY Clang : public Tool { + static const char *getBaseInputName(const ArgList &Args, + const InputInfoList &Inputs); + static const char *getBaseInputStem(const ArgList &Args, + const InputInfoList &Inputs); + static const char *getDependencyFileName(const ArgList &Args, + const InputInfoList &Inputs); + void AddPreprocessingOptions(Compilation &C, const Driver &D, const ArgList &Args, @@ -218,63 +225,6 @@ namespace darwin { const ToolChain &TC) : Tool(Name, ShortName, TC) {} }; - class LLVM_LIBRARY_VISIBILITY CC1 : public DarwinTool { - virtual void anchor(); - public: - static const char *getBaseInputName(const ArgList &Args, - const InputInfoList &Input); - static const char *getBaseInputStem(const ArgList &Args, - const InputInfoList &Input); - static const char *getDependencyFileName(const ArgList &Args, - const InputInfoList &Inputs); - - protected: - const char *getCC1Name(types::ID Type) const; - - void AddCC1Args(const ArgList &Args, ArgStringList &CmdArgs) const; - void RemoveCC1UnsupportedArgs(ArgStringList &CmdArgs) const; - void AddCC1OptionsArgs(const ArgList &Args, ArgStringList &CmdArgs, - const InputInfoList &Inputs, - const ArgStringList &OutputArgs) const; - void AddCPPOptionsArgs(const ArgList &Args, ArgStringList &CmdArgs, - const InputInfoList &Inputs, - const ArgStringList &OutputArgs) const; - void AddCPPUniqueOptionsArgs(const ArgList &Args, - ArgStringList &CmdArgs, - const InputInfoList &Inputs) const; - void AddCPPArgs(const ArgList &Args, ArgStringList &CmdArgs) const; - - public: - CC1(const char *Name, const char *ShortName, - const ToolChain &TC) : DarwinTool(Name, ShortName, TC) {} - - virtual bool hasGoodDiagnostics() const { return true; } - virtual bool hasIntegratedCPP() const { return true; } - }; - - class LLVM_LIBRARY_VISIBILITY Preprocess : public CC1 { - public: - Preprocess(const ToolChain &TC) : CC1("darwin::Preprocess", - "gcc preprocessor", TC) {} - - virtual void ConstructJob(Compilation &C, const JobAction &JA, - const InputInfo &Output, - const InputInfoList &Inputs, - const ArgList &TCArgs, - const char *LinkingOutput) const; - }; - - class LLVM_LIBRARY_VISIBILITY Compile : public CC1 { - public: - Compile(const ToolChain &TC) : CC1("darwin::Compile", "gcc frontend", TC) {} - - virtual void ConstructJob(Compilation &C, const JobAction &JA, - const InputInfo &Output, - const InputInfoList &Inputs, - const ArgList &TCArgs, - const char *LinkingOutput) const; - }; - class LLVM_LIBRARY_VISIBILITY Assemble : public DarwinTool { public: Assemble(const ToolChain &TC) : DarwinTool("darwin::Assemble", |