Граф коммитов

532 Коммитов

Автор SHA1 Сообщение Дата
Anton Korobeynikov 89e887fd73 Hook in s390x stuff into clang
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76099 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 20:09:57 +00:00
Chris Lattner 95b851e55c codegen string literals using private linkage now like llvm-gcc, eliminating
some target hooks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75895 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 05:03:48 +00:00
Chris Lattner b62bb2842f add netbsd support, patch by Krister Kalfridsson!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75492 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 20:29:08 +00:00
Duncan Sands 1e90faf4f2 Correct FreeBSD target info, fixing PR4514.
Patch by Roman Divacky.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75003 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 13:55:08 +00:00
Sanjiv Gupta 7f579b19b6 pic16 preproc defs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74893 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-07 04:42:23 +00:00
Eli Friedman 6036ebe330 More tweaks to types for OpenBSD. Patch by Jonathan Gray.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74805 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-05 22:31:18 +00:00
Eli Friedman 624c146780 Per PR4506, fix the type of size_t on OpenBSD.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74795 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-05 18:47:56 +00:00
Eli Friedman dc043166e3 Add an intermediate typedef for __builtin_va_tag to make it a bit easier
to deal with for AST pretty-printing/rewriting.  Patch by Abramo 
Bagnara.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74752 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-03 00:45:06 +00:00
Douglas Gregor a3844922f6 Two fixes to make Clang build on Visual C++ (again), from Alisdair Meredith.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74606 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-01 15:12:53 +00:00
Eli Friedman 3c7b6e46c5 Fix for PR4192: fix the definition of int64_t on x86_64 Linux.
Note that I'm guessing that *BSD and Solaris do the same thing as Linux 
here, but it's quite possible I'm wrong; if the following testcase 
gives an error on x86-64 with gcc for any of those operating systems, please
tell me:

#include <stdint.h>

int64_t x; long x;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74583 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-01 03:36:11 +00:00
Torok Edwin 5f6c194191 Reapply r74532, and inherit from OSTargetInfo instead of from Target.
'make test' passes now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74539 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-30 17:10:35 +00:00
Torok Edwin b0a5b2423c Revert 74532 till I figure out why it breaks a bunch of tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74536 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-30 17:00:25 +00:00
Torok Edwin 50dd810b22 Use templates instead of creating a new class for each OS/Target combination.
This unifies all the targets supported by an OS into a template.
It also cleans up the differences between the darwin targets.
Also __LP64__ wasn't needed for *BSD, since x86-64 target defines it anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74532 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-30 16:30:17 +00:00
Daniel Dunbar 811844d5eb Use true/false instead of 1/0.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74479 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-29 23:58:47 +00:00
Daniel Dunbar 43a3643eaf Don't define __KPRINTF_ATTRIBUTE__ unconditionally on OpenBSD.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74467 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-29 22:45:37 +00:00
Daniel Dunbar f7b8eec37c OpenBSD support.
- Patch by Jonathan Gray!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74453 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-29 20:52:51 +00:00
Bill Wendling 4ebe3e4c81 Make the StackProtector bitfield use enums instead of obscure numbers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74414 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-28 23:01:01 +00:00
Bill Wendling 45483f7a1b Add stack protector support to clang. This generates the 'ssp' and 'sspreq'
function attributes. There are predefined macros that are defined when stack
protectors are used: __SSP__=1 with -fstack-protector and __SSP_ALL__=2 with
-fstack-protector-all.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74405 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-28 07:36:13 +00:00
Chris Lattner 85de9e75ec fix the type of wchar_t for windows, PR4417
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74083 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-24 17:12:15 +00:00
Chris Lattner 7478bbfea8 __APPLE_CC__ should only be set when building for darwin targets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73934 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-23 00:43:21 +00:00
Chris Lattner 6b15cdc131 move the various builtins stuff from libast to libbasic. This
fixes a layering violation in lib/Basic/Targets.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73318 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-14 01:05:48 +00:00
Daniel Dunbar 9e7d596b54 Add stack alignment to x86_64 target data.
- <rdar://problem/6948443> WARNING: Linking two modules of different data
   layouts!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73093 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 22:39:13 +00:00
