aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Compilation.cpp
AgeCommit message (Collapse)Author
2013-03-26[driver] Do not generate crash diagnostics if the compilation command failedChad Rosier
to execute as the crash will surely reoccur while generating the diagnostics. rdar://13362359 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178089 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27[driver] The failure of any phase (e.g., preprocess, compile, assemble) for aChad Rosier
single translation unit should prevent later phases from executing. Otherwise, this generates lots of noise in build systems. This a fallout from r173825. Patch by Matthew Curtis <mcurtis@codeaurora.org>. rdar://13298009 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176198 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-07Form the default -fmodules-cache-path= properly.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174674 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29[driver] Clear the FailureResultFiles when initializing clang diagnostics. Also,Chad Rosier
minor cleanup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173852 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29[driver] Refactor the driver so that a failing commands doesn't preventChad Rosier
subsequent commands from being executed. The diagnostics generation isn't designed for this use case, so add a note to fix this in the very near future. For now, just generated the diagnostics for the first failing command. Part of rdar://12984531 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173825 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24[driver] Associate a JobAction with each result file. This enables the driverChad Rosier
to delete result files for only those commands that fail. Part of rdar://12984531 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173361 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23[Driver] Don't remove non-regular files that were outputs.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173215 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth
uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-15Use empty parens for empty function parameter list instead of '(void)'.Dmitri Gribenko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168041 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-31[driver] Remove an extra space with the -iprefix option, so thatChad Rosier
matching works correctly. Part of rdar://12329974 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167173 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-31[driver] Remove an extra space with the -internal-externc-isystem option, soChad Rosier
that matching works correctly. Part of rdar://12329974 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167161 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-31[driver] Completely rework how superfluous options are stripped out of the crashChad Rosier
diagnostics script. This addresses the FIXME pertaining to quoted arguments. We also delineate between those flags that have an argument (e.g., -D macro, -MF file) and those that do not (e.g., -M, -MM, -MG). Finally, we add the -dwarf-debug-flags to the list of flags to be removed. rdar://12329974 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167152 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03Use array_lengthof instead of sizeof trickery.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156104 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03Canonicalize loop.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156093 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-16use DEFAULT_SYSROOTSebastian Pop
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154792 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-06Add the depfile as a result file so that it is deleted if we crash,Peter Collingbourne
and prevent the diagnostic preprocessor run from writing a depfile. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143846 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-06Use strpbrk(3) instead of open coding it.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141328 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-05[driver] For consistency, handle all shell special characters handled by theChad Rosier
quoting code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141205 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-05[driver] The -v option doesn't quoted the command line arguments for historicalChad Rosier
reasons. However, it does seems practical to quote strings that need it. rdar://10221951 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141202 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-02When the compiler crashes, the compiler driver now produces diagnostic Chad Rosier
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136702 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-23Unbreak the MSVC build, using namespace clang is required otherwise MSVC ↵Francois Pichet
will not find raw_ostream. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135853 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-23remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner
LLVM.h imports them into the clang namespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-20Temporarily revert r135614 while I fix the cmake build.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135621 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-20When the compiler crashes, the compiler driver now produces diagnostic ↵Chad Rosier
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135614 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06Missing header from last commit; accidental change.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134455 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06Change the driver's logic about Objective-C runtimes: abstract out aJohn McCall
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134453 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25Driver: When compilation fails, don't try to remove output files we don't haveDaniel Dunbar
write access to. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130150 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-31Remove stray emacs mode markers in all these files that was causing emacs toNick Lewycky
open them in fundamental-mode instead of c++-mode. Also twiddle whitespace for consistency in ToolChains.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122646 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29Merge System into Support.Michael J. Spencer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120297 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-30Use the expanded form of S_ISREG. Hopefully this unbreaks the MSVC build.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117779 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29Don't test isRegularFile before calling eraseFromDisk, sinceDan Gohman
eraseFromDisk does the same check. This avoids a stat call in the common case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117744 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02Driver: Eliminate PipedJob, which is now unused.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110014 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-11Driver: Add an explicit argument translation phase to the driver itself. We ↵Daniel Dunbar
are going to need this to handle things like -Xassembler, -Xpreprocessor, and -Xlinker which we might have to introspect. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105842 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20Driver: Support CC_PRINT_OPTIONS, used for logging the compile commands (in ↵Daniel Dunbar
-v style) to a file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99054 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20Driver: Fix -### to quote shell special characters, following gcc.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99053 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25Fix for Path::isSpecialFile to Path::isRegularFile API in rev 89765.Edward O'Callaghan
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89849 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-24Fix for PR5568.Edward O'Callaghan
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89766 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19Driver: ArgList doesn't depend on Options.h anymore.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89313 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09Push bound architecture name into TranslateArgs.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81366 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09Push bound architecture name into Compilation::getArgsForToolChain.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81365 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09Remove tabs, and whitespace cleanups.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-01Driver: Mark some Compilation members const.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74636 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-01Driver: Move Compilation::Execute to Driver::ExecuteCompilation.Daniel Dunbar
- The Compilation is just a helper class, it shouldn't have that amount of logic in it. - No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74634 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-01Driver: Improve diagnostics for failed commands.Daniel Dunbar
- 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> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74629 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-25Driver: Prep for tool chain specific argument translation.Daniel Dunbar
- 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67676 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-24Driver: Result files shouldn't be removed on failure when -save-tempsDaniel Dunbar
is specified. - No easy way to make a safe test case for this (given where the driver is supposed to put temp files). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67632 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-21Driver: Give Compilation::Execute total control over the Driver resultDaniel Dunbar
code; and don't return an error code when -### is present, even if errors occur. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67425 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-19Driver: Compilation::Execute wasn't returning result code correctly.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67296 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-19Driver: Executing piped jobs with a single command is easy.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67295 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-18Driver: Execute jobs; no pipe support yet.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67250 91177308-0d34-0410-b5e6-96231b3b80d8