Commit Graph

78 Commits

Author SHA1 Message Date
Daniel Dunbar c7fd57a2f3 Driver: Move GetReleaseVersion to static Driver::GetReleaseVersion method.
llvm-svn: 67754
2009-03-26 15:58:36 +00:00
Chris Lattner ada1c91537 hopefully fix VC++ build error.
llvm-svn: 67741
2009-03-26 05:56:24 +00:00
Daniel Dunbar dac54a81df Driver: Prep for tool chain specific argument translation.
- Lift ArgList to a base class for InputArgList and DerivedArgList.
 
 - This is not a great decomposition, but it does embed the
   translation into the type system, and keep things efficient for
   tool chains that don't want to do any translation.

 - No intended functionality change.

Eventually I hope to get rid of tool chain specific translation and
have each tool do the right thing, but for now this is the easiest way
to match gcc precisely (which is good for testing).

llvm-svn: 67676
2009-03-25 04:13:45 +00:00
Daniel Dunbar 1386495406 Driver: Handle -flto, -O4, and tweak -emit-llvm to match llvm-gcc.
- -emit-llvm no longer changes what compilation steps are done.

 - -emit-llvm and -emit-llvm -S write output files with .o and .s
    suffixes, respectively.

 - <rdar://problem/6714125> clang-driver should support -O4 and -flto,
   like llvm-gcc

llvm-svn: 67645
2009-03-24 20:17:30 +00:00
Daniel Dunbar 6b5244d600 Driver: Warn when 'clang' is used to compile a source file we could
conceivably handle, but are defaulting to not using clang for.

llvm-svn: 67641
2009-03-24 19:14:56 +00:00
Daniel Dunbar 88f356e16b Driver: Change default use of "clang" compiler.
- Don't default to using clang for C++ (use -ccc-clang-cxx to
   override).

 - Default to only using clang on i386 and x86_64 (use
   -ccc-clang-archs "" to override).

 - <rdar://problem/6712350> [driver] clang should not be used on
   powerpc by default
 - <rdar://problem/6705767> driver should default to -ccc-no-clang-cxx

I plan to add a warning that we are not using the clang compiler for
the given compilation so that users do not think clang is being used
in situations it isn't.

This change is motivated by the desire to be able to drop clang into a
build and have things "just work", even if it happens to get used to
compile C++ code or code for an architecture we don't support yet.

llvm-svn: 67640
2009-03-24 19:02:31 +00:00
Daniel Dunbar 8fa879d39f Move ToolChain::ShouldUseClangCompiler to
Driver::ShouldUseClangCompiler.
 - No functionality change.

llvm-svn: 67639
2009-03-24 18:57:02 +00:00
Daniel Dunbar 76ce7416ae Driver: Setup file and program search paths in tool chains.
llvm-svn: 67529
2009-03-23 16:15:50 +00:00
Daniel Dunbar d8500f3b0f Driver: Implement 'missing argument' error.
llvm-svn: 67490
2009-03-22 23:26:43 +00:00
Daniel Dunbar ea9f032613 ccc/Driver: .s defaults to 'assembler-with-cpp' on Darwin.
- <rdar://problem/6669441> ccc doesn't handle assembler-with-cpp
   semantics correctly (but clang supports it)

 - This is sad, because it requires a fairly useless target
   hook. C'est la vie.

llvm-svn: 67418
2009-03-20 23:39:23 +00:00
Daniel Dunbar 0e75994e8b Driver: Add Arg::getAsString and use when dumping arguments to
diagnostics.
 - This ensures that the whole argument and values are printed,
   instead of just the option name.

llvm-svn: 67366
2009-03-20 06:14:23 +00:00
Daniel Dunbar d972e2247b Driver: Implement -print-search-dirs.
llvm-svn: 67362
2009-03-20 04:37:21 +00:00
Daniel Dunbar 1fc898c40a Driver: Temporary hack to allow -ccc-print-bindings to work (for
testing) even with -pipe on.