Eli Friedman 9c2f84eded Minor tweaks to the Windows target.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73083 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 21:16:17 +00:00
Eli Friedman 12b2da0350 PR4346: add "R" asm register constraint.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73081 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 20:45:44 +00:00
Eli Friedman abc4e32603 Misc minor fixes for clang for the Windows target.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73050 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 06:11:14 +00:00
Eli Friedman 15b91764d0 Move CharIsSigned from TargetInfo to LangOptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72928 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 07:05:05 +00:00
Eli Friedman 2de4feeef2 Move a couple Darwin-specific defines into getDarwinDefines.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72900 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 23:00:29 +00:00
Eli Friedman bb32e6dc80 Back out r72764; I should have looked more carefully before committing
this.  The correct replacement for "Y" and "Yt" is "x".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72765 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 10:41:42 +00:00
Eli Friedman a3c29e11b8 PR3678: Add support for "Yt" asm register constraint.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72764 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 10:33:05 +00:00
Sanjiv Gupta 9eb4cef6bc Add floating point details to PIC16 Target.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72713 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-02 04:43:46 +00:00
Eli Friedman 19262421fa Add a couple missing ARM defines.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72583 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-29 19:00:15 +00:00
Eli Friedman 09c3a6d725 A few more tweaks for Solaris; please correct me if it's wrong somehow.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72240 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22 01:12:57 +00:00
Douglas Gregor 163a7c79ea Improve target support for Solaris.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72237 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-21 23:51:30 +00:00
Eli Friedman 3f7a5310d4 Targets without long long should reduce the size of intmax_t
accordingly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71966 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-16 23:30:57 +00:00
Anton Korobeynikov eb71685510 Provide dummy va_list typedef for msp430
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71233 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 18:24:57 +00:00
Daniel Dunbar 3ac79049ab Handle -march for the LLVM recognized cpu names.
- x86 target feature handling should not be feature complete, even if
   the code quality is lacking.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71123 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 21:56:32 +00:00
Daniel Dunbar 17ca3638e8 More x86 target feature support.
- Apologies for the extremely gross code duplication, I want to get
   this working and then decide how to get this information out of the
   back end.

 - This replaces -m[no-]sse4[12] by -m[no-]sse4, it appears gcc
   doesn't distinguish them?

 - -msse, etc. now properly disable/enable related features.

 - Don't always define __SSE3__...

 - The main missing functionality bit here is that we don't initialize
   the features based on the CPU for all -march options.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71117 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 21:07:50 +00:00
Daniel Dunbar 500aec477c Tweak x86 -mcpu defaults.
- Default to yonah on Darwin (to get SSE3).

 - Default to Pentium4 (32-bit) and x86-64 (64-bit) on
   non-Darwin. Welcome to the 21st century.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71069 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 04:58:14 +00:00
Daniel Dunbar 868bd0aa92 Improve handling of (X86) target features.
- This is a WIP...

 - This adds -march= handling to the driver, and fixes the defaulting
   of -mcpu on Darwin (which was using the wrong test).

Instead of handling -m{sse, ...} in the driver, pass them to clang-cc as
 -target-feature [+-]name

In clang-cc, communicate with the (clang) target to discover the legal
features of a target, and the features which are enabled based on
-mcpu. This is currently hardcoded just enough to not be a feature
regression, we need to get this information from the backend's
TableGen information somehow.

This is used to construct the full list of features which are being
used, which is in turn used to initialize the predefines.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71061 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 03:16:41 +00:00
Anton Korobeynikov 73c64e5fb9 Hook msp430 in
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70774 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 13:43:08 +00:00
Anton Korobeynikov a7c4717f5f Whitespace cleanup
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70773 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 13:42:53 +00:00
Chris Lattner 44def07043 change TargetInfo::ConstraintInfo to be a struct that contains
the enum along with some other data.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70114 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-26 07:16:29 +00:00
Chris Lattner 5b37dc0380 some arm triples have weird characters in them, just fuzzy match
on armv* to be more compatible


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69864 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23 04:22:04 +00:00
Sanjiv Gupta 70aa5f9e9f Pass and return aggregate types directly to function calls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69668 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 06:01:16 +00:00
Eli Friedman b030f02725 Add target property for whether thread-local storage is supported.
Let me know if I messed up for some target.  Note that for Windows, we 
should be able to support it (MSVC supports "__declspec(thread)"), but 
I'm pretty sure LLVM doesn't know how to generate the correct code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69552 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 21:38:35 +00:00
Chris Lattner 5417544b42 actually just do this on all x86 targets, it won't hurt
non-glibc ones.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69528 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 17:32:33 +00:00
Chris Lattner 09b5cc69f0 Define __NO_MATH_INLINES on linux/x86 so that we don't get inline
functions in glibc header files that use FP Stack inline asm which the
backend can't deal with (PR879).

