aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/WindowsToolChain.cpp
AgeCommit message (Collapse)Author
2013-04-09If the user requested a zero-base-shadow sanitizer, infer -pie and -fPIC ↵Peter Collingbourne
when appropriate. Differential Revision: http://llvm-reviews.chandlerc.com/D502 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179082 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-24Reject -no-integrated-as on windows.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177840 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20Remove the Tools DensMap from the toolchain.Rafael Espindola
Each toolchain has a set of tools, but they are all of known types. It can have a linker, an assembler, a "clang" (compile, analyze, ...) a non-clang compiler, etc. Instead of keeping a map, just have member variable for each type of tool. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177479 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19Go back to using the integrated assembler on windows ever when passedRafael Espindola
-no-integrated-as. It is the only assembler we have there. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177398 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19Finish refactoring the tool selection logic.Rafael Espindola
The general pattern now is that Foobar::constructTool only creates tools defined in the tools::foobar namespace and then delegates to the parent. The remaining duplicated code is now in the tools themselves. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177368 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18Centralize the logic for using the integrated assembler.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177360 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18Centralize the recording of which tools have been constructed.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177319 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18Use early returns when checking if we already constructed a tool and whenRafael Espindola
delegating to Generic_GCC::SelectTool (it already updates the tool map). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177305 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18Remove unused argument.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177303 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18Pass an ArgList to every toolchain constructor. Remove the useIntegratedAsRafael Espindola
argument. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177301 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18Refactor a bit of duplicated code to useIntegratedAs.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177299 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18Remove unused argument.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177293 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18Remove unused argument.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177287 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-21Remove the SplitDebug action and replace with a set of commandsEric Christopher
in the compilation setup. Note that this doesn't currently work for -no-integrated-as. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175813 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-08Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.Jordan Rose
Nearly all of these changes are one-to-one replacements; the few that aren't have to do with custom identifier validation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174768 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05Driver and option support for -gsplit-dwarf. This is a part ofEric Christopher
the DWARF5 split dwarf proposal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174349 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-19Completely re-work how the Clang driver interprets PIC and PIE options.Chandler Carruth
There were numerous issues here that were all entangled, and so I've tried to do a general simplification of the logic. 1) The logic was mimicing actual GCC bugs, rather than "features". These have been fixed in trunk GCC, and this fixes Clang as well. Notably, the logic was always intended to be last-match-wins like any other flag. 2) The logic for handling '-mdynamic-no-pic' was preposterously unclear. It also allowed the use of this flag on non-Darwin platforms where it has no actual meaning. Now this option is handled directly based on tests of how llvm-gcc behaves, and it is only supported on Darwin. 3) The APIs for the Driver's ToolChains had the implementation ugliness of dynamic-no-pic leaking through them. They also had the implementation details of the LLVM relocation model flag names leaking through. 4) The actual results of passing these flags was incorrect on Darwin in many cases. For example, Darwin *always* uses PIC level 2 if it uses in PIC level, and Darwin *always* uses PIC on 64-bit regardless of the flags specified, including -fPIE. Darwin never compiles in PIE mode, but it can *link* in PIE mode. 5) Also, PIC was not always being enabled even when PIE was. This isn't a supported mode at all and may have caused some fallout in builds with complex PIC and PIE interactions. The result is (I hope) cleaner and clearer for readers. I've also left comments and tests about some of the truly strage behavior that is observed on Darwin platforms. We have no real testing of Windows platforms and PIC, but I don't have the tools handy to figure that out. Hopefully others can beef up our testing here. Unfortunately, I can't test this for every platform. =/ If folks have dependencies on these flags that aren't covered by tests, they may break. I've audited and ensured that all the changes in behavior of the existing tests are intentional and good. In particular I've tried to make sure the Darwin behavior (which is more suprising than the Linux behavior) also matches that of 'gcc' on my mac. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168297 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-15Revert r167567, restoring the ability of clang to run gcc in cases where itNick Lewycky
can't handle the input file type. This resulted in PR14338. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168024 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-08Rip out a bunch of code for invoking gcc from clang.Bob Wilson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167567 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-07Use getArch instead of getArchName + string compare.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165370 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-07Use getArch instead of getArchName.Rafael Espindola
The darwin change should be a nop since Triple::getArchTypeForDarwinArchName doesn't know about amd64. If things like amd64-mingw32 are to be rejected, we should print a error earlier on instead of silently using the wrong abi. Remove old comment that looks out of place, this is "in clang". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165368 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-04Revert r163076 per chandlerc's request.Joao Matos
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163146 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-01Fixed typo causing tests to fail on non-MSVC machines.Joao Matos
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163077 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-01Refactored the Windows headers location lookup code. Expose it so standalone ↵Joao Matos
tools can have access to it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163076 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-13[msvc] Honor %INCLUDE%. It should know essential search paths with ↵NAKAMURA Takumi
vcvarsall.bat. FYI, On VS10, %INCLUDE% contains; (VS10)\VC\INCLUDE (VS10)\VC\ATLMFC\INCLUDE (SDK70A)\include On VS11, (VS11)\VC\INCLUDE (VS11)\VC\ATLMFC\INCLUDE (SDK80)\include\shared (SDK80)\include\um (SDK80)\include\winrt FIXME: It may be enabled also on mingw. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152589 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-06Add new code migrator support for migrating existing Objective-C code to useTed Kremenek
the new Objective-C NSArray/NSDictionary/NSNumber literal syntax. This introduces a new library, libEdit, which provides a new way to support migration of code that improves on the original ARC migrator. We now believe that most of its functionality can be refactored into the existing libraries, and thus this new library may shortly disappear. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152141 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01include clang's config.h unconditionallyDylan Noblesmith
And remove HAVE_CLANG_CONFIG_H, now that the header is generated in the autoconf build, too. (clang r149497 / llvm r149498) Also include the config.h header after all other headers, per the LLVM coding standards. It also turns out WindowsToolChain.cpp wasn't using the config header at all, so that include's just deleted now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149504 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31Revert r149083 which is not the direction we're going in the ClangChandler Carruth
driver based on discussions with Doug Gregor. There are several issues: 1) The patch was not reviewed prior to commit and there were review comments. 2) The design of the functionality (triple-prefixed tool invocation) isn't the design we want for Clang going forward: it focuses on the "user triple" rather than on the "toolchain triple", and forces that bit of state into the API of every single toolchain instead of handling it automatically in the common base classes. 3) The tests provided are not stable. They fail on a few Linux variants (Gentoo among them) and on mingw32 and some other environments. I *am* interested in the Clang driver being able to invoke triple-prefixed tools, but we need to design that feature the right way. This patch just extends the previous hack without fixing the underlying problems with it. I'm working on a new design for this that I will mail for review by tomorrow. I am aware that this removes functionality that NetBSD relies on, but this is ToT, not a release. This functionality hasn't been properly designed, implemented, and tested yet. We can't "regress" until we get something that really works, both with the immediate use cases and with long term maintenance of the Clang driver. For reference, the original commit log: Keep track of the original target the user specified before normalization. This used to be captured in DefaultTargetTriple and is used for the (optional) $triple-$tool lookup for cross-compilation. Do this properly by making it an attribute of the toolchain and use it in combination with the computed triple as index for the toolchain lookup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149337 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26Keep track of the original target the user specified beforeJoerg Sonnenberger
normalization. This used to be captured in DefaultTargetTriple and is used for the (optional) $triple-$tool lookup for cross-compilation. Do this properly by making it an attribute of the toolchain and use it in combination with the computed triple as index for the toolchain lookup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149083 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25Switch the ToolChain types to all store a Driver reference rather thanChandler Carruth
a HostInfo reference. Nothing about the HostInfo was used by any toolchain except digging out the driver from it. This just makes that a lot more direct. The change was accomplished entirely mechanically. It's one step closer to removing the shim full of buggy copy/paste code that is HostInfo. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148945 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17Split the Windows toolchain definition into its own file. This isChandler Carruth
especially nice as the Windows toolchain needs the windows header files, and has lots of platform specific hooks in it. To facilitate the split, hoist a bunch of file-level static helpers into class-level static helpers. Spiff up their doxygen comments while there as they're now more likely to be looked up via docs. Hopefully, this will be followed by further breaking apart of the toolchain definitions. Most of the large and complex ones should likely live on their own. I'm looking at you Darwin. ;] git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146840 91177308-0d34-0410-b5e6-96231b3b80d8