llvm-svn: 67348
2009-03-20 00:11:04 +00:00
Daniel Dunbar adc5c7c2fd Driver: Claim unused input arguments when emitting "input file unused"
diagnostic (to suppress more generic unused warning).

llvm-svn: 67294
2009-03-19 07:57:08 +00:00
Daniel Dunbar 2da027244d Driver: Claim -arch options when pipelining, and claim arguments that
are forwarded to GCC.
 - The later is unfortunate, as it prevents us from generally warning
   about anything interesting on platforms that use a generic
   toolchain. However, we can't do much better without significantly
   complicating things, and generally we should have proper tool chain
   definitions.

llvm-svn: 67293
2009-03-19 07:55:12 +00:00
Daniel Dunbar 5cdf3e0fb9 Driver: Handle "linker input" arguments.
- Make InputInfo a variant of filename, pipe, input argument,
   nothing.

 - Leave a FIXME in InputInfo that this should be revisited.

llvm-svn: 67292
2009-03-19 07:29:38 +00:00
Daniel Dunbar c4acf9d516 Driver: Forcibly disable pipe support until we can execute them, the
driver is functional without them.

llvm-svn: 67254
2009-03-18 23:18:19 +00:00
Daniel Dunbar 18d69de523 Driver: Delete the temporary files llvm::sys::Path::makeUnique
sometimes leaves around.

llvm-svn: 67253
2009-03-18 23:08:52 +00:00
Daniel Dunbar 6c17bfd99b Driver: Cleanup temporary/result files.
llvm-svn: 67248
2009-03-18 22:16:03 +00:00
Daniel Dunbar 6f66877ebf Driver: Lookup program names using llvm::sys::Program::FindProgramByName
if our usual methods fail. This isn't necessary for running the tool,
but improves the accuracy of logging output.

Also, have GCC tools lookup gcc program path.

llvm-svn: 67243
2009-03-18 21:34:08 +00:00
Mike Stump fc17674d6b The eventual name of this will be clang, might as well start now.
llvm-svn: 67241
2009-03-18 21:19:11 +00:00
Daniel Dunbar 68b01a03ba Driver: Support ToolChain specific path lists to search for files and
programs.

llvm-svn: 67229
2009-03-18 20:26:19 +00:00
Daniel Dunbar e627c1cc0f Driver: Construct temporary file names.
- This is still suboptimal, but should at least be workable.

