Commit Graph

45 Commits

Author SHA1 Message Date
Chad Rosier 45cf50f7b6 Use array_lengthof instead of sizeof trickery.
llvm-svn: 156104
2012-05-03 21:25:34 +00:00
Chad Rosier cb600e2422 Canonicalize loop.
llvm-svn: 156093
2012-05-03 19:50:25 +00:00
Sebastian Pop 980920a321 use DEFAULT_SYSROOT
llvm-svn: 154792
2012-04-16 04:16:43 +00:00
Peter Collingbourne 9b515cb0ec Add the depfile as a result file so that it is deleted if we crash,
and prevent the diagnostic preprocessor run from writing a depfile.

llvm-svn: 143846
2011-11-06 00:40:05 +00:00
Benjamin Kramer 8c26d440da Use strpbrk(3) instead of open coding it.
llvm-svn: 141328
2011-10-06 22:53:35 +00:00
Chad Rosier 10746f5ebb [driver] For consistency, handle all shell special characters handled by the
quoting code.

llvm-svn: 141205
2011-10-05 20:09:11 +00:00
Chad Rosier 9b1311df26 [driver] The -v option doesn't quoted the command line arguments for historical
reasons.  However, it does seems practical to quote strings that need it.
rdar://10221951

llvm-svn: 141202
2011-10-05 19:51:41 +00:00
Chad Rosier be10f9853c When the compiler crashes, the compiler driver now produces diagnostic
information including the fully preprocessed source file(s) and command line 
arguments.  The developer is asked to attach this diagnostic information to a 
bug report.
rdar://9575623

llvm-svn: 136702
2011-08-02 17:58:04 +00:00
Francois Pichet 24fc69e531 Unbreak the MSVC build, using namespace clang is required otherwise MSVC will not find raw_ostream.
llvm-svn: 135853
2011-07-23 11:36:43 +00:00
Chris Lattner 0e62c1cc0b remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.

llvm-svn: 135852
2011-07-23 10:55:15 +00:00
Chad Rosier 1988642124 Temporarily revert r135614 while I fix the cmake build.
llvm-svn: 135621
2011-07-20 21:16:17 +00:00
Chad Rosier e3805fc118 When the compiler crashes, the compiler driver now produces diagnostic information
including the fully preprocessed source file(s) and command line arguments.  The 
developer is asked to attach this diagnostic information to a bug report.

llvm-svn: 135614
2011-07-20 20:26:32 +00:00
John McCall 6dd2417dbe Missing header from last commit; accidental change.
llvm-svn: 134455
2011-07-06 00:38:59 +00:00
John McCall 24fc0decfe Change the driver's logic about Objective-C runtimes: abstract out a
structure to hold inferred information, then propagate each invididual
bit down to -cc1.  Separate the bits of "supports weak" and "has a native
ARC runtime";  make the latter a CodeGenOption.

The tool chain is still driving this decision, because it's the place that
has the required deployment target information on Darwin, but at least it's
better-factored now.

llvm-svn: 134453
2011-07-06 00:26:06 +00:00
Daniel Dunbar 462e7ed497 Driver: When compilation fails, don't try to remove output files we don't have
write access to.

llvm-svn: 130150
2011-04-25 20:43:05 +00:00
Nick Lewycky 6da90771c4 Remove stray emacs mode markers in all these files that was causing emacs to
open them in fundamental-mode instead of c++-mode.
Also twiddle whitespace for consistency in ToolChains.cpp.

llvm-svn: 122646
2010-12-31 17:31:54 +00:00
Michael J. Spencer 8aaf49959c Merge System into Support.
llvm-svn: 120297
2010-11-29 18:12:39 +00:00
Benjamin Kramer 7d11382b8c Use the expanded form of S_ISREG. Hopefully this unbreaks the MSVC build.
llvm-svn: 117779
2010-10-30 08:28:42 +00:00
Dan Gohman e89c04e518 Don't test isRegularFile before calling eraseFromDisk, since
eraseFromDisk does the same check. This avoids a stat call
in the common case.

