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

532 Коммитов

Автор SHA1 Сообщение Дата
Chris Lattner 7a7ca281bc improve support for dragonfly, patch by Sascha Wildner!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93044 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 05:41:14 +00:00
Nuno Lopes 2550d70aab move a few more symbols to .rodata/.data.rel.ro
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92012 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 17:49:57 +00:00
Daniel Dunbar 5affb539ac ARM: Remove a FIXME, it's not actually more complicated than that.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91924 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 21:59:17 +00:00
Daniel Dunbar a91320b8af ARM: Honor -mfpu= and set __VFP_FP__ and __ARM_NEON__ "correctly".
- Correctly is in quotes, because we are following what I interpreted as GCC's
   intent (which diverges from practice, naturally).
 - Also, fix the arch define for arm1136jf-s.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91855 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 23:28:17 +00:00
Daniel Dunbar 97f52ac453 ARM: Use front-end specific target features "soft-float" and "soft-float-abi" to communicate FP mode to target; __SOFTFP__ is set correctly now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91755 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 04:15:38 +00:00
Daniel Dunbar b93292ab7f Targets: Allow CreateTargetInfo to mutate the target features.
- In particular, it can claim features for itself instead of always passing them on to LLVM.
 - This allows using the target features as a generic mechanism for passing target specific options to the TargetInfo instance, which may need them for initializing preprocessor defines, etc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91753 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 03:30:57 +00:00
Anton Korobeynikov b381441bfb Add f80 entry for windows targets
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91746 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 02:05:07 +00:00
Anton Korobeynikov 5d7c2511a4 Use proper alignment for i16/i32 on msp430. This fixes PR5815.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91739 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 01:32:37 +00:00
Daniel Dunbar 0791aa52b6 ARM: Define __thumb2__ for V6T2 targets and only define
__USING_SJLJ_EXCEPTIONS__ on Darwin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91705 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 19:57:13 +00:00
Daniel Dunbar eac7c53f16 ARM: Fix predefines (__ARM_ARCH_..., __REGISTER_PREFIX).
- This should be done leveraging the backend, but I'm a little refactored
   out. I'll fix it one day, I promise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91700 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 18:42:37 +00:00
John Thompson ec387afb60 Tweaks for PS3 target.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91685 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 14:21:08 +00:00
Edward O'Callaghan 9cf910efc4 Add SigAtomicType to TargetInfo, Needed for MSP and PIC Targets, Credit to Ken Dyck.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89520 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-21 00:49:54 +00:00
John Thompson 3f6918a8cc Added preliminary support step for PS3
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89362 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 17:18:50 +00:00
Daniel Dunbar 2fc430d548 Eliminate TargetInfo::getDefaultLangOptions, this kind of logic is better done
in the driver.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89073 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 09:15:44 +00:00
Daniel Dunbar c5a97ec194 Move -fnext-runtime defaulting to driver (and change clang-cc default to
-fnext-runtime), instead of using getDefaultLangOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89058 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 07:07:28 +00:00
Daniel Dunbar 0be42c44f0 Move -fms-extensions defaulting to driver, instead of using getDefaultLangOptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89057 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 07:06:20 +00:00
Daniel Dunbar 1f95e6567f Move char-is-signed defaulting to driver, instead of using
getDefaultLangOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89053 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 06:37:03 +00:00
Edward O'Callaghan 84423a8c84 Add MIPS support to Triple for Linux and the PSP. Credit to Bruno Cardoso Lopes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88850 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 10:22:07 +00:00
Daniel Dunbar d58c03f42e Add TargetOptions and use it when constructing targets.
- This ended up being hard to factor, sorry for the large diff.

 - Some post-commit cleanup to come.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88833 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 06:48:46 +00:00
Chris Lattner 9184646509 do not store wchar/char16/char32/intmax width/alignment info
into TargetInfo, just derive this based on the underlying type.
This prevents them from getting out of synch, patch by Ken Dyck!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86976 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 08:04:33 +00:00
Daniel Dunbar 29a790ba42 Simplifiy target feature handling by coalescing all the logic into
InitializeCompileOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86826 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 09:38:56 +00:00
Chris Lattner 1932e12d8b teach the various targets what native integer types they have.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86395 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07 18:59:41 +00:00
Sanjiv Gupta 7de7009a00 Add a preprocessor define for adding a "near" section attribute for allowing
objects to be placed at shared memory.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85007 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 18:08:20 +00:00
Edward O'Callaghan 991f9a74e7 The AuroraUX toolchain has conflicting wchar_t between the system stdlib.h header and the clang stddef.h header where clang was defining as int where we use long.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84416 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 13:33:59 +00:00
Anton Korobeynikov 03265b6046 Disallow arbitrary custom inline asm constraints for msp430.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84219 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 23:17:13 +00:00
Chris Lattner 278b9f0693 fix some cfstring related issues:
1) -fwritable-string does affect the non-utf16 version of cfstrings
   just not the utf16 ones.
2) utf16 strings should always be marked constant, as the __TEXT segment
   is readonly.
3) The name of the global doesn't matter, remove it from TargetInfo.
4) Trust the asmprinter to drop cstrings into the right section, like llvmgcc does now.