This "fixes" PR3970 for linux.  Other affected systems should do similar
things.  Maybe this should just go to the general i386/x86-64 sections?



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69527 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 17:29:50 +00:00
Daniel Dunbar 8d33cd77dc Support -miphoneos-version-min in clang-cc.
- Patch by Shantonu Sen (with a minor tweak to split out
   getDarwin{OSX,IPhoneOS}Defines)!

 - <rdar://problem/6776277> Need clang-cc/ccc-analyzer support for
   -miphoneos-version-min


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68815 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10 19:52:24 +00:00
Chris Lattner 837e897660 remove fixme!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68589 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 03:47:39 +00:00
Mike Stump 437bb4b6ec Add basic support for arm static analysis checking. Radar 6699395
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68582 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-08 02:07:04 +00:00
Chris Lattner 10d2427386 Fariborz points out that weak is now defined to the attribute even
in C mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68520 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 16:50:40 +00:00
Chris Lattner 3a5cbd37c9 The __weak and __strong defines are common to all darwin targets
and are even set in C mode.  As such, move them to Targets.cpp.

__OBJC_GC__ is also darwin specific, but seems reasonable to always
define it when in objc-gc mode.

This fixes rdar://6761450


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68494 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07 04:48:21 +00:00
Anton Korobeynikov 264a76cdf3 Provide sema proper values of maximal number of arguments passed in registers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68413 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03 23:38:25 +00:00
Daniel Dunbar a9668e0b4c Add target hook for setting symbol prefix and section of unicode
string literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68363 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03 00:57:44 +00:00
Daniel Dunbar 8e5c2b8072 Add Target hooks for IRgen of [cf]string literals.
- Notably, set section on cfstring literal string data (for now, this
   is done everywhere because it matches what we were already doing
   for the CFString data itself)

 - <rdar://problem/6599098> [irgen] linker requires objc string data
   to go into cstring


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68160 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 23:42:16 +00:00
Eli Friedman 1afabd9485 Fix the default for intptr_t on *BSD x86-32 and Windows. Slight cleanup
by moving the general case to the generic x86-32 target.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68015 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-29 20:31:09 +00:00
Daniel Dunbar 1e0107a3d1 Ad FreeBSD ARM target info.
- Patch by Ed Schoeten!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67527 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-23 16:09:04 +00:00
Chris Lattner ca45cffe5e refactor some code, fixing a problem discovered by the dragonfly bsd people, where
clang was defining "i386" even when in non-gnu mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67378 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-20 16:06:38 +00:00
Chris Lattner 318ca7106d pass langoptions around.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67376 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-20 15:55:34 +00:00
Chris Lattner 33328642a7 pass LangOptions into TargetInfo::getTargetDefines, so that targets
can have language-specific defines.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67375 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-20 15:52:06 +00:00
Chris Lattner 6328cc316d implement support for propagating *features* down to the code generator
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-03 19:56:18 +00:00
Chris Lattner 84f0ea849e Add plumbing to support programatically defining __SSE2__ and friends,
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-02 22:40:39 +00:00
Chris Lattner c0f5921215 minor cleanups to target-specific #defines, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65885 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 22:27:17 +00:00
Chris Lattner 3daed52a57 improve compatibility with GCC 4.4, patch by Michel Salim (PR3697)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65884 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 22:20:04 +00:00
Anders Carlsson 066d2ea752 TargetInfo::validateAsmConstraint now takes a reference to the full 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-28 17:11:49 +00:00
Fariborz Jahanian 84d013393c Minor refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65414 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 23:38:42 +00:00
Fariborz Jahanian 66a5c2c0da patch for two things.
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-24 23:34:44 +00:00
Chris Lattner 54fefbe993 add support for amd64-*, patch by Brooks Davis!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65124 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 17:04:14 +00:00
Douglas Gregor b1152d842c Supply the header corresponding to a library builtin as a separate argument to the LIBBUILTIN macro
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64676 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-16 21:58:21 +00:00
Douglas Gregor 3573c0c0b4 Add -ffreestanding to suppress the implicit declaration of library builtins 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-14 20:49:29 +00:00
Anton Korobeynikov 2793bda429 Define __ELF__ on FreeBSD. Patch by Roman Divacky!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64557 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 16:42:50 +00:00
Argyrios Kyrtzidis 487cdee2f5 Define __ELF__ for linux systems.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64553 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 15:02:45 +00:00
Chris Lattner 6ad474f82f Give TargetInfo a new IntPtrType to hold the intptr_t type for
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-13 22:28:55 +00:00
Fariborz Jahanian a30b17b900 Make nonfragile-abi the default for darwin's 64bit
abi for objective-c programs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64386 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 17:54:33 +00:00
Chris Lattner 06ebe862f0 make clang agree with gcc 4.2's x86-64 predefines and settings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63849 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05 07:32:46 +00:00
Chris Lattner d427ad4cce fix some differences between apple gcc and clang on darwin/x86-32.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63846 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05 07:19:24 +00:00
Chris Lattner 778601f8d3 long long and double have 64-bit alignment on x86-64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63191 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 06:58:19 +00:00
Chris Lattner e957f53745 add SparcV8 asm register info support. Patch by Ben Lickly!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63085 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27 01:58:38 +00:00
Anders Carlsson 79bc64ceb2 Handle the 'e' constraint. Fixes PR3385
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62923 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-24 18:03:09 +00:00
Nate Begeman ca0134259b Fit in 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62439 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-18 01:08:03 +00:00
Chris Lattner ae0ee03fd9 instead of forcing blocks on by default, make them default to off, but let
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-04 23:20:07 +00:00
Chris Lattner 8fc4dfb30e replace useNeXTRuntimeAsDefault with a generic hook that allows targets
to specify their default language options.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60561 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 22:54:33 +00:00
Eli Friedman f509d73ecf More fallout from r58501: primary fix is some more corrections to make
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-11-02 02:43:55 +00:00
Sanjiv Gupta 31fc07df7f Made the mechanism of defining preprocessor defs for maxint, ptrdiff_t, wchar
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-31 09:52:39 +00:00
Chris Lattner d599850e9e Fix the definition of __builtin_va_list on PPC, which was set to the V4 ABI, 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-27 01:11:29 +00:00
Chris Lattner fd0269d194 Add basic FreeBSD target support, patch by Roman Divacky!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57645 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 17:04:31 +00:00
Anders Carlsson a7406d4f8c Add 'x' constraint character.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57198 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-06 19:17:39 +00:00
Anders Carlsson fce0934560 Add the 'y' assembler constraint.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57144 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-06 00:41:45 +00:00
Chris Lattner d29b6300a7 miscellaneous cleanups
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57140 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-05 21:50:58 +00:00
Chris Lattner 12f0926029 move __FLT_EVAL_METHOD__, __FLT_RADIX__, and __DECIMAL_DIG__ into
target indep code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57139 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-05 21:49:27 +00:00
Chris Lattner 5db552d5c8 it helps when I save the file before testing and committing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57138 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-05 21:42:17 +00:00
Chris Lattner e9863cab04 suck the rest of the FP macros out of the targets into the PP
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57137 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-05 21:40:58 +00:00
Chris Lattner 2db78dd977 start moving fp macros over
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57134 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-05 20:40:30 +00:00
Chris Lattner 0e5d4ef315 move a bunch more integer sizing out of target-specific code into
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-05 20:06:37 +00:00
Chris Lattner 9b53316457 eliminate __USER_LABEL_PREFIX__ from the Targets.cpp file, start moving
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-10-05 19:44:25 +00:00
Chris Lattner 079f2c467d Handle minor version numbers in __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
like "10.3.9"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56873 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 20:30:12 +00:00
Nick Lewycky 86b76fcc78 Add missing include for use of atoi.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56836 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 07:18:57 +00:00
Chris Lattner 8b30c41219 The definition of __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ follows
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-30 01:00:25 +00:00
Chris Lattner 048dd943fc define __PASCAL_STRINGS__ whenever -fpascal-strings is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56824 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 00:48:48 +00:00
Chris Lattner 71af229645 __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ is a darwin-specific #define
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56822 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 00:46:39 +00:00
Daniel Dunbar b55a42bf9b Add x86_64 Linux target.
- PR2824


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56491 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23 17:37:57 +00:00
Eli Friedman c0c0f70cf1 Per PR2773, define __USER_LABEL_PREFIX__ for x86-32 Linux and Windows.
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-09-06 01:37:51 +00:00
Chris Lattner eac7aee3a2 Add dragonfly target support, patch by Sascha Wildner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55241 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 18:23:14 +00:00
Daniel Dunbar dcb4a1a6dd Add TargetInfo::useNeXTRuntimeAsDefault
- 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-23 08:43:39 +00:00
Eli Friedman 1e1bfd20bd Remove duplicate define from Windows-x86 target.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55101 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 01:56:54 +00:00
Eli Friedman 29a305067d Initial implementation of Windows x86 target; at the moment, the only
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-21 01:40:19 +00:00
Eli Friedman 0d4047b9a0 Add Linux x86-32 target.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55095 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 00:24:02 +00:00
Eli Friedman ed855cbbdf First cut at OS detection, taking advantage of the new generic targets.
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
2008-08-21 00:13:15 +00:00
Eli Friedman e427798581 Class reorg for PPC; shouldn't be any visible changes unless I messed
up somehow.

