aboutsummaryrefslogtreecommitdiff
path: root/lib/Basic/Targets.cpp
AgeCommit message (Collapse)Author
2009-03-20pass langoptions around.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67376 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-20pass LangOptions into TargetInfo::getTargetDefines, so that targetsChris Lattner
can have language-specific defines. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67375 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03implement support for propagating *features* down to the code generatorChris Lattner
and defining target-specific macros based on them (like __SSE3__ and friends). After extensive discussion with Daniel, this work will need driver support, which will translate things like -msse3 into a -mattr feature. Until this work is done, the code in clang.cpp is disabled and the X86TargetInfo ctor still defaults to SSE2. With these two things changed, this code will work. PR3634 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65966 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02Add plumbing to support programatically defining __SSE2__ and friends,Chris Lattner
even though we still hard code sse2 for now. No support for 3dnow or sse4a, but someone could add that if they desired. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65886 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02minor cleanups to target-specific #defines, no functionality change.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65885 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02improve compatibility with GCC 4.4, patch by Michel Salim (PR3697)Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65884 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28TargetInfo::validateAsmConstraint now takes a reference to the full ↵Anders Carlsson
constraints string. This will make it possible to support multi-character constraints. No functionality change (for now). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65696 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24Minor refactoring.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65414 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24patch for two things.Fariborz Jahanian
make sure objc2's nonfragile abi is enacted for Leopard too. add -fobjc-gc-only flag to the image_info symbol. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65413 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20add support for amd64-*, patch by Brooks Davis!Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65124 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-16Supply the header corresponding to a library builtin as a separate argument ↵Douglas Gregor
to the LIBBUILTIN macro git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64676 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14Add -ffreestanding to suppress the implicit declaration of library builtins ↵Douglas Gregor
like printf and malloc. Fixes PR3586 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64566 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14Define __ELF__ on FreeBSD. Patch by Roman Divacky!Anton Korobeynikov
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64557 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14Define __ELF__ for linux systems.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64553 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13Give TargetInfo a new IntPtrType to hold the intptr_t type forChris Lattner
a target. Make Preprocessor.cpp define a new __INTPTR_TYPE__ macro based on this. On linux/32, set intptr_t to int, instead of long. This fixes PR3563. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64495 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12Make nonfragile-abi the default for darwin's 64bitFariborz Jahanian
abi for objective-c programs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64386 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05make clang agree with gcc 4.2's x86-64 predefines and settings.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63849 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05fix some differences between apple gcc and clang on darwin/x86-32.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63846 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28long long and double have 64-bit alignment on x86-64.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63191 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27add SparcV8 asm register info support. Patch by Ben Lickly!Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63085 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-24Handle the 'e' constraint. Fixes PR3385Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62923 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-18Fit in 80 colsNate Begeman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62439 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04instead of forcing blocks on by default, make them default to off, but letChris Lattner
specific targets default them to on. Default blocks to on on 10.6 and later. Add a -fblocks option that allows the user to override the target's default. Use -fblocks in the various testcases that use blocks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60563 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04replace useNeXTRuntimeAsDefault with a generic hook that allows targetsChris Lattner
to specify their default language options. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60561 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-02More fallout from r58501: primary fix is some more corrections to make Eli Friedman
the types for size_t and ptrdiff_t more accurate. I think all of these are correct, but please compare the defines for __PTRDIFF_TYPE__ and __SIZE_TYPE__ to gcc to double-check; this particularly applies to those on BSD variants, since I'm not sure what they do here; I assume here that they're the same as on Linux. Fixes wchar_t to be "int", not "unsigned int" (which I think is correct on everything but Windows). Fixes ptrdiff_t to be "int" rather than "short" on PIC16; "short" is an somewhat strange choice because it normally gets promoted, and it's not consistent with the choice for size_t. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58556 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31Made the mechanism of defining preprocessor defs for maxint, ptrdiff_t, wcharSanjiv Gupta
etc more generic. For some targets, long may not be equal to pointer size. For example: PIC16 has int as i16, ptr as i16 but long as i32. Also fixed a few build warnings in assert() functions in CFRefCount.cpp, CGDecl.cpp, SemaDeclCXX.cpp and ParseDeclCXX.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58501 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27Fix the definition of __builtin_va_list on PPC, which was set to the V4 ABI, ↵Chris Lattner
not the darwin or AIX abis. This fixes PR2904. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58222 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16Add basic FreeBSD target support, patch by Roman Divacky!Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57645 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-06Add 'x' constraint character.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57198 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-06Add the 'y' assembler constraint.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57144 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-05miscellaneous cleanupsChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57140 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-05move __FLT_EVAL_METHOD__, __FLT_RADIX__, and __DECIMAL_DIG__ intoChris Lattner
target indep code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57139 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-05it helps when I save the file before testing and committing.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57138 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-05suck the rest of the FP macros out of the targets into the PPChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57137 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-05start moving fp macros overChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57134 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-05move a bunch more integer sizing out of target-specific code intoChris Lattner
target indep code. Note that this changes functionality on PIC16: it defines __INT_MAX__ correctly for it, and it changes sizeof(long) to 16-bits (to match the size of pointer). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57132 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-05eliminate __USER_LABEL_PREFIX__ from the Targets.cpp file, start movingChris Lattner
integer size #defines over to the Preprocessor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57130 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30Handle minor version numbers in __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__Chris Lattner
like "10.3.9" git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56873 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30Add missing include for use of atoi.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56836 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30The definition of __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ followsChris Lattner
the target triple on darwin. For example i386-apple-darwin9 -> 1050 because darwin9 is "10.5". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56826 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30define __PASCAL_STRINGS__ whenever -fpascal-strings is enabled.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56824 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ is a darwin-specific #defineChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56822 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23Add x86_64 Linux target.Daniel Dunbar
- PR2824 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56491 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-06Per PR2773, define __USER_LABEL_PREFIX__ for x86-32 Linux and Windows.Eli Friedman
If you're on some other platform, the correct definition for this macro would be appreciated; to find the correct definition, just run the following command: echo | gcc -dM -E - | grep USER_LABEL_PREFIX git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55869 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23Add dragonfly target support, patch by Sascha WildnerChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55241 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23Add TargetInfo::useNeXTRuntimeAsDefaultDaniel Dunbar
- Used to autoselect runtime when neither -fnext-runtime nor -fgnu-runtime is specified. - Default impl is false, all darwin targets set it to true. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55231 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21Remove duplicate define from Windows-x86 target.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55101 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21Initial implementation of Windows x86 target; at the moment, the only Eli Friedman
difference from generic x86 is the defines. The rest is non-trivial to implement. I'm not planning on adding any more targets myself; if there are any targets anyone is currently using that are missing, feel free to add them, or ask me to add them. This concludes the work I'm planning for the TargetInfo implementations at the moment; all the other issues with TargetInfo require some API changes, and I haven't really thought it through. Some of the remaining issues: allowing targets to define size_t and wchar_t properly, adding some sort of __builtin_type_info intrinsic so we can finish clang's limits.h and float.h and get rid of a massive number of macro definitions, allowing target-specific command-line options, allowing target-specific defaults for certain command-line options like -fms-extensions, exposing vector alignment outside of the description string, exposing endianness outside of the description string, allowing targets to expose special bit-field layout requirements, exposing some sort of custom hook for call generation in CodeGen, and adding CPU selection to control defines like __SSE__. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55098 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21Add Linux x86-32 target.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55095 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21First cut at OS detection, taking advantage of the new generic targets. Eli Friedman
This approach allows adding OS-specific targets/defines/etc. without completely breaking unknown subtargets. No new subtargets yet, although I plan to add x86-Linux soon. Others can add targets that they use as needed; adding a new subtarget takes very little code. Also does some fixups for description strings; a lot of them were unspecified. I think all the ones I added are correct, but they're unverified; corrections are welcome. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55091 91177308-0d34-0410-b5e6-96231b3b80d8