This fixes rdar://7115750



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84077 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 05:55:45 +00:00
Mike Stump a55cce8b3e "Someone pointed out that in my previous Targets.cpp patch I didn't
handle the long size difference for one of the Windows targets."  Patch
by John Thompson.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83592 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 23:00:00 +00:00
Cedric Venet 9a7b0855a6 Handle Eli remark on mingw __declspec macro definition
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82894 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-27 10:09:11 +00:00
Daniel Dunbar 9fe4a5d8a6 Factor Windows target into VS, MinGW and Cygwin variants.
- Patch by John Thompson!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82621 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 07:31:35 +00:00
Chris Lattner 21fb98ee00 implement support for __builtin_eh_return_data_regno on x86-32 and x86-64.
This implements PR5034 and rdar://6836445.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82614 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 06:06:36 +00:00
Daniel Dunbar dff10dcee0 Reconcile Clang/ARM target data string with llvm-gcc (module eabi weirdness).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82578 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 21:44:58 +00:00
Mike Stump 10880397d2 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82164 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 21:15:00 +00:00
Daniel Dunbar e1f63b38a0 ARM: Incremental improvement to preprocessor defines.
- Based on patch by Shantonu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82147 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 16:21:10 +00:00
Daniel Dunbar c1f2cddb8c Add ARM register names and aliases.
- Patch by Shantonu Sen!

<rdar://problem/6922650> clang doesn't know about ARM registers for inline asm clobber lists

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82132 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-17 07:03:19 +00:00
Chris Lattner e94e0d413f fix some ppc register name issues, patch by Richard Pennington!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82009 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-16 05:05:27 +00:00
Daniel Dunbar 018ba5ab06 Add TargetInfo::getABI(), and base ARM APCS vs AAPCS choice on that.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81735 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 00:35:03 +00:00
Daniel Dunbar a2a4161504 ARM target tweaks.
- Change TargetData string to match llvm-gcc.
 - Some -target-abi support for 'apcs-gnu', most importantly the alignment of double and long long changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81732 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 00:02:24 +00:00
Daniel Dunbar f4aa4f61de Swizzle the target triple based on -mthumb, and update clang-cc to recognize
thumb-foo-bar as an ARM target.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81497 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 01:14:50 +00:00
Mike Stump 1eb4433ac4 Remove tabs, and whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 15:08:12 +00:00
Daniel Dunbar 5345c391c6 Add basic support for -pthread.
- Patch by David Chisnall, with PCH and Darwin support mixed in.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80883 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 04:54:28 +00:00
Daniel Dunbar 55cc2ed722 Remove TargetInfo::getTargetPrefix().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79907 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 09:54:37 +00:00
Daniel Dunbar 1752ee4849 Switch TargetInfo to store an llvm::Triple.
- Primarily to discourage clients form making decisions based on the string.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79901 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 09:10:05 +00:00
Sanjiv Gupta da3e03ec5d Issue an error if the user specifies parameters in a function marked as ISR.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79544 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 17:48:52 +00:00
Eli Friedman b63decfa6e Add TCE target to clang; patch by Mikael Lepistö.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79462 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 20:47:07 +00:00
Daniel Dunbar 7765934ad7 Switch to SmallString::str from SmallString::c_str.
- Several FIXMEs due to non-Twinification of IRBuilder.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79455 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 20:04:03 +00:00
Daniel Dunbar 9d6fa61582 Convert CreateTargetInfo to use a Triple instead of manul string munging.
- Patch by Yonggang Luo (with some formatting tweaks by Eli and myself).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79320 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 05:47:58 +00:00
Jakob Stoklund Olesen 1eb434346f Support compilation for the blackfin back-end
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79271 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 20:08:44 +00:00
Chris Lattner 4c28b1cefe use the new llvm::Triple parsing stuffola for handling darwin version #'s.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78794 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 06:24:27 +00:00
Chris Lattner 797c3c4f5d fix a couple of problems with section attributes:
1. Passing something that isn't a string used to cause:
   "argument to annotate attribute was not a string literal"
  make it say "section attribute" instead.

2. Fix the location of the above message to point to the
   bad argument instead of the section token.

3. Implement rdar://4341926, by diagnosing invalid section
   specifiers in the frontend rather than letting them slip all
   the way to the assembler (a QoI win).

An example of #3 is that we used to produce something like this:

/var/folders/n7/n7Yno9ihEm894640nJdSQU+++TI/-Tmp-//ccFPFGtT.s:2:Expected comma after segment-name
/var/folders/n7/n7Yno9ihEm894640nJdSQU+++TI/-Tmp-//ccFPFGtT.s:2:Rest of line ignored. 1st junk character valued 46 (.).

Daniel improved clang to use llvm_report_error, so now we got:

$ clang t.c -c
fatal error: error in backend: Global variable 'x' has an invalid section specifier 'sadf': mach-o section specifier
      requires a segment and section separated by a comma.

with no loc info.  Now we get:

$ clang t.c -fsyntax-only
t.c:4:30: error: argument to 'section' attribute is not valid for this target: mach-o section specifier requires a segment
      and section separated by a comma
int x __attribute__((section("sadf")));
                             ^

which is nice :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78586 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 19:03:04 +00:00
Mike Stump 59e6572362 Add armv7 support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78092 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 19:48:52 +00:00
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