This concludes the series of reorg patches for the target 
implementations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55086 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 23:11:40 +00:00
Eli Friedman a9f5496df4 Class reorg for ARM. Shouldn't be any visible changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55042 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 07:44:10 +00:00
Eli Friedman 01b866808f Class hierarchy reorg for Sparc architecture. While I was there, I
cleaned it up a bit, including fixing the definition of va_list; this
shouldn't break anything, but anyone using Sparc should watch for 
regressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55041 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 07:28:14 +00:00
Eli Friedman 618234a748 Reorganize the class hierarchy for x86 targets; shouldn't have any
visible effects, but this will significantly reduce the amount of 
boilerplate code necessary to add subtargets.

If this looks okay, I'll do the rest of the processors (PPC, Sparc, ARM) 
soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55036 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 02:34:37 +00:00
Chris Lattner 1e21189547 Fix PR2627, support for Q constraint.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54943 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-18 20:05:00 +00:00
Sanjiv Gupta 364af81157 Allow targets to override description string.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54914 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-18 10:05:22 +00:00
Daniel Dunbar fba5cb12ad Move some ObjC preprocessor definitions into
InitializePredefinedMacros().
 - Also now properly wired to -fobjc-gc, -fnext-runtime.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54661 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-12 00:21:46 +00:00
