Commit Graph

267 Commits

Author SHA1 Message Date
Chris Lattner 1a8f394a1f david conrad points out that {|} in inline assembly on arm are not asm
variants.  This fixes neon inline asm which my patch for PR6780 broke.

llvm-svn: 102181
2010-04-23 16:29:58 +00:00
Chris Lattner 8b29021712 another tweak for haiku support, patch by Paul Davey!
llvm-svn: 102098
2010-04-22 17:48:00 +00:00
Daniel Dunbar f812506912 ARM/APCS: Don't respect bit-field types when laying out structures.
- This fixes the last known ABI issues with ARM/APCS.

 - I've run the first 1k ABITests with '--no-unsigned --no-vector --no-complex'
   on {armv6, armv7} x {-mno-thumb, -mthumb}, and the first 10k tests for armv7
   -mthumb, for both function return types and single argument calls. These all
   pass now (they failed horribly before without --no-bitfield).

llvm-svn: 102070
2010-04-22 16:14:54 +00:00
Douglas Gregor 3ecc665505 Sink the _GNU_SOURCE definition down into the target configuration,
and only define it where we know we need it---Linux and Cygwin. Thanks
to Chris for the prodding.

llvm-svn: 101989
2010-04-21 05:52:38 +00:00
Chris Lattner b986aba6db add haiku support, patch by Paul Davey!
llvm-svn: 100982
2010-04-11 19:29:39 +00:00
Eric Christopher e1ddaf911b Add option and macro definition for AES instructions. Now produces real
assembly for testcases.

llvm-svn: 100253
2010-04-02 23:50:19 +00:00
John Thompson 957816fbf3 PS3 needs __PPC__. Should this be in the PPC target?
llvm-svn: 99513
2010-03-25 16:18:32 +00:00
Nuno Lopes 4cbc8bd1bc fix PR6584: __SSE3__ not defined with -mss3
llvm-svn: 98342
2010-03-12 10:20:09 +00:00
Chris Lattner 5178f56255 add mblaze target support, patch by Wesley Peck!
llvm-svn: 97890
2010-03-06 21:21:27 +00:00
Chris Lattner 09797543bd add TCE target support, patch by Pekka J!
llvm-svn: 97746
2010-03-04 21:07:38 +00:00
Eric Christopher cfeceffa27 Add in disabled case as well.
llvm-svn: 97716
2010-03-04 02:31:44 +00:00
Eric Christopher 399ffa55d2 Add in -msse4.1 and -msse4.2 options and continuing a rather
hacky solution for translating.  Expanded on comment explaining
the hack a bit.

llvm-svn: 97714
2010-03-04 02:26:37 +00:00
Chris Lattner 5cc15e058b add framework for ARM builtins, Patch by Edmund Grimley Evans!
llvm-svn: 97656
2010-03-03 19:03:45 +00:00
Eric Christopher 0b26a616eb Add in some more MIPS command line options.
Patch by Oleksandr Tymoshenko!

llvm-svn: 97544
2010-03-02 02:41:08 +00:00
Chris Lattner db5c16bc9c add freebsd/ppc[64] support, patch by Nathan Whitehorn, PR6318
llvm-svn: 96362
2010-02-16 18:14:57 +00:00
Sanjiv Gupta ecd2600c52 Re-applying 96173. Looks like finally I got the test case right.
llvm-svn: 96321
2010-02-16 03:37:11 +00:00
Sanjiv Gupta 9d23f93d52 reverting back 96242 as it still causes a test failure.
llvm-svn: 96244
2010-02-15 18:02:12 +00:00
Sanjiv Gupta af56d377f1 Re-applying 96173 with corresponding changes in test.
llvm-svn: 96242
2010-02-15 17:19:13 +00:00
Chris Lattner d0413848cc temporarily revert 96173, it is causing test failures.
llvm-svn: 96176
2010-02-14 18:38:38 +00:00
Sanjiv Gupta 1ef8cdd29b renamed pic16 specifiic macros.
llvm-svn: 96173
2010-02-14 18:20:18 +00:00
Daniel Dunbar 3241d400c8 Switch to using -fsjlj-exceptions instead of hard-coding it. Notably, this fixes
calls to the UnwindResumeOrRethrow function for C++/Obj-C exception handling,
for Darwin ARM.

llvm-svn: 95787
2010-02-10 18:49:11 +00:00
Chris Lattner 5b5d2db3f6 Don't explicitly force utf strings into the __TEXT,__ustring
by setting the section of the generated global.  This is an
optimization done by the code generator, and the code being
removed didn't handle the case when the string contained an
embedded nul (which the code generator does correctly 
handle).  This is rdar://7589850

