aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Driver.cpp
AgeCommit message (Collapse)Author
2010-12-08Driver: M and MM should be grouped together, <rdar://problem/8744831>.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121284 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-11-18Use hasErrorOccurred() instead of getNumErrors() where it makes sense.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119746 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18Refactoring of Diagnostic class.Argyrios Kyrtzidis
-Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class. -DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units. -The rest of the state in Diagnostic object is considered related and tied to one translation unit. -Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a SourceLocation instead of a FullSourceLoc. -Reflect the changes to various interfaces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119730 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03Implement -working-directory.Argyrios Kyrtzidis
When -working-directory is passed in command line, file paths are resolved relative to the specified directory. This helps both when using libclang (where we can't require the user to actually change the working directory) and to help reproduce test cases when the reproduction work comes along. --FileSystemOptions is introduced which controls how file system operations are performed (currently it just contains the working directory value if set). --FileSystemOptions are passed around to various interfaces that perform file operations. --Opening & reading the content of files should be done only through FileManager. This is useful in general since file operations will be abstracted in the future for the reproduction mechanism. FileSystemOptions is independent of FileManager so that we can have multiple translation units sharing the same FileManager but with different FileSystemOptions. Addresses rdar://8583824. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118203 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19Use CLANG_RESOURCE_DIR define if one is provided, otherwise use the default ofChandler Carruth
'../lib/clang/<version>'. Actually use '..' rather than removing the trailing component to correctly handle paths containing '.' or symlinks in the presence of -no-canonical-prefixes, etc. This shouldn't change any existing behavior. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116803 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-11lib/Driver/Driver.cpp: Use the driver g++-4 for Cygwin-1.5.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116183 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24Revert r114712 due to failure on darwin buildbot.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114713 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23Make -M/-MM behave like in gcc; use -MF first then -o else use stdout.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114712 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23Fix header comment so we don't break emacs.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114711 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17Driver: implement driver automagic support for -lcc_kextShantonu Sen
Rewrite linker arguments to use libclang_rt.cc_kext.a instead of gcc-specific libcc_kext.a Resolves Radar 7808495 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114193 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17Driver: Support -dumpmachine.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114155 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17Driver: Add magic handling for "reserved library names", starting withDaniel Dunbar
-lstdc++. This is the best gross solution for a gross problem. This issue is that historically, GCC has add -L options to its internally library directories. This has allowed users and platforms to end up depending on the layout of GCC's internal library directories. We want to correct this mistake by eliminating that -L, but this means that existing libraries which are in the GCC lib dir won't be found. We are going to handle this by treating those -l names as "reserved", and requiring toolchains to know how to add the right full path to the reserved library. The immediately side effect of this is that users trying to use -L to find their own -lstdc++ will need to start using -nostdlib (which is a good idea anyway). Another side effect is that -stdlib=libc++ -lstdc++ will now do the "right" thing, for curious definitions of right. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114144 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06Make "-ccc-cxx" option work on Linux.Rafael Espindola
Patch by nobled. I also took the opportunity to make the field private since now it is only ready from the outside. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113138 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23Driver: Update -ccc-install-dir to also set the installed dir. TotallyDaniel Dunbar
non-obvious. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111838 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-21Visual Studio tools used on win32 hosts when targeting win32.Michael J. Spencer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111748 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17Driver: Claim the -mlinker-version synthesized argument, it shouldn't beDaniel Dunbar
reported as unused. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111310 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12Driver: Use the compile time linker version as the default for -mlinker-version,Daniel Dunbar
if detected. - This is a hack, we really want the linker version at execution time, but we don't have any infrastructure for getting that. Yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110886 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02Driver: Have -ccc-host-triple simply override the default in the driver, forDaniel Dunbar
now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110027 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02Driver: Move HostInfo::lookupTypeForExtension to ↵Daniel Dunbar
ToolChain::LookupTypeForExtension. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110024 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02Driver: Give Build{Universal,}Actions access to the default host tool chain. IDaniel Dunbar
avoided this originally to enforce that the driver actions aren't toolchain dependent, but it isn't worth the cumbersone additional hostinfo split. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110023 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02Driver: Add Compilation::addCommand and switch tools to using it, now that weDaniel Dunbar
don't have to deal with nested jobs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110015 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02Driver: Simplify.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110011 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02Driver: Eliminate now unused argument.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110010 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02Driver: Simplify logic for sending 'clang -E t.c' output to stdout.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110009 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02Driver: Never try to use piped inputs.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110008 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02Driver: Start ripping out support for -pipe, which is worthless and complicatesDaniel Dunbar
too many other things. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110007 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19Driver: Change the driver to take the path to the main executable, instead ofDaniel Dunbar
taking it in pieces. - Fixes a problem where the Clang executable path was not initialized properly on Win32, because sys::Path::getBasename() doesn't do what I always think it does. Imagine that, a sys::Path interface that is confusing! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14Driver: When re'execing clang, use path to the main executable instead ofDaniel Dunbar
looking up Clang in the normal search paths (which may end up finding the wrong clang). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108346 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07add driver support for minix, patch by Kees van ReeuwijkChris Lattner
from PR7583 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107788 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29Driver/Darwin: Only run dsymutil when we are also compiling/assembling as partDaniel Dunbar
of the compilation. - <rdar://problem/8141387> clang is always invoking dsymutil git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107149 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-15Driver: Support -Wp,-MMD,FOO, which I found an instance of. :(Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106039 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-14Driver: Fix PR4062 by dissecting one particular -Wp, form.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105966 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-14Driver: Dissect -Wl, and -Xlinker arguments to remove --no-demangle, which was aDaniel Dunbar
collect2 option that is passed by some projects (notably WebKit). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105964 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-11Driver: Switch Compilation to return the translated arguments by default.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105844 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-06-11Fix a couple comments.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105840 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09Driver: Eliminate Arg subclasses, which are now unnecessary.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105762 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-07Driver: Support invoking Clang on .ll or .bc inputs.Daniel Dunbar
- We actually pretend that we have two separate types for LLVM assembly/bitcode because we need to use the standard suffixes with LTO ('clang -O4 -c t.c' should generate 't.o'). It is now possible to do something like: $ clang -emit-llvm -S t.c -o t.ll ... assorted other compile flags ... $ clang -c t.ll -o t.o ... assorted other compile flags ... and expect that the output will be almost* identical to: $ clang -c t.c -o t.o ... assorted other compile flags ... because all the target settings (default CPU, target features, etc.) will all be initialized properly by the driver/frontend. *: This isn't perfect yet, because in practice we will end up running the optimization passes twice. It's possible to get something equivalent out with a well placed -mllvm -disable-llvm-optzns, but I'm still thinking about the cleanest way to solve this problem more generally. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105584 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-04Driver/Darwin: Model dsymutil properly, as a separate action/tool kind which isDaniel Dunbar
added as the last output step, instead of just hacking it into the link step. - Among other things, this fixes dSYM generation when using multiple -arch options. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105475 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-22Driver: When printing a "command was signalled" type of diagnostic, use theDaniel Dunbar
short name of the tool in use, instead of the name of the action that created the command. The practical impact is we now get: clang: error: clang frontend command failed due to signal 6 (use -v to see invocation) instead of: clang: error: assembler command failed due to signal 6 (use -v to see invocation) when clang crashes on a job that uses the integrated assembler. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104417 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-14Driver: Enable -integrated-as by default, at least for Darwin/x86 without ↵Daniel Dunbar
-static. - How else will we figure out what is broken, eh? git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103759 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-05add a new --print-diagnostic-categories option, which causes the driver toChris Lattner
print out all of the category numbers with their description. This is useful for clients that want to map the numbers produced by --fdiagnostics-show-category=id to their human readable string form. The output is simple but utilitarian: $ clang --print-diagnostic-categories 1,Format String 2,Something Else This implements rdar://7928193 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103080 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06Driver: Add a Tool::hasGoodDiagnostics hook, and use it to simplify logic forDaniel Dunbar
deciding when we need to emit an extra "command failed" diagnostic. - This also fixes the case where we were emitting that extra diagnostics, even when using clang w/ the integrated assembler, which has good diagnostics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100529 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01Driver: Add support for a CLANGXX_IS_PRODUCTION build variable, which enableDaniel Dunbar
Clang++ support, even in "Production" mode (for testing purposes). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100119 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22Add very limited support for GCC's '-B' flag. This allows us to support unusualChandler Carruth
toolchain configurations and is a small step toward FreeBSD support. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99159 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-11Driver: Free Action objects.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98263 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04add TCE target support, patch by Pekka J!Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97746 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25Driver: Allow driver title (for --help) to be overridden by clients.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97106 91177308-0d34-0410-b5e6-96231b3b80d8