Rename Darwin_X86 toolchain to just Darwin, this can support all platforms.

llvm-svn: 81016
This commit is contained in:
Daniel Dunbar 2009-09-04 18:34:51 +00:00
parent bddb73fa1d
commit f0a5b9b126
5 changed files with 23 additions and 26 deletions

View File

@ -157,9 +157,9 @@ ToolChain *DarwinHostInfo::getToolChain(const ArgList &Args,
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);
}

View File

@ -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 @@ Darwin_X86::Darwin_X86(const HostInfo &Host, const llvm::Triple& Triple,
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 @@ Tool &Darwin_X86::SelectTool(const Compilation &C,
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 @@ DerivedArgList *Darwin_X86::TranslateArgs(InputArgList &Args) const {
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 @@ Tool &Generic_GCC::SelectTool(const Compilation &C,
return *T;
}
bool Generic_GCC::IsMathErrnoDefault() const {
bool Generic_GCC::IsMathErrnoDefault() const {
return true;
}

View File

@ -43,8 +43,8 @@ public:
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 @@ class VISIBILITY_HIDDEN Darwin_X86 : public ToolChain {
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];

View File

@ -1368,10 +1368,6 @@ static bool isMacosxVersionLT(unsigned (&A)[3],
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.

View File

@ -21,7 +21,7 @@ namespace driver {
class Driver;
namespace toolchains {
class Darwin_X86;
class Darwin;
}
namespace tools {
@ -201,7 +201,9 @@ namespace darwin {
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)