llvm-svn: 117744
2010-10-29 23:26:14 +00:00
Daniel Dunbar b785d74080 Driver: Eliminate PipedJob, which is now unused.
llvm-svn: 110014
2010-08-02 02:38:25 +00:00
Daniel Dunbar 775d406043 Driver: Add an explicit argument translation phase to the driver itself. We are going to need this to handle things like -Xassembler, -Xpreprocessor, and -Xlinker which we might have to introspect.
llvm-svn: 105842
2010-06-11 22:00:26 +00:00
Daniel Dunbar 6a8efa8a79 Driver: Support CC_PRINT_OPTIONS, used for logging the compile commands (in -v style) to a file.
llvm-svn: 99054
2010-03-20 08:01:59 +00:00
Daniel Dunbar 7c4de04c30 Driver: Fix -### to quote shell special characters, following gcc.
llvm-svn: 99053
2010-03-20 08:01:53 +00:00
Edward O'Callaghan c92791193d Fix for Path::isSpecialFile to Path::isRegularFile API in rev 89765.
llvm-svn: 89849
2009-11-25 06:33:27 +00:00
Edward O'Callaghan db521ec23b Fix for PR5568.
llvm-svn: 89766
2009-11-24 15:23:21 +00:00
Daniel Dunbar da13faf982 Driver: ArgList doesn't depend on Options.h anymore.
llvm-svn: 89313
2009-11-19 04:25:22 +00:00
Daniel Dunbar e7af341454 Push bound architecture name into TranslateArgs.
llvm-svn: 81366
2009-09-09 18:36:12 +00:00
Daniel Dunbar b5d86bbd76 Push bound architecture name into Compilation::getArgsForToolChain.
llvm-svn: 81365
2009-09-09 18:36:01 +00:00
Mike Stump 11289f4280 Remove tabs, and whitespace cleanups.
llvm-svn: 81346
2009-09-09 15:08:12 +00:00
Daniel Dunbar 82ef1abf43 Driver: Mark some Compilation members const.
llvm-svn: 74636
2009-07-01 20:30:52 +00:00
Daniel Dunbar 38bfda6ab5 Driver: Move Compilation::Execute to Driver::ExecuteCompilation.
- The Compilation is just a helper class, it shouldn't have that amount of
   logic in it.

 - No functionality change.

llvm-svn: 74634
2009-07-01 20:03:04 +00:00
Daniel Dunbar aa246cafaa Driver: Improve diagnostics for failed commands.
- Not all tools give good error messages, and sometimes the tool can fail w/o
   any error (for example, when signalled).

 - We suppress this message when the failing command is the compiler and it
   failed normally (exit code == 1), under the assumption that it gave a good
   diagnostic.

For example, for a linker failure we now get:
--
ddunbar@lordcrumb:tmp$ clang a.c b.c
ld: duplicate symbol _x in /var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-/cc-bXYITq.o and /var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-/cc-6uK4jD.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
--

For a compiler crash we get:
--
ddunbar@lordcrumb:tmp$ clang t.i
Assertion failed: (CGT.getTargetData().getTypeAllocSizeInBits(STy) == RL.getSize()), function layoutStructFields, file CodeGenTypes.cpp, line 573.
0   clang-cc          0x0000000100f1f1f1 PrintStackTrace(void*) + 38
... stack trace and virtual stack trace follow ...
clang: error: compiler command failed due to signal 6 (use -v to see invocation)
--

But for a regular compilation failure we get the usual:
--
ddunbar@lordcrumb:tmp$ clang c.c
c.c:1:6: error: invalid token after top level declarator
int x
     ^
1 diagnostic generated.
--

 - No test case, not amenable to non-executable testing. :/

 - <rdar://problem/6945613>

llvm-svn: 74629
2009-07-01 19:14:39 +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 827faf8f2b Driver: Result files shouldn't be removed on failure when -save-temps
is specified.
 - No easy way to make a safe test case for this (given where the
   driver is supposed to put temp files).

llvm-svn: 67632
2009-03-24 17:49:01 +00:00
Daniel Dunbar 1acb0eb24f Driver: Give Compilation::Execute total control over the Driver result
code; and don't return an error code when -### is present, even if
errors occur.

llvm-svn: 67425
2009-03-21 00:40:53 +00:00
Daniel Dunbar 8d6ab2afa6 Driver: Compilation::Execute wasn't returning result code correctly.
llvm-svn: 67296
2009-03-19 08:03:45 +00:00
Daniel Dunbar 1da82ae5bd Driver: Executing piped jobs with a single command is easy.
llvm-svn: 67295
2009-03-19 08:01:45 +00:00
Daniel Dunbar 64316c49a6 Driver: Execute jobs; no pipe support yet.
llvm-svn: 67250
2009-03-18 22:44:24 +00:00
Daniel Dunbar 6c17bfd99b Driver: Cleanup temporary/result files.
llvm-svn: 67248
2009-03-18 22:16:03 +00:00
Daniel Dunbar 0928b3125c Driver: Implement -### (hard to tell, since we don't actually
construct any jobs).

llvm-svn: 67177
2009-03-18 06:49:39 +00:00
Daniel Dunbar aabaac4743 Driver: Fix Compilation::getArgsForToolChain, local variable was
shadowing member.

llvm-svn: 67167
2009-03-18 05:58:45 +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 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 b2cd66bf4d Driver: Sink Driver/Compilation into clang::driver namespace.
- Add OptTable instance to Driver.

llvm-svn: 66063
2009-03-04 20:49:20 +00:00
Daniel Dunbar 544ecd14b6 Stub out some structure for C++ driver.
llvm-svn: 65867
2009-03-02 19:59:07 +00:00