diff options
author | dim <dim@FreeBSD.org> | 2014-03-21 17:53:59 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-03-21 17:53:59 +0000 |
commit | 9cedb8bb69b89b0f0c529937247a6a80cabdbaec (patch) | |
tree | c978f0e9ec1ab92dc8123783f30b08a7fd1e2a39 /contrib/llvm/tools/clang/lib/Driver/Tools.h | |
parent | 03fdc2934eb61c44c049a02b02aa974cfdd8a0eb (diff) | |
download | FreeBSD-src-9cedb8bb69b89b0f0c529937247a6a80cabdbaec.zip FreeBSD-src-9cedb8bb69b89b0f0c529937247a6a80cabdbaec.tar.gz |
MFC 261991:
Upgrade our copy of llvm/clang to 3.4 release. This version supports
all of the features in the current working draft of the upcoming C++
standard, provisionally named C++1y.
The code generator's performance is greatly increased, and the loop
auto-vectorizer is now enabled at -Os and -O2 in addition to -O3. The
PowerPC backend has made several major improvements to code generation
quality and compile time, and the X86, SPARC, ARM32, Aarch64 and SystemZ
backends have all seen major feature work.
Release notes for llvm and clang can be found here:
<http://llvm.org/releases/3.4/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.4/tools/clang/docs/ReleaseNotes.html>
MFC 262121 (by emaste):
Update lldb for clang/llvm 3.4 import
This commit largely restores the lldb source to the upstream r196259
snapshot with the addition of threaded inferior support and a few bug
fixes.
Specific upstream lldb revisions restored include:
SVN git
181387 779e6ac
181703 7bef4e2
182099 b31044e
182650 f2dcf35
182683 0d91b80
183862 15c1774
183929 99447a6
184177 0b2934b
184948 4dc3761
184954 007e7bc
186990 eebd175
Sponsored by: DARPA, AFRL
MFC 262186 (by emaste):
Fix mismerge in r262121
A break statement was lost in the merge. The error had no functional
impact, but restore it to reduce the diff against upstream.
MFC 262303:
Pull in r197521 from upstream clang trunk (by rdivacky):
Use the integrated assembler by default on FreeBSD/ppc and ppc64.
Requested by: jhibbits
MFC 262611:
Pull in r196874 from upstream llvm trunk:
Fix a crash that occurs when PWD is invalid.
MCJIT needs to be able to run in hostile environments, even when PWD
is invalid. There's no need to crash MCJIT in this case.
The obvious fix is to simply leave MCContext's CompilationDir empty
when PWD can't be determined. This way, MCJIT clients,
and other clients that link with LLVM don't need a valid working directory.
If we do want to guarantee valid CompilationDir, that should be done
only for clients of getCompilationDir(). This is as simple as checking
for an empty string.
The only current use of getCompilationDir is EmitGenDwarfInfo, which
won't conceivably run with an invalid working dir. However, in the
purely hypothetically and untestable case that this happens, the
AT_comp_dir will be omitted from the compilation_unit DIE.
This should help fix assertions occurring with ports-mgmt/tinderbox,
when it is using jails, and sometimes invalidates clang's current
working directory.
Reported by: decke
MFC 262809:
Pull in r203007 from upstream clang trunk:
Don't produce an alias between destructors with different calling conventions.
Fixes pr19007.
(Please note that is an LLVM PR identifier, not a FreeBSD one.)
This should fix Firefox and/or libxul crashes (due to problems with
regparm/stdcall calling conventions) on i386.
Reported by: multiple users on freebsd-current
PR: bin/187103
MFC 263048:
Repair recognition of "CC" as an alias for the C++ compiler, since it
was silently broken by upstream for a Windows-specific use-case.
Apparently some versions of CMake still rely on this archaic feature...
Reported by: rakuco
MFC 263049:
Garbage collect the old way of adding the libstdc++ include directories
in clang's InitHeaderSearch.cpp. This has been superseded by David
Chisnall's commit in r255321.
Moreover, if libc++ is used, the libstdc++ include directories should
not be in the search path at all. These directories are now only used
if you pass -stdlib=libstdc++.
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Driver/Tools.h')
-rw-r--r-- | contrib/llvm/tools/clang/lib/Driver/Tools.h | 188 |
1 files changed, 128 insertions, 60 deletions
diff --git a/contrib/llvm/tools/clang/lib/Driver/Tools.h b/contrib/llvm/tools/clang/lib/Driver/Tools.h index d647171..d5b2848 100644 --- a/contrib/llvm/tools/clang/lib/Driver/Tools.h +++ b/contrib/llvm/tools/clang/lib/Driver/Tools.h @@ -14,12 +14,14 @@ #include "clang/Driver/Types.h" #include "clang/Driver/Util.h" #include "llvm/ADT/Triple.h" +#include "llvm/Option/Option.h" #include "llvm/Support/Compiler.h" namespace clang { class ObjCRuntime; namespace driver { + class Command; class Driver; namespace toolchains { @@ -27,40 +29,53 @@ namespace toolchains { } namespace tools { +using llvm::opt::ArgStringList; /// \brief Clang compiler tool. class LLVM_LIBRARY_VISIBILITY Clang : public Tool { public: - static const char *getBaseInputName(const ArgList &Args, + static const char *getBaseInputName(const llvm::opt::ArgList &Args, const InputInfoList &Inputs); - static const char *getBaseInputStem(const ArgList &Args, + static const char *getBaseInputStem(const llvm::opt::ArgList &Args, const InputInfoList &Inputs); - static const char *getDependencyFileName(const ArgList &Args, + static const char *getDependencyFileName(const llvm::opt::ArgList &Args, const InputInfoList &Inputs); private: - void AddPreprocessingOptions(Compilation &C, - const JobAction &JA, + void AddPreprocessingOptions(Compilation &C, const JobAction &JA, const Driver &D, - const ArgList &Args, - ArgStringList &CmdArgs, + const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs, const InputInfo &Output, const InputInfoList &Inputs) const; - void AddARMTargetArgs(const ArgList &Args, ArgStringList &CmdArgs, + void AddAArch64TargetArgs(const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs) const; + void AddARMTargetArgs(const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs, bool KernelOrKext) const; - void AddMIPSTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; - void AddPPCTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; - void AddR600TargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; - void AddSparcTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; - void AddX86TargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; - void AddHexagonTargetArgs (const ArgList &Args, ArgStringList &CmdArgs) const; + void AddMIPSTargetArgs(const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs) const; + void AddR600TargetArgs(const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs) const; + void AddSparcTargetArgs(const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs) const; + void AddSystemZTargetArgs(const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs) const; + void AddX86TargetArgs(const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs) const; + void AddHexagonTargetArgs(const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs) const; enum RewriteKind { RK_None, RK_Fragile, RK_NonFragile }; - ObjCRuntime AddObjCRuntimeArgs(const ArgList &args, ArgStringList &cmdArgs, + ObjCRuntime AddObjCRuntimeArgs(const llvm::opt::ArgList &args, + llvm::opt::ArgStringList &cmdArgs, RewriteKind rewrite) const; + void AddClangCLArgs(const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs) const; + public: Clang(const ToolChain &TC) : Tool("clang", "clang frontend", TC) {} @@ -71,14 +86,12 @@ namespace tools { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; /// \brief Clang integrated assembler tool. class LLVM_LIBRARY_VISIBILITY ClangAs : public Tool { - void AddARMTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; - void AddX86TargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; public: ClangAs(const ToolChain &TC) : Tool("clang::as", "clang integrated assembler", TC) {} @@ -90,7 +103,7 @@ namespace tools { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; @@ -104,16 +117,16 @@ namespace gcc { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; /// RenderExtraToolArgs - Render any arguments necessary to force /// the particular tool mode. - virtual void RenderExtraToolArgs(const JobAction &JA, - ArgStringList &CmdArgs) const = 0; + virtual void + RenderExtraToolArgs(const JobAction &JA, + llvm::opt::ArgStringList &CmdArgs) const = 0; }; - class LLVM_LIBRARY_VISIBILITY Preprocess : public Common { public: Preprocess(const ToolChain &TC) : Common("gcc::Preprocess", @@ -123,7 +136,7 @@ namespace gcc { virtual bool hasIntegratedCPP() const { return false; } virtual void RenderExtraToolArgs(const JobAction &JA, - ArgStringList &CmdArgs) const; + llvm::opt::ArgStringList &CmdArgs) const; }; class LLVM_LIBRARY_VISIBILITY Precompile : public Common { @@ -135,7 +148,7 @@ namespace gcc { virtual bool hasIntegratedCPP() const { return true; } virtual void RenderExtraToolArgs(const JobAction &JA, - ArgStringList &CmdArgs) const; + llvm::opt::ArgStringList &CmdArgs) const; }; class LLVM_LIBRARY_VISIBILITY Compile : public Common { @@ -147,7 +160,7 @@ namespace gcc { virtual bool hasIntegratedCPP() const { return true; } virtual void RenderExtraToolArgs(const JobAction &JA, - ArgStringList &CmdArgs) const; + llvm::opt::ArgStringList &CmdArgs) const; }; class LLVM_LIBRARY_VISIBILITY Assemble : public Common { @@ -158,7 +171,7 @@ namespace gcc { virtual bool hasIntegratedCPP() const { return false; } virtual void RenderExtraToolArgs(const JobAction &JA, - ArgStringList &CmdArgs) const; + llvm::opt::ArgStringList &CmdArgs) const; }; class LLVM_LIBRARY_VISIBILITY Link : public Common { @@ -170,7 +183,7 @@ namespace gcc { virtual bool isLinkJob() const { return true; } virtual void RenderExtraToolArgs(const JobAction &JA, - ArgStringList &CmdArgs) const; + llvm::opt::ArgStringList &CmdArgs) const; }; } // end namespace gcc @@ -185,11 +198,11 @@ namespace hexagon { virtual bool hasIntegratedCPP() const { return false; } virtual void RenderExtraToolArgs(const JobAction &JA, - ArgStringList &CmdArgs) const; + llvm::opt::ArgStringList &CmdArgs) const; virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; @@ -202,11 +215,11 @@ namespace hexagon { virtual bool isLinkJob() const { return true; } virtual void RenderExtraToolArgs(const JobAction &JA, - ArgStringList &CmdArgs) const; + llvm::opt::ArgStringList &CmdArgs) const; virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; } // end namespace hexagon. @@ -218,7 +231,8 @@ namespace darwin { class LLVM_LIBRARY_VISIBILITY DarwinTool : public Tool { virtual void anchor(); protected: - void AddDarwinArch(const ArgList &Args, ArgStringList &CmdArgs) const; + void AddDarwinArch(const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs) const; const toolchains::Darwin &getDarwinToolChain() const { return reinterpret_cast<const toolchains::Darwin&>(getToolChain()); @@ -239,14 +253,15 @@ namespace darwin { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; class LLVM_LIBRARY_VISIBILITY Link : public DarwinTool { bool NeedsTempPath(const InputInfoList &Inputs) const; - void AddLinkArgs(Compilation &C, const ArgList &Args, - ArgStringList &CmdArgs, const InputInfoList &Inputs) const; + void AddLinkArgs(Compilation &C, const llvm::opt::ArgList &Args, + llvm::opt::ArgStringList &CmdArgs, + const InputInfoList &Inputs) const; public: Link(const ToolChain &TC) : DarwinTool("darwin::Link", "linker", TC) {} @@ -257,7 +272,7 @@ namespace darwin { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; @@ -270,7 +285,7 @@ namespace darwin { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; @@ -285,7 +300,7 @@ namespace darwin { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; @@ -299,7 +314,7 @@ namespace darwin { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; @@ -317,7 +332,7 @@ namespace openbsd { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; class LLVM_LIBRARY_VISIBILITY Link : public Tool { @@ -330,7 +345,7 @@ namespace openbsd { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; } // end namespace openbsd @@ -347,7 +362,7 @@ namespace bitrig { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; class LLVM_LIBRARY_VISIBILITY Link : public Tool { @@ -360,7 +375,7 @@ namespace bitrig { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; } // end namespace bitrig @@ -377,7 +392,7 @@ namespace freebsd { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; class LLVM_LIBRARY_VISIBILITY Link : public Tool { @@ -390,7 +405,7 @@ namespace freebsd { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; } // end namespace freebsd @@ -408,7 +423,7 @@ namespace netbsd { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; class LLVM_LIBRARY_VISIBILITY Link : public Tool { @@ -423,7 +438,7 @@ namespace netbsd { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; } // end namespace netbsd @@ -439,7 +454,7 @@ namespace gnutools { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; class LLVM_LIBRARY_VISIBILITY Link : public Tool { @@ -452,7 +467,7 @@ namespace gnutools { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; } @@ -468,7 +483,7 @@ namespace minix { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; class LLVM_LIBRARY_VISIBILITY Link : public Tool { @@ -481,7 +496,7 @@ namespace minix { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; } // end namespace minix @@ -498,7 +513,7 @@ namespace solaris { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; class LLVM_LIBRARY_VISIBILITY Link : public Tool { @@ -511,7 +526,7 @@ namespace solaris { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; } // end namespace solaris @@ -528,7 +543,7 @@ namespace auroraux { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; class LLVM_LIBRARY_VISIBILITY Link : public Tool { @@ -541,7 +556,7 @@ namespace auroraux { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; } // end namespace auroraux @@ -558,7 +573,7 @@ namespace dragonfly { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; class LLVM_LIBRARY_VISIBILITY Link : public Tool { @@ -571,14 +586,14 @@ namespace dragonfly { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; }; } // end namespace dragonfly /// Visual studio tools. namespace visualstudio { - class LLVM_LIBRARY_VISIBILITY Link : public Tool { + class LLVM_LIBRARY_VISIBILITY Link : public Tool { public: Link(const ToolChain &TC) : Tool("visualstudio::Link", "linker", TC) {} @@ -588,11 +603,64 @@ namespace visualstudio { virtual void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, - const ArgList &TCArgs, + const llvm::opt::ArgList &TCArgs, + const char *LinkingOutput) const; + }; + + class LLVM_LIBRARY_VISIBILITY Compile : public Tool { + public: + Compile(const ToolChain &TC) : Tool("visualstudio::Compile", "compiler", TC) {} + + virtual bool hasIntegratedAssembler() const { return true; } + virtual bool hasIntegratedCPP() const { return true; } + virtual bool isLinkJob() const { return false; } + + virtual void ConstructJob(Compilation &C, const JobAction &JA, + const InputInfo &Output, + const InputInfoList &Inputs, + const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const; + + Command *GetCommand(Compilation &C, const JobAction &JA, + const InputInfo &Output, + const InputInfoList &Inputs, + const llvm::opt::ArgList &TCArgs, + const char *LinkingOutput) const; }; } // end namespace visualstudio +namespace XCore { + // For XCore, we do not need to instantiate tools for PreProcess, PreCompile and Compile. + // We simply use "clang -cc1" for those actions. + class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { + public: + Assemble(const ToolChain &TC) : Tool("XCore::Assemble", + "XCore-as", TC) {} + + virtual bool hasIntegratedCPP() const { return false; } + virtual void ConstructJob(Compilation &C, const JobAction &JA, + const InputInfo &Output, + const InputInfoList &Inputs, + const llvm::opt::ArgList &TCArgs, + const char *LinkingOutput) const; + }; + + class LLVM_LIBRARY_VISIBILITY Link : public Tool { + public: + Link(const ToolChain &TC) : Tool("XCore::Link", + "XCore-ld", TC) {} + + virtual bool hasIntegratedCPP() const { return false; } + virtual bool isLinkJob() const { return true; } + virtual void ConstructJob(Compilation &C, const JobAction &JA, + const InputInfo &Output, + const InputInfoList &Inputs, + const llvm::opt::ArgList &TCArgs, + const char *LinkingOutput) const; + }; +} // end namespace XCore. + + } // end namespace toolchains } // end namespace driver } // end namespace clang |