[cfe-commits] r81016 - in /cfe/trunk/lib/Driver: HostInfo.cpp ToolChains.cpp ToolChains.h Tools.cpp Tools.h
Daniel Dunbar
daniel at zuster.org
Fri Sep 4 11:34:52 PDT 2009
Author: ddunbar
Date: Fri Sep 4 13:34:51 2009
New Revision: 81016
URL: http://llvm.org/viewvc/llvm-project?rev=81016&view=rev
Log:
Rename Darwin_X86 toolchain to just Darwin, this can support all platforms.
Modified:
cfe/trunk/lib/Driver/HostInfo.cpp
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/lib/Driver/ToolChains.h
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/lib/Driver/Tools.h
Modified: cfe/trunk/lib/Driver/HostInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/HostInfo.cpp?rev=81016&r1=81015&r2=81016&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/HostInfo.cpp (original)
+++ cfe/trunk/lib/Driver/HostInfo.cpp Fri Sep 4 13:34:51 2009
@@ -157,9 +157,9 @@
TCTriple.setArchName(ArchName);
if (strcmp(ArchName, "i386") == 0 || strcmp(ArchName, "x86_64") == 0)
- TC = new toolchains::Darwin_X86(*this, TCTriple,
- DarwinVersion,
- GCCVersion);
+ TC = new toolchains::Darwin(*this, TCTriple,
+ DarwinVersion,
+ GCCVersion);
else
TC = new toolchains::Darwin_GCC(*this, TCTriple);
}
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=81016&r1=81015&r2=81016&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Fri Sep 4 13:34:51 2009
@@ -25,11 +25,11 @@
using namespace clang::driver;
using namespace clang::driver::toolchains;
-/// Darwin_X86 - Darwin tool chain for i386 and x86_64.
+/// Darwin - Darwin tool chain for i386 and x86_64.
-Darwin_X86::Darwin_X86(const HostInfo &Host, const llvm::Triple& Triple,
- const unsigned (&_DarwinVersion)[3],
- const unsigned (&_GCCVersion)[3])
+Darwin::Darwin(const HostInfo &Host, const llvm::Triple& Triple,
+ const unsigned (&_DarwinVersion)[3],
+ const unsigned (&_GCCVersion)[3])
: ToolChain(Host, Triple) {
DarwinVersion[0] = _DarwinVersion[0];
DarwinVersion[1] = _DarwinVersion[1];
@@ -89,15 +89,14 @@
getProgramPaths().push_back(getHost().getDriver().Dir);
}
-Darwin_X86::~Darwin_X86() {
+Darwin::~Darwin() {
// Free tool implementations.
for (llvm::DenseMap<unsigned, Tool*>::iterator
it = Tools.begin(), ie = Tools.end(); it != ie; ++it)
delete it->second;
}
-Tool &Darwin_X86::SelectTool(const Compilation &C,
- const JobAction &JA) const {
+Tool &Darwin::SelectTool(const Compilation &C, const JobAction &JA) const {
Action::ActionClass Key;
if (getHost().getDriver().ShouldUseClangCompiler(C, JA, getArchName()))
Key = Action::AnalyzeJobClass;
@@ -129,7 +128,7 @@
return *T;
}
-DerivedArgList *Darwin_X86::TranslateArgs(InputArgList &Args) const {
+DerivedArgList *Darwin::TranslateArgs(InputArgList &Args) const {
DerivedArgList *DAL = new DerivedArgList(Args, false);
const OptTable &Opts = getHost().getDriver().getOpts();
@@ -284,21 +283,21 @@
return DAL;
}
-bool Darwin_X86::IsMathErrnoDefault() const {
+bool Darwin::IsMathErrnoDefault() const {
return false;
}
-bool Darwin_X86::IsUnwindTablesDefault() const {
+bool Darwin::IsUnwindTablesDefault() const {
// FIXME: Gross; we should probably have some separate target
// definition, possibly even reusing the one in clang.
return getArchName() == "x86_64";
}
-const char *Darwin_X86::GetDefaultRelocationModel() const {
+const char *Darwin::GetDefaultRelocationModel() const {
return "pic";
}
-const char *Darwin_X86::GetForcedPicModel() const {
+const char *Darwin::GetForcedPicModel() const {
if (getArchName() == "x86_64")
return "pic";
return 0;
@@ -362,7 +361,7 @@
return *T;
}
-bool Generic_GCC::IsMathErrnoDefault() const {
+bool Generic_GCC::IsMathErrnoDefault() const {
return true;
}
Modified: cfe/trunk/lib/Driver/ToolChains.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=81016&r1=81015&r2=81016&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.h (original)
+++ cfe/trunk/lib/Driver/ToolChains.h Fri Sep 4 13:34:51 2009
@@ -43,8 +43,8 @@
virtual const char *GetForcedPicModel() const;
};
- /// Darwin_X86 - Darwin tool chain for i386 an x86_64.
-class VISIBILITY_HIDDEN Darwin_X86 : public ToolChain {
+/// Darwin - Darwin tool chain.
+class VISIBILITY_HIDDEN Darwin : public ToolChain {
mutable llvm::DenseMap<unsigned, Tool*> Tools;
/// Darwin version of tool chain.
@@ -63,10 +63,10 @@
const char *getMacosxVersionMin() const;
public:
- Darwin_X86(const HostInfo &Host, const llvm::Triple& Triple,
+ Darwin(const HostInfo &Host, const llvm::Triple& Triple,
const unsigned (&DarwinVersion)[3],
const unsigned (&GCCVersion)[3]);
- ~Darwin_X86();
+ ~Darwin();
void getDarwinVersion(unsigned (&Res)[3]) const {
Res[0] = DarwinVersion[0];
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=81016&r1=81015&r2=81016&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Sep 4 13:34:51 2009
@@ -1368,10 +1368,6 @@
return isMacosxVersionLT(A, B);
}
-const toolchains::Darwin_X86 &darwin::Link::getDarwinToolChain() const {
- return reinterpret_cast<const toolchains::Darwin_X86&>(getToolChain());
-}
-
void darwin::Link::AddDarwinArch(const ArgList &Args,
ArgStringList &CmdArgs) const {
// Derived from darwin_arch spec.
Modified: cfe/trunk/lib/Driver/Tools.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.h?rev=81016&r1=81015&r2=81016&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.h (original)
+++ cfe/trunk/lib/Driver/Tools.h Fri Sep 4 13:34:51 2009
@@ -21,7 +21,7 @@
class Driver;
namespace toolchains {
- class Darwin_X86;
+ class Darwin;
}
namespace tools {
@@ -201,7 +201,9 @@
void AddDarwinSubArch(const ArgList &Args, ArgStringList &CmdArgs) const;
void AddLinkArgs(const ArgList &Args, ArgStringList &CmdArgs) const;
- const toolchains::Darwin_X86 &getDarwinToolChain() const;
+ const toolchains::Darwin &getDarwinToolChain() const {
+ return reinterpret_cast<const toolchains::Darwin&>(getToolChain());
+ }
public:
Link(const ToolChain &TC)
More information about the cfe-commits
mailing list