llvm-svn: 95003
2010-02-01 20:59:08 +00:00
Benjamin Kramer 31a68e70a5 Simplify FreeBSD version parsing.
llvm-svn: 94919
2010-01-30 19:55:01 +00:00
Anders Carlsson 0b0a122fde StringRef-ize the TargetInfo::ConstraintInfo constructor.
llvm-svn: 94916
2010-01-30 18:33:31 +00:00
Anton Korobeynikov cbc4e98381 Fix alignment for msp430 integer types.
llvm-svn: 94879
2010-01-30 12:55:11 +00:00
Daniel Dunbar 377dc2f91f ARM/APCS: Fix alignment of long double.
llvm-svn: 94685
2010-01-27 20:23:08 +00:00
Anders Carlsson e437c6870a Add support for 3dnow and 3dnowa, and define the target macros accordingly. (This is needed in order to build Qt).
llvm-svn: 94658
2010-01-27 03:47:49 +00:00
Daniel Dunbar d86666ffd7 Driver/Darwin: Stuff iPhoneOS into environment portion of the (llvm/clang) triple instead of keying off architecture. Also, fix version define to properly include the revision/micro component of the version number.
llvm-svn: 94487
2010-01-26 01:44:04 +00:00
Chandler Carruth 26b29a0892 Move the MacroBuilder utilitiy to its own header. Update references.
Comments and/or improvements to the documentation are welcome.

llvm-svn: 93982
2010-01-20 06:13:02 +00:00
Chandler Carruth 5b6d9265ba Actually remove the include that r93974 made unnecessary.
llvm-svn: 93975
2010-01-20 04:09:11 +00:00
Anton Korobeynikov 6bedbf1039 long long is 64 bits on msp430
llvm-svn: 93451
2010-01-14 20:22:45 +00:00
Fariborz Jahanian 3f7b8b274d Predefine __weak attribute when doing objective-c
rewriting for any target. (refixes radar 7530235).

llvm-svn: 93331
2010-01-13 18:51:17 +00:00
Fariborz Jahanian 42c06998ea Define __weak attribute for objective-c pointers in
win32 targets. Fixes radar 7530235. Daniel please review.

llvm-svn: 93246
2010-01-12 18:33:57 +00:00
Benjamin Kramer dc2f006f4e Hopefully unbreak build with g++ >= 4.3.
llvm-svn: 93060
2010-01-09 18:20:57 +00:00
Benjamin Kramer 2d6fda3205 Use MacroBuilder for TargetDefines instead of std::vector.
llvm-svn: 93058
2010-01-09 17:55:51 +00:00
Chris Lattner 002ba6b4d0 improve support for dragonfly, patch by Sascha Wildner!
llvm-svn: 93044
2010-01-09 05:41:14 +00:00
Nuno Lopes cfca1f0dc1 move a few more symbols to .rodata/.data.rel.ro
llvm-svn: 92012
2009-12-23 17:49:57 +00:00
Daniel Dunbar 42fe663e3b ARM: Remove a FIXME, it's not actually more complicated than that.
llvm-svn: 91924
2009-12-22 21:59:17 +00:00
Daniel Dunbar 0def3d17cb 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.

llvm-svn: 91855
2009-12-21 23:28:17 +00:00
Daniel Dunbar 893d475ba8 ARM: Use front-end specific target features "soft-float" and "soft-float-abi" to communicate FP mode to target; __SOFTFP__ is set correctly now.
llvm-svn: 91755
2009-12-19 04:15:38 +00:00
Daniel Dunbar 7b245eda5e 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.

llvm-svn: 91753
2009-12-19 03:30:57 +00:00
Anton Korobeynikov d7e4a095c9 Add f80 entry for windows targets
llvm-svn: 91746
2009-12-19 02:05:07 +00:00
Anton Korobeynikov d94329a545 Use proper alignment for i16/i32 on msp430. This fixes PR5815.
llvm-svn: 91739
2009-12-19 01:32:37 +00:00
Daniel Dunbar c454ecf9d0 ARM: Define __thumb2__ for V6T2 targets and only define
__USING_SJLJ_EXCEPTIONS__ on Darwin.

llvm-svn: 91705
2009-12-18 19:57:13 +00:00
Daniel Dunbar acde99ea52 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.

llvm-svn: 91700
2009-12-18 18:42:37 +00:00
John Thompson 6f8dba7f9e Tweaks for PS3 target.
llvm-svn: 91685
2009-12-18 14:21:08 +00:00
Edward O'Callaghan 847f2a10ee Add SigAtomicType to TargetInfo, Needed for MSP and PIC Targets, Credit to Ken Dyck.
llvm-svn: 89520
2009-11-21 00:49:54 +00:00
John Thompson e467e19766 Added preliminary support step for PS3
llvm-svn: 89362
2009-11-19 17:18:50 +00:00
Daniel Dunbar 2208c57116 Eliminate TargetInfo::getDefaultLangOptions, this kind of logic is better done
in the driver.