Daniel Dunbar f77ac86f4e Add LangOptions::NeXTRuntime.
- Wired to -fnext-runtime and -fgnu-runtime options.
 - Defaults to GNU, no autoselection for NeXT.

Emit NeXT OBJC_IMAGE_INFO marker.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54651 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 21:35:06 +00:00
Daniel Dunbar acc5f3e423 More #include cleaning
- Kill unnecessary #includes in .cpp files. This is an automatic
   sweep so some things removed are actually used, but happen to be
   included by a previous header. I tried to get rid of the obvious
   examples and this was the easiest way to trim the #includes in one
   fell swoop.
 - We now return to regularly scheduled development.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54632 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 06:23:49 +00:00
Anders Carlsson 8b7c9fb2ef Always define __SIZE_TYPE__ as long unsigned int.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53922 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-22 17:16:13 +00:00
Nuno Lopes 9d29480174 add x86 EDI register alias
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53170 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 12:18:07 +00:00
Nuno Lopes 551d5e9811 move the linux predefined macro definition to the TargetInfo, where it really belongs
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53149 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-05 19:32:25 +00:00
Eli Friedman 5aa4fd65ef Make the width and alignment for long double consistent with the
hardcoded data layout in getTargetDescription.  Hopefully fixes a test 
failure.

Of course, this should be fixed properly, but that's a bigger fix.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51948 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 17:01:45 +00:00
Eli Friedman bf0c9bdd49 Make sure to define __sparc__ on Solaris; this should "fix"
test/Codegen/mandel.c on Solaris. :-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51554 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-25 05:26:09 +00:00
Eli Friedman 2553126e29 Missed an include.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51321 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 14:27:34 +00:00
Eli Friedman d37f0b82f1 Minor correction for PPC targets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51320 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 14:25:01 +00:00
Eli Friedman 61538a7d13 Some small changes to make the target info a bit more accurate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51319 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 14:21:01 +00:00
Chris Lattner f291b10fa9 set long/pointers to 64-bits on ppc64/x86-64
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50891 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-09 06:17:04 +00:00
Chris Lattner 927686fe8c parameterize pointer size/align better without doing virtual method calls in normal case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50890 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-09 06:08:39 +00:00
Chris Lattner 2621fd1d6d Add basic support for the pic-* target triples and add support for
targets that do not support recursion (and thus codegen stack variables
as globals).

Patch contributed by Alireza Moshtaghi!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50844 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 05:58:21 +00:00
Nate Begeman ad487f4ef2 Add some basic ARM asm constraints
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50085 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22 05:03:19 +00:00
Chris Lattner d0c33d3527 Fix pasto, thanks to Anders for pointing this out.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50055 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 20:19:54 +00:00
Chris Lattner 393ff04a07 add arm support
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50049 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 18:56:49 +00:00
Chris Lattner bda0b626e7 Make a major restructuring of the clang tree: introduce a top-level
lib dir and move all the libraries into it.  This follows the main
llvm tree, and allows the libraries to be built in parallel.  The
top level now enforces that all the libs are built before Driver,
but we don't care what order the libs are built in.  This speeds
up parallel builds, particularly incremental ones.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15 23:59:48 +00:00