Remove HostInfo::useDriverDriver(). This was only used in two places

inside the innards of the Driver implementation, and only ever
implemented to return 'true' for the Darwin OSes. Instead use a more
direct query on the target triple and a comment to document why the
target matters here.

If anyone is worried about this predicate getting wider use or improper
use, I can make it a local or private predicate in the driver.

llvm-svn: 148797
This commit is contained in:
Chandler Carruth 2012-01-24 10:43:44 +00:00
parent 4d73703ffd
commit 7f1417f7cf
3 changed files with 6 additions and 74 deletions

View File

@ -43,10 +43,6 @@ public:
std::string getPlatformName() const { return Triple.getVendorName(); }
std::string getOSName() const { return Triple.getOSName(); }
/// useDriverDriver - Whether the driver should act as a driver driver for
/// this host and support -arch, -Xarch, etc.
virtual bool useDriverDriver() const = 0;
/// CreateToolChain - Construct the toolchain to use for this host (which the
/// host retains ownership of).
///

View File

@ -348,8 +348,9 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
InputList Inputs;
BuildInputs(C->getDefaultToolChain(), C->getArgs(), Inputs);
// Construct the list of abstract actions to perform for this compilation.
if (Host->useDriverDriver())
// Construct the list of abstract actions to perform for this compilation. On
// Darwin target OSes this uses the driver-driver and universal actions.
if (TargetTriple.isOSDarwin())
BuildUniversalActions(C->getDefaultToolChain(), C->getArgs(),
Inputs, C->getActions());
else
@ -437,8 +438,9 @@ void Driver::generateCompilationDiagnostics(Compilation &C,
return;
}
// Construct the list of abstract actions to perform for this compilation.
if (Host->useDriverDriver())
// Construct the list of abstract actions to perform for this compilation. On
// Darwin OSes this uses the driver-driver and builds universal actions.
if (TargetTriple.isOSDarwin())
BuildUniversalActions(C.getDefaultToolChain(), C.getArgs(),
Inputs, C.getActions());
else

View File