llvm-svn: 89073
2009-11-17 09:15:44 +00:00
Daniel Dunbar 4656c53e12 Move -fnext-runtime defaulting to driver (and change clang-cc default to
-fnext-runtime), instead of using getDefaultLangOptions.

llvm-svn: 89058
2009-11-17 07:07:28 +00:00
Daniel Dunbar 0730e4f7e0 Move -fms-extensions defaulting to driver, instead of using getDefaultLangOptions.
llvm-svn: 89057
2009-11-17 07:06:20 +00:00
Daniel Dunbar d609b7bbe9 Move char-is-signed defaulting to driver, instead of using
getDefaultLangOptions.

llvm-svn: 89053
2009-11-17 06:37:03 +00:00
Edward O'Callaghan e9a58b10ad Add MIPS support to Triple for Linux and the PSP. Credit to Bruno Cardoso Lopes.
llvm-svn: 88850
2009-11-15 10:22:07 +00:00
Daniel Dunbar b9bbd54fdb 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.

llvm-svn: 88833
2009-11-15 06:48:46 +00:00
Chris Lattner 0fb5bbd401 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!

llvm-svn: 86976
2009-11-12 08:04:33 +00:00
Daniel Dunbar 979586e755 Simplifiy target feature handling by coalescing all the logic into
InitializeCompileOptions.

llvm-svn: 86826
2009-11-11 09:38:56 +00:00
Chris Lattner 5c67237ff6 teach the various targets what native integer types they have.
llvm-svn: 86395
2009-11-07 18:59:41 +00:00
Sanjiv Gupta 84f0f776e9 Add a preprocessor define for adding a "near" section attribute for allowing
objects to be placed at shared memory.

llvm-svn: 85007
2009-10-24 18:08:20 +00:00
Edward O'Callaghan 9dda8e98d4 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.
llvm-svn: 84416
2009-10-18 13:33:59 +00:00
Anton Korobeynikov 051913bb86 Disallow arbitrary custom inline asm constraints for msp430.
llvm-svn: 84219
2009-10-15 23:17:13 +00:00
Chris Lattner 4f8a2e22c0 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

llvm-svn: 84077
2009-10-14 05:55:45 +00:00
Mike Stump af9afe9bc9 "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.

llvm-svn: 83592
2009-10-08 23:00:00 +00:00
Cedric Venet bc8d0dec5d Handle Eli remark on mingw __declspec macro definition
llvm-svn: 82894
2009-09-27 10:09:11 +00:00
Daniel Dunbar 3e7a723fef Factor Windows target into VS, MinGW and Cygwin variants.
- Patch by John Thompson!

llvm-svn: 82621
2009-09-23 07:31:35 +00:00
Chris Lattner d545ad1301 implement support for __builtin_eh_return_data_regno on x86-32 and x86-64.
This implements PR5034 and rdar://6836445.

llvm-svn: 82614
2009-09-23 06:06:36 +00:00
Daniel Dunbar 03184798c3 Reconcile Clang/ARM target data string with llvm-gcc (module eabi weirdness).
llvm-svn: 82578
2009-09-22 21:44:58 +00:00
Mike Stump faacf018a3 Fix typo.
llvm-svn: 82164
2009-09-17 21:15:00 +00:00
Daniel Dunbar 2f5c75e17d ARM: Incremental improvement to preprocessor defines.
- Based on patch by Shantonu.

llvm-svn: 82147
2009-09-17 16:21:10 +00:00
Daniel Dunbar 1da76c4e58 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

llvm-svn: 82132
2009-09-17 07:03:19 +00:00
Chris Lattner f7ff53d4d9 fix some ppc register name issues, patch by Richard Pennington!
llvm-svn: 82009
2009-09-16 05:05:27 +00:00
Daniel Dunbar b4091a9c6a Add TargetInfo::getABI(), and base ARM APCS vs AAPCS choice on that.
llvm-svn: 81735
2009-09-14 00:35:03 +00:00
Daniel Dunbar 125f8fb761 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.

llvm-svn: 81732
2009-09-14 00:02:24 +00:00
Daniel Dunbar 33a004e9eb Swizzle the target triple based on -mthumb, and update clang-cc to recognize
thumb-foo-bar as an ARM target.