llvm-svn: 67223
2009-03-18 19:34:39 +00:00
Mike Stump 1dca7c0061 Add revision information.
llvm-svn: 67220
2009-03-18 18:45:55 +00:00
Daniel Dunbar d175d9753b Driver: Don't warn about unused arguments if there are Driver errors
(brings code in line with diagnostic.

llvm-svn: 67217
2009-03-18 18:03:46 +00:00
Mike Stump 3b79d59be7 Fix URL trimming for version information.
llvm-svn: 67206
2009-03-18 15:19:35 +00:00
Mike Stump 02537142c1 Improve version number.
llvm-svn: 67204
2009-03-18 14:00:02 +00:00
Daniel Dunbar e6c8319943 Driver: Bug fix, derived .gch names sometimes started with "/".
llvm-svn: 67192
2009-03-18 09:58:30 +00:00
Daniel Dunbar dcd05482bd Driver: Add assert and FIXME; arguments which act as linker inputs
(e.g., -filelist) are currently broken.

llvm-svn: 67183
2009-03-18 08:02:40 +00:00
Daniel Dunbar 04c4c2c3db Driver: ConstructJob also needs to know the destination (where to put
its commands).

llvm-svn: 67179
2009-03-18 07:06:02 +00:00
Daniel Dunbar 3beceaf7f1 Driver: Print version on stderr to match [gc]cc.
llvm-svn: 67178
2009-03-18 06:51:03 +00:00
Daniel Dunbar 2b4bda8073 Driver: Claim inputs when we bind the InputAction.
llvm-svn: 67174
2009-03-18 06:21:12 +00:00
Daniel Dunbar bcd775b436 Driver: Don't claim inputs when pipelining, a tool should eventually
claim these.

llvm-svn: 67171
2009-03-18 06:09:38 +00:00
Daniel Dunbar 0450e6dc4c Driver: Add a dash of const.
llvm-svn: 67170
2009-03-18 06:07:59 +00:00
Daniel Dunbar 1a093d2049 Driver: Stub out Tool::ConstructJob.
llvm-svn: 67169
2009-03-18 06:00:36 +00:00
Daniel Dunbar 1197adcbf1 Driver: Add two normalizations for powerpc.
- PR3830

llvm-svn: 67166
2009-03-18 04:41:46 +00:00
Daniel Dunbar eb843bedf9 Driver: Ditch Driver::DefaultToolChain, this can vary between compilations.
llvm-svn: 67162
2009-03-18 03:13:20 +00:00
Daniel Dunbar f0eddb8510 Driver: Move actions into Compilation, and construct the compilation
earlier.

 - This gives us a simple ownership model, and allows clients access
   to more information should they ever want it.

 - We now free Actions correctly.

llvm-svn: 67158
2009-03-18 02:55:38 +00:00
Daniel Dunbar d00978bc0d Driver: Add test for binding of precompile; exposed bug due to my
flawed idea that llvm::sys::Path::getBasename was a version of
basename().

llvm-svn: 67153
2009-03-18 02:00:31 +00:00
Daniel Dunbar 2608c548b5 Driver: Use PrettyStackTrace.
llvm-svn: 67149
2009-03-18 01:38:48 +00:00
Daniel Dunbar 0160172228 Driver: Release Host, ToolChain, and Tool implementations.
llvm-svn: 67146
2009-03-18 01:09:40 +00:00
Daniel Dunbar b39cc52eda Driver: Add -ccc-print-bindings option (for testing); the Python
driver has no corresponding option.

llvm-svn: 67125
2009-03-17 22:47:06 +00:00
Daniel Dunbar 71bdee6ea1 Driver: Make sure to get the default arch name from the tool chain, not the
host; the toolchain may differ based on command line arguments.

llvm-svn: 67106
2009-03-17 21:29:52 +00:00
Daniel Dunbar 52e0c70868 Driver: Pass Driver reference down into Host info, which will need it
to pass to ToolChains, which may need Driver specific information (for
example, to form search paths).

llvm-svn: 67102
2009-03-17 20:45:45 +00:00
Daniel Dunbar b42a26c0a5 Driver: Hide HostInfo implementations.
- Also, normalize arch names a tad and stub out getToolChain
   implementations.

llvm-svn: 67091
2009-03-17 19:00:50 +00:00
Daniel Dunbar 7a178a40a1 Driver: Add logic for computing where to put job outputs (pipe,
temporary file, user provided name, derived name).

llvm-svn: 67088
2009-03-17 17:53:55 +00:00
Daniel Dunbar 6865a9e975 Fix unused variable warning in -Asserts mode.
llvm-svn: 67073
2009-03-17 04:12:06 +00:00
Daniel Dunbar e75d834c7c Driver: Implement majority tool binding logic.
- Still need code for determining proper output location.

 - Doesn't work yet, of course, as the host isn't providing real
   tool chains.

 - Interface still has a few warts, but has gotten a nice bit of
   polish during the rewrite.

llvm-svn: 67038
2009-03-16 06:56:51 +00:00
Daniel Dunbar 3ce436d229 Driver: Migrate some data into the Compilation; after pipelining
access to most data should go through the current Compilation, not the
Driver (which shouldn't be specialized on variables for a single
compilation).

llvm-svn: 67037
2009-03-16 06:42:30 +00:00
Daniel Dunbar 9e2136d930 Driver: Sketch Tool and ToolChain classes.
llvm-svn: 67036
2009-03-16 05:25:36 +00:00