@ -45,8 +45,6 @@ public:
DarwinHostInfo(const Driver &D, const llvm::Triple &Triple);
~DarwinHostInfo();
virtual bool useDriverDriver() const;
virtual ToolChain *CreateToolChain(const ArgList &Args,
const char *ArchName) const;
};
@ -61,10 +59,6 @@ DarwinHostInfo::~DarwinHostInfo() {
delete it->second;
}
bool DarwinHostInfo::useDriverDriver() const {
return true;
}
ToolChain *DarwinHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
llvm::Triple::ArchType Arch;
@ -132,8 +126,6 @@ public:
TCEHostInfo(const Driver &D, const llvm::Triple &Triple);
~TCEHostInfo() {}
virtual bool useDriverDriver() const;
virtual ToolChain *CreateToolChain(const ArgList &Args,
const char *ArchName) const;
};
@ -142,10 +134,6 @@ TCEHostInfo::TCEHostInfo(const Driver &D, const llvm::Triple& Triple)
: HostInfo(D, Triple) {
}
bool TCEHostInfo::useDriverDriver() const {
return false;
}
ToolChain *TCEHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
llvm::Triple TCTriple(getTriple());
@ -165,8 +153,6 @@ public:
UnknownHostInfo(const Driver &D, const llvm::Triple& Triple);
~UnknownHostInfo();
virtual bool useDriverDriver() const;
virtual ToolChain *CreateToolChain(const ArgList &Args,
const char *ArchName) const;
};
@ -181,10 +167,6 @@ UnknownHostInfo::~UnknownHostInfo() {
delete it->second;
}
bool UnknownHostInfo::useDriverDriver() const {
return false;
}
ToolChain *UnknownHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
assert(!ArchName &&
@ -228,8 +210,6 @@ public:
: HostInfo(D, Triple) {}
~OpenBSDHostInfo();
virtual bool useDriverDriver() const;
virtual ToolChain *CreateToolChain(const ArgList &Args,
const char *ArchName) const;
};
@ -240,10 +220,6 @@ OpenBSDHostInfo::~OpenBSDHostInfo() {
delete it->second;
}
bool OpenBSDHostInfo::useDriverDriver() const {
return false;
}
ToolChain *OpenBSDHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
assert(!ArchName &&
@ -275,8 +251,6 @@ public:
: HostInfo(D, Triple) {}
~AuroraUXHostInfo();
virtual bool useDriverDriver() const;
virtual ToolChain *CreateToolChain(const ArgList &Args,
const char *ArchName) const;
};
@ -287,10 +261,6 @@ AuroraUXHostInfo::~AuroraUXHostInfo() {
delete it->second;
}
bool AuroraUXHostInfo::useDriverDriver() const {
return false;
}
ToolChain *AuroraUXHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
assert(!ArchName &&
@ -320,8 +290,6 @@ public:
: HostInfo(D, Triple) {}
~FreeBSDHostInfo();
virtual bool useDriverDriver() const;
virtual ToolChain *CreateToolChain(const ArgList &Args,
const char *ArchName) const;
};
@ -332,10 +300,6 @@ FreeBSDHostInfo::~FreeBSDHostInfo() {
delete it->second;
}
bool FreeBSDHostInfo::useDriverDriver() const {
return false;
}
ToolChain *FreeBSDHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
assert(!ArchName &&
@ -379,8 +343,6 @@ public:
: HostInfo(D, Triple) {}
~NetBSDHostInfo();
virtual bool useDriverDriver() const;
virtual ToolChain *CreateToolChain(const ArgList &Args,
const char *ArchName) const;
};
@ -391,10 +353,6 @@ NetBSDHostInfo::~NetBSDHostInfo() {
delete it->second;
}
bool NetBSDHostInfo::useDriverDriver() const {
return false;
}
ToolChain *NetBSDHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
assert(!ArchName &&
@ -443,8 +401,6 @@ public:
: HostInfo(D, Triple) {}
~MinixHostInfo();
virtual bool useDriverDriver() const;
virtual ToolChain *CreateToolChain(const ArgList &Args,
const char *ArchName) const;
};
@ -456,10 +412,6 @@ MinixHostInfo::~MinixHostInfo() {
}
}
bool MinixHostInfo::useDriverDriver() const {
return false;
}
ToolChain *MinixHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
assert(!ArchName &&
@ -491,8 +443,6 @@ public:
: HostInfo(D, Triple) {}
~DragonFlyHostInfo();
virtual bool useDriverDriver() const;
virtual ToolChain *CreateToolChain(const ArgList &Args,
const char *ArchName) const;
};
@ -503,10 +453,6 @@ DragonFlyHostInfo::~DragonFlyHostInfo() {
delete it->second;
}
bool DragonFlyHostInfo::useDriverDriver() const {
return false;
}
ToolChain *DragonFlyHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
assert(!ArchName &&
@ -536,8 +482,6 @@ public:
: HostInfo(D, Triple) {}
~LinuxHostInfo();
virtual bool useDriverDriver() const;
virtual ToolChain *CreateToolChain(const ArgList &Args,
const char *ArchName) const;
};
@ -548,10 +492,6 @@ LinuxHostInfo::~LinuxHostInfo() {
delete it->second;
}
bool LinuxHostInfo::useDriverDriver() const {
return false;
}
ToolChain *LinuxHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
@ -601,8 +541,6 @@ public:
WindowsHostInfo(const Driver &D, const llvm::Triple& Triple);
~WindowsHostInfo();
virtual bool useDriverDriver() const;
virtual types::ID lookupTypeForExtension(const char *Ext) const {
return types::lookupTypeForExtension(Ext);
}
@ -621,10 +559,6 @@ WindowsHostInfo::~WindowsHostInfo() {
delete it->second;
}
bool WindowsHostInfo::useDriverDriver() const {
return false;
}
ToolChain *WindowsHostInfo::CreateToolChain(const ArgList &Args,
const char *ArchName) const {
assert(!ArchName &&