llvm-svn: 81497
2009-09-11 01:14:50 +00:00
Mike Stump 11289f4280 Remove tabs, and whitespace cleanups.
llvm-svn: 81346
2009-09-09 15:08:12 +00:00
Daniel Dunbar a77eaeb1e6 Add basic support for -pthread.
- Patch by David Chisnall, with PCH and Darwin support mixed in.

llvm-svn: 80883
2009-09-03 04:54:28 +00:00
Daniel Dunbar 576d90d39b Remove TargetInfo::getTargetPrefix().
llvm-svn: 79907
2009-08-24 09:54:37 +00:00
Daniel Dunbar 40165180f7 Switch TargetInfo to store an llvm::Triple.
- Primarily to discourage clients form making decisions based on the string.

llvm-svn: 79901
2009-08-24 09:10:05 +00:00
Sanjiv Gupta b841d1baa1 Issue an error if the user specifies parameters in a function marked as ISR.
llvm-svn: 79544
2009-08-20 17:48:52 +00:00
Eli Friedman a9c3d71b59 Add TCE target to clang; patch by Mikael Lepistö.
llvm-svn: 79462
2009-08-19 20:47:07 +00:00
Daniel Dunbar 58bc48c14e Switch to SmallString::str from SmallString::c_str.
- Several FIXMEs due to non-Twinification of IRBuilder.

llvm-svn: 79455
2009-08-19 20:04:03 +00:00
Daniel Dunbar 5232203234 Convert CreateTargetInfo to use a Triple instead of manul string munging.
- Patch by Yonggang Luo (with some formatting tweaks by Eli and myself).

llvm-svn: 79320
2009-08-18 05:47:58 +00:00
Jakob Stoklund Olesen 0de52f906d Support compilation for the blackfin back-end
llvm-svn: 79271
2009-08-17 20:08:44 +00:00
Chris Lattner 859c37a5d9 use the new llvm::Triple parsing stuffola for handling darwin version #'s.
llvm-svn: 78794
2009-08-12 06:24:27 +00:00
Chris Lattner 30ba674391 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 :)

llvm-svn: 78586
2009-08-10 19:03:04 +00:00
Mike Stump b0dd95d6d3 Add armv7 support.
llvm-svn: 78092
2009-08-04 19:48:52 +00:00
Anton Korobeynikov b5b703b2f7 Hook in s390x stuff into clang
llvm-svn: 76099
2009-07-16 20:09:57 +00:00
Chris Lattner 3afa3e1d91 codegen string literals using private linkage now like llvm-gcc, eliminating
some target hooks.

llvm-svn: 75895
2009-07-16 05:03:48 +00:00
Chris Lattner d1d820ed51 add netbsd support, patch by Krister Kalfridsson!
llvm-svn: 75492
2009-07-13 20:29:08 +00:00
Duncan Sands 9cb27e9c08 Correct FreeBSD target info, fixing PR4514.
Patch by Roman Divacky.

llvm-svn: 75003
2009-07-08 13:55:08 +00:00
Sanjiv Gupta 30f95ec27d pic16 preproc defs.
llvm-svn: 74893
2009-07-07 04:42:23 +00:00
Eli Friedman 245f229df4 More tweaks to types for OpenBSD. Patch by Jonathan Gray.
llvm-svn: 74805
2009-07-05 22:31:18 +00:00
Eli Friedman e3aa454e2f Per PR4506, fix the type of size_t on OpenBSD.
llvm-svn: 74795
2009-07-05 18:47:56 +00:00
Eli Friedman fb36b02591 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.

llvm-svn: 74752
2009-07-03 00:45:06 +00:00
Douglas Gregor c05d2a11d7 Two fixes to make Clang build on Visual C++ (again), from Alisdair Meredith.
llvm-svn: 74606
2009-07-01 15:12:53 +00:00
Eli Friedman 2857ccbaa7 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;

llvm-svn: 74583
2009-07-01 03:36:11 +00:00
Torok Edwin b2b37c62d0 Reapply r74532, and inherit from OSTargetInfo instead of from Target.
'make test' passes now.

llvm-svn: 74539
2009-06-30 17:10:35 +00:00
Torok Edwin 4e0541649b Revert 74532 till I figure out why it breaks a bunch of tests.
llvm-svn: 74536
2009-06-30 17:00:25 +00:00
Torok Edwin 45d60b5bc3 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.

llvm-svn: 74532
2009-06-30 16:30:17 +00:00
Daniel Dunbar 86e35b3aba Use true/false instead of 1/0.
llvm-svn: 74479
2009-06-29 23:58:47 +00:00
Daniel Dunbar 302ab13b1a Don't define __KPRINTF_ATTRIBUTE__ unconditionally on OpenBSD.
llvm-svn: 74467
2009-06-29 22:45:37 +00:00