]> granicus.if.org Git - clang/commitdiff
Eliminate DefaultImageName from the Driver constructor
authorAlp Toker <alp@nuanti.com>
Thu, 15 May 2014 22:26:36 +0000 (22:26 +0000)
committerAlp Toker <alp@nuanti.com>
Thu, 15 May 2014 22:26:36 +0000 (22:26 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208926 91177308-0d34-0410-b5e6-96231b3b80d8

examples/clang-interpreter/main.cpp
include/clang/Driver/Driver.h
lib/Driver/Driver.cpp
lib/Frontend/CreateInvocationFromCommandLine.cpp
lib/Tooling/CompilationDatabase.cpp
lib/Tooling/Tooling.cpp
tools/driver/driver.cpp

index 713a650b90b5b8e87eb351fd463ca83c54ef204d..0f083c151434b0ce9da04e2ee462873e44da8a00 100644 (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
index 269bc1ad6b183c793f89b7fb586b77cb7fe6209a..df974ad1d760586405b84ecb21746eedd5b50904 100644 (file)
@@ -193,7 +193,6 @@ private:
 public:
   Driver(StringRef _ClangExecutable,
          StringRef _DefaultTargetTriple,
-         StringRef _DefaultImageName,
          DiagnosticsEngine &_Diags);
   ~Driver();
 
index 44c41b6b69453cedc84e3aa640d9ca3ae7d2a43e..67ead619f748f349b47fd2615a3176ae2dd06c1f 100644 (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),
index ededf9a7577e3c212f35d16e535887164c459078..f108e55b574a65438df4ba34e771784f8284b04e 100644 (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);
index a70e066d296bc83f50e9bd9bf26c814317670027..164a38d4232393abf3cdd28b6e0e557214b0757b 100644 (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
index 5f4c46d6ef3d7ba8989778a00f1512e909fbed77..610bfc8f26957663ec2927a675f1db427ada83df 100644 (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;
 }
index beb271f810e54e6c33a4dd759a09396b4b534afd..fd135554a63a85977ee5f7b40c1e3120e59a6c0b 100644 (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