Eliminate DefaultImageName from the Driver constructor

All callers were passing in "a.out" or garbage so a sensible default works fine
here as a cleanup.

This also brings about the possibility of adapting the value based on the
driver's compatibility mode in future.

The setting can still be changed via Driver::DefaultImageName as needed.

llvm-svn: 208926
This commit is contained in:
Alp Toker 2014-05-15 22:26:36 +00:00
parent b0f2f146bb
commit 1761f11801
7 changed files with 8 additions and 12 deletions

View File

@ -75,7 +75,7 @@ int main(int argc, const char **argv, char * const *envp) {
IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagClient);
Driver TheDriver(Path, llvm::sys::getProcessTriple(), "a.out", Diags);
Driver TheDriver(Path, llvm::sys::getProcessTriple(), Diags);
TheDriver.setTitle("clang interpreter");
// FIXME: This is a hack to try to force the driver to do something we can

View File

@ -193,7 +193,6 @@ private:
public:
Driver(StringRef _ClangExecutable,
StringRef _DefaultTargetTriple,
StringRef _DefaultImageName,
DiagnosticsEngine &_Diags);
~Driver();

View File

@ -47,12 +47,11 @@ using namespace llvm::opt;
Driver::Driver(StringRef ClangExecutable,
StringRef DefaultTargetTriple,
StringRef DefaultImageName,
DiagnosticsEngine &Diags)
: Opts(createDriverOptTable()), Diags(Diags), Mode(GCCMode),
ClangExecutable(ClangExecutable), SysRoot(DEFAULT_SYSROOT),
UseStdLib(true), DefaultTargetTriple(DefaultTargetTriple),
DefaultImageName(DefaultImageName),
DefaultImageName("a.out"),
DriverTitle("clang LLVM compiler"),
CCPrintOptionsFilename(0), CCPrintHeadersFilename(0),
CCLogDiagnosticsFilename(0),

View File

@ -47,7 +47,7 @@ clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList,
// FIXME: We shouldn't have to pass in the path info.
driver::Driver TheDriver("clang", llvm::sys::getDefaultTargetTriple(),
"a.out", *Diags);
*Diags);
// Don't check that inputs exist, they may have been remapped.
TheDriver.setCheckInputsExist(false);

View File

@ -212,11 +212,11 @@ static bool stripPositionalArgs(std::vector<const char *> Args,
IntrusiveRefCntPtr<clang::DiagnosticIDs>(new DiagnosticIDs()),
&*DiagOpts, &DiagClient, false);
// Neither clang executable nor default image name are required since the
// jobs the driver builds will not be executed.
// The clang executable path isn't required since the jobs the driver builds
// will not be executed.
std::unique_ptr<driver::Driver> NewDriver(new driver::Driver(
/* ClangExecutable= */ "", llvm::sys::getDefaultTargetTriple(),
/* DefaultImageName= */ "", Diagnostics));
Diagnostics));
NewDriver->setCheckInputsExist(false);
// This becomes the new argv[0]. The value is actually not important as it

View File

@ -54,10 +54,8 @@ FrontendActionFactory::~FrontendActionFactory() {}
/// \brief Builds a clang driver initialized for running clang tools.
static clang::driver::Driver *newDriver(clang::DiagnosticsEngine *Diagnostics,
const char *BinaryName) {
const char *DefaultOutputName = "a.out";
clang::driver::Driver *CompilerDriver = new clang::driver::Driver(
BinaryName, llvm::sys::getDefaultTargetTriple(),
DefaultOutputName, *Diagnostics);
BinaryName, llvm::sys::getDefaultTargetTriple(), *Diagnostics);
CompilerDriver->setTitle("clang_based_tool");
return CompilerDriver;
}

View File

@ -371,7 +371,7 @@ int main(int argc_, const char **argv_) {
DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagClient);
ProcessWarningOptions(Diags, *DiagOpts, /*ReportDiags=*/false);
Driver TheDriver(Path, llvm::sys::getDefaultTargetTriple(), "a.out", Diags);
Driver TheDriver(Path, llvm::sys::getDefaultTargetTriple(), Diags);
// Attempt to find the original path used to invoke the driver, to determine
// the installed path. We do this manually, because we want to support that