Commit Graph

581 Commits

Author SHA1 Message Date
Simon Atanasyan a1b62273f8 MIPS: Define __mips_dsp_rev / __mips_dspr2 / __mips_dsp macros
if -mdsp or -mdspr2 options are provided.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159774 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-05 20:16:22 +00:00
Simon Atanasyan d797a85866 MIPS: Add -mdsp/-mno-dsp and -mdspr2/-mno-dspr2 command line options support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159769 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-05 19:23:00 +00:00
Simon Atanasyan 1176bcdb21 MIPS: Define __mips16 macro if -mips16 option is provided.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159753 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-05 16:06:06 +00:00
Simon Atanasyan bbd9916bd9 MIPS: Replace the pair of boolean flags by enumeration to hold selected float ABI.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159752 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-05 15:32:46 +00:00
Simon Atanasyan 0b273efa37 MIPS: Add -mips16 / -mno-mips16 command line support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159747 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-05 14:19:39 +00:00
Hal Finkel 39d5fa131f Add additional architecture defines for PPC targets.
Patch by Andy Gibbs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159665 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-03 16:51:04 +00:00
Simon Atanasyan fbf7005138 Support MIPS DSP Rev1 intrinsics.
This patch was reviewed in the llvm-commits list by Jim Grosbach.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159366 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-28 18:23:16 +00:00
Meador Inge c5613b26a2 Explicitly build __builtin_va_list.
The target specific __builtin_va_list types are now explicitly built instead
of injecting strings into the preprocessor input.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158592 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-16 03:34:49 +00:00
Hal Finkel 02a8427786 Add PPC support for translating gcc-style -mcpu options into LLVM -target-cpu options.
This functionality is based on what is done on ARM, and enables selecting PPC CPUs
in a way compatible with gcc's driver. Also, mirroring gcc (and what is done on x86),
-mcpu=native support was added. This uses the host cpu detection from LLVM
(which will also soon be updated by refactoring code currently in backend).

In order for this to work, the target needs a list of valid CPUs -- we now accept all CPUs accepted by LLVM.
A few preprocessor defines for common CPU types have been added.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158334 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-11 22:35:19 +00:00
Craig Topper b6af69ec6c Add XOP feature flag.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158284 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-09 22:24:14 +00:00
Simon Atanasyan 3dbcc889c1 Mips: Define __mips_hard_float macro additional to __mips_single_float
when single float ABI is selected.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157996 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-05 13:06:56 +00:00
Craig Topper 31380fb010 Make disabling SSE levels also disable AVX and FMA.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157907 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-03 22:23:42 +00:00
Craig Topper a7463c3444 Make AES and PCLMUL features imply SSE2 as that's needed to get the right types defined.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157906 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-03 21:56:22 +00:00
Craig Topper 2ae9507269 Add fma feature flag for Intel FMA instructions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157904 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-03 21:46:30 +00:00
Craig Topper 3c0bc15afb Add builtin for pclmulqdq instruction.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157733 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-31 05:18:48 +00:00
Craig Topper 90ea0363ef SSE4A should not imply LZCNT and POPCNT. FMA4 should imply SSE4A. Add missing break at the end of btver1 feature list.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157680 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-30 05:54:54 +00:00
Benjamin Kramer 4dfa5ad7b1 Define __SSE4A__ when targeting new AMD CPUs.
This doesn't really fit the existing SSELevel so it gets an extra flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157630 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-29 17:48:39 +00:00
Roman Divacky 2ae3a47444 Sparc is bigendian.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157626 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-29 16:10:50 +00:00
Justin Holewinski 2c585b9915 Replace PTX back-end with NVPTX back-end in all places where Clang cares
NV_CONTRIB

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157403 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-24 17:43:12 +00:00
Peter Collingbourne edb66f38db Teach Clang about the NVPTX backend.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157173 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 23:28:41 +00:00
Peter Collingbourne 4dc34ebf2a CUDA: add CodeGen support for global variable address spaces.
Because in CUDA types do not have associated address spaces,
globals are declared in their "native" address space, and accessed
by bitcasting the pointer to address space 0.  This relies on address
space 0 being a unified address space.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157167 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-20 21:08:35 +00:00
Sirish Pande 5f9688b7c7 Hexagon V5 FP support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156567 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-10 20:19:54 +00:00
Craig Topper 70d9b16e95 Enable AVX on AMD Bulldozer processors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155900 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-01 07:18:03 +00:00
Evgeniy Stepanov 3206403316 Define __ANDROID__ macro on -androideabi targets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155632 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-26 12:08:09 +00:00
Craig Topper fd93630cce Enable AVX/AVX2 for Sandy Bridge, Ivy Bridge, and Haswell CPUs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155624 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-26 07:31:30 +00:00
Chris Lattner 4ddcf3b08d OpenBSD: Remove incorrect -pthread preprocessor define _POSIX_THREADS and replace
with _REENTRANT. Also remove undef _POSIX_THREADS in phread.h.

Patch by Brad Smith!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155535 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-25 06:12:24 +00:00
Chandler Carruth 6603ff85d4 Revert r155363, due to the underlying patches in LLVM causing regression
test suite failures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155371 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-23 18:25:40 +00:00
Sirish Pande ac28eca18a Hexagon V5 (floating point) support in cfe.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155363 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-23 17:48:57 +00:00
Chandler Carruth 103f41d0e7 Revert some Hexagon builtin commits to match reverts done to LLVM in
r155047. See the LLVM log for the primary motivation:
  http://llvm.org/viewvc/llvm-project?rev=155047&view=rev

Primary commit r154828:
  - Several issues were raised in review, and fixed in subsequent
    commits.
  - Follow-up commits also reverted, and which should be folded into the
    original before reposting:
    - r154837: Re-add the 'undef BUILTIN' thing to fix the build.
    - r154928: Fix build warnings, re-add (and correct) header and
      license
    - r154937: Typo fix.

Please resubmit this patch with the relevant LLVM resubmission.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155048 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-18 21:32:25 +00:00
Simon Atanasyan 8b2a5d2ac0 MIPS: Followup to r154606. Expand list of accepted MIPS target features in the MipsTargetInfoBase::setFeatureEnabled() routine.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154998 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-18 12:00:11 +00:00
Sirish Pande 7ac715fd31 Hexagon V5(Floating Point) support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154828 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-16 17:04:05 +00:00
Simon Atanasyan 10e1629dc3 MIPS: Initialize MIPS CPU's name by default value.
Otherwise MipsTargetInfoBase::getDefaultFeatures() might return an invalid
features set with an empty feature name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154606 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 19:59:24 +00:00
Simon Atanasyan 9091389771 Move some MIPS target macro definitions from class Mips32TargetInfoBase
to the base class MipsTargetInfoBase. These macros are applicable for both
32/64-bits targets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154116 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-05 19:28:31 +00:00
Chad Rosier 7a938fa66b [driver] Create a new -mfpmath= option, which is used to control whether clang
uses Neon instructions for single-precision FP.

-mfpmath=neon is analogous to passing llc -mattr=+neonfp.
-mfpmath=[vfp|vfp2|vfp3|vfp4] is analogous to passing llc -mattr=-neonfp.

rdar://11108618


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154046 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 20:39:32 +00:00
Eric Christopher 0ea6164a7f Add more constraint registers for mips.
Patch by Jack Carter. Testcase cleanup by me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153921 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-03 01:16:32 +00:00
Jim Grosbach 6903313102 ARM backend knows about cortex-m4. The front end should too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153678 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-29 19:53:34 +00:00
Jan Wen Voung dde3bdb62c Define __LITTLE_ENDIAN__ for le32, since "le" stands for little endian.
Add a test for this too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153616 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-29 00:05:59 +00:00
David Chisnall fb02784df0 Fix the type of wchar_t on Solaris.
Patch by Dmitri Shubin!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153585 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-28 18:04:14 +00:00
Eric Christopher d1f853d73d Add better support for $fp and $sp for mips inline asm support.
Patch by Jack Carter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153530 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-27 19:56:11 +00:00
Akira Hatanaka ad8d8a31b0 Add support for MIPS' floating ABIs (hard, soft and single) to clang driver.
Patch by Simon Atanasyan.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153348 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-23 23:07:09 +00:00
Aaron Ballman c0765a06dd No longer defining LP64 in 64-bit builds on platforms which are not LP64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152740 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-14 20:50:57 +00:00
Roman Divacky efe9c0dffc Fix the long double to be of width/align 64. Rename va_list_test to
powerpc_types and add testing for the (long) double there.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152647 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-13 19:20:17 +00:00
Roman Divacky e3d175da72 Long double is just double on FreeBSD/{PPC,PPC64}.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152632 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-13 16:53:54 +00:00
James Molloy e45b9b71b9 Use ZeroLengthBitfieldAlignment for AAPCS, as well as APCS-GNU.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152552 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-12 09:14:10 +00:00
Benjamin Kramer 713575afda TargetInfo: create less temporary strings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152029 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05 15:10:44 +00:00
Hal Finkel 178a9b8b22 Fix an ABI problem with ptrdiff_t and intptr_t on PPC32
ptrdiff_t on PPC32 on Linux, etc. should be int not long.
This does not matter for C, but it does matter for C++ because of
name mangling.

The preprocessor test has been changed accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151935 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 20:54:36 +00:00
David Chisnall b4f0bd6864 Add the Solaris support directory to the header search when using libc++.
Unconditionally define __C99FEATURES__ when using C++ on Solaris.  This is a
(hopefully temporary) work around for libc++ exposing C99-but-not-C++98
features in C++98 mode.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151889 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 10:49:52 +00:00
David Chisnall 165329c1d1 Some more Solaris fixes. Now successfully building libc++ on Solaris with clang (and linking clang against it).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151632 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-28 17:10:04 +00:00
David Chisnall 48fad493cb On Solaris, define some standard macros that the Solaris headers require in
order to not be broken (by Solaris standards).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150822 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 18:35:11 +00:00
Eli Friedman b089c4d91a Set UserLabelPrefix and MCountName correctly for DragonFly BSD. Patch by Sascha Wildner.
Setting UserLabelPrefix correctly fixes PR11949.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150280 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 23:02:29 +00:00
Dylan Noblesmith 6f42b62b61 Basic: import OwningPtr<> into clang namespace
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149798 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 02:12:40 +00:00
Bob Wilson 48b68a0dc3 Use the new Triple::getMacOSXVersion function in another place.
I removed support for "*-darwin*-iphoneos" triples, since we now have
iOS listed as a separate OS in the triples.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149455 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 23:52:58 +00:00
Nico Weber 6e1d2eaa7d Fix "long double" and __SIZE_TYPE__ on powerpc, now with test fix.
Fixes PR11867. Patch from Jeremy Huddleston!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149334 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 02:07:33 +00:00
Nico Weber 3128fa1a5d Revert r149285, it breaks test/Preprocessor/init.c.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149301 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-30 23:53:44 +00:00
Nico Weber acd8c513b9 Fix "long double" and __SIZE_TYPE__ on powerpc.
Fixes PR11867. Patch from Jeremy Huddleston!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149285 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-30 22:25:29 +00:00
Douglas Gregor e727d21d3f Introduce TargetInfo::hasFeature() to query various feature names in
each of the targets. Use this for module requirements, so that we can
pin the availability of certain modules to certain target features,
e.g., provide a module for xmmintrin.h only when SSE support is
available.

Use these feature names to provide a nearly-complete module map for
Clang's built-in headers. Only mm_alloc.h and unwind.h are missing,
and those two are fairly specialized at the moment. Finishes
<rdar://problem/10710060>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149227 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-30 06:38:25 +00:00
John McCall 4188760f6b Complain about attempts to use 'protected' visibility on targets
like Darwin that don't support it.  We should also complain about
invalid -fvisibility=protected, but that information doesn't seem
to exist at the most appropriate time, so I've left a FIXME behind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149186 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 01:20:30 +00:00
Bob Wilson 9f1c49c57d Use defined-at-zero behavior for CLZ/CTZ builtins on PowerPC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149181 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-28 18:02:29 +00:00
Bob Wilson 8b30a9379f Make clz/ctz builtins defined for zero on ARM targets. rdar://10732455
ARM supports clz and ctz directly and both operations have well-defined
results for zero.  There is no disadvantage in performance to using the
defined-at-zero versions of llvm.ctlz/cttz intrinsics.  We're running into
ARM-specific code written with the assumption that __builtin_clz(0) == 32,
even though that value is technically undefined.  The code is failing now
because of llvm optimizations that are taking advantage of the undef
behavior (specifically svn r147255).  There's nothing wrong with that
optimization on x86 where any incorrect assumptions about __builtin_clz(0)
will quickly be exposed.  For ARM, though, optimizations based on that undef
behavior are likely to cause subtle bugs.  Other targets with defined-at-zero
clz/ctz support may want to override the default behavior as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149086 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 22:14:27 +00:00
Sebastian Pop 9ec60dfe77 rename -ccc-host-triple into -target
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148582 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-20 22:01:23 +00:00
Anton Yartsev 9bc23ba9e4 fix for PR11655
changes i64 alignment from 64 to 32 for powerpc-darwin

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148345 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 22:40:00 +00:00
David Blaikie 7530c034c0 Remove unreachable code in Clang. (replace with llvm_unreachable where appropriate or when GCC requires it)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148292 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-17 06:56:22 +00:00
Eli Friedman 31cbe68430 Revert r148138; it's causing test failures.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148141 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-13 21:33:06 +00:00
Sebastian Pop 43115d4904 remove assertions in the Hexagon backend specific clang driver
Patch from Jyotsna Verma:

I have made the changes to remove assertions in the Hexagon backend
specific clang driver. Instead of asserting on invalid arch name, it has
been modified to use the default value.

I have changed the implementation of the CPU flag validation for the
Hexagon backend. Earlier, the clang driver performed the check and
asserted on invalid inputs. In the new implementation, the driver passes
the last CPU flag (or sets to "v4" if not specified) to the compiler (and
also to the assembler and linker which perform their own check) instead of
asserting on incorrect values. This patch changes the setCPU function for
the Hexagon backend in clang/lib/Basic/Targets.cpp which causes the
compiler to error out on incorrect CPU flag values.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148139 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-13 20:37:10 +00:00
Sebastian Pop edd4f3c391 rename -ccc-host-triple into -target
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148138 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-13 20:37:02 +00:00
Evgeniy Stepanov 35dd732fdf Fix -mfpu parsing on ARM.
- Support gcc-compatible vfpv3 name in addition to vfp3.
- Support vfpv3-d16.
- Disable neon feature for -mfpu=vfp* (yes, we were emitting Neon instructions
  for those!).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147943 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-11 11:21:31 +00:00
Benjamin Kramer 5660aa6c68 Add definitions for AMD's bobcat (aka btver1)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147849 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-10 11:50:18 +00:00
Benjamin Kramer 5c65e4f8e0 Enable POPCNT and LZCNT with sse4a.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147848 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-10 11:50:13 +00:00
Benjamin Kramer 448f68d7ef Factor the repetitive cpu macro definition into a helper function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147847 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-10 11:50:09 +00:00
Craig Topper 05fe4b5ce5 Merge AVX/AVX2 into the SSE level.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147771 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-09 09:19:09 +00:00
Joerg Sonnenberger 42378be9a0 __FLT_EVAL_METHOD__ should be 1 on NetBSD/i386, since it defaults to
"double" rounding.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147669 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-06 18:32:26 +00:00
Benjamin Kramer b3453a8104 Penryn doesn't support sse4.2, don't enable it in the first place.
While the code took care of disabling the sse42 flag it didn't know
about popcnt. This broke -march=native on penryn.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147531 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-04 14:36:57 +00:00
Craig Topper 6a511e1407 Add FMA4 feature flag. Intrinsics coming soon. Also make sse4a feature flag imply sse3. Matches gcc behavior.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147370 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-30 07:33:42 +00:00
Craig Topper e14e08b255 Add popcnt feature flag to match gcc. This flag is implied when sse42 is enabled, but can be disabled separately. Move popcnt intrinsics to popcntintrin.h to match gcc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147340 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-29 16:10:46 +00:00
Benjamin Kramer b406669fea Add a target hook for FLT_EVAL_METHOD and use it to set the value on x86 with sse disabled.
x87 math evaluates everything with 80 bits precision, so we have to set FLT_EVAL_METHOD
to "2".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147311 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-28 15:47:06 +00:00
Craig Topper 31ceea0965 Add BMI, BMI2, and LZCNT feature flags to enable adding intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147262 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-25 05:06:45 +00:00
Eli Friedman e6a24e83e7 Add support for bitcasts to vector type in Evaluate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147137 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-22 03:51:45 +00:00
Nick Lewycky 9bddf4324a Bump suitable alignment on darwin ppc 32/64 and x86-32 to 16 bytes. I don't
actually know about the other OSes on X86-32 besides Linux...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147034 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21 04:25:47 +00:00
Fariborz Jahanian 00852e4126 objc-arc: bridge casts in non-objc-arc mode are ignord.
But, warn too. // rdar://10597832


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146904 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19 21:06:15 +00:00
Craig Topper 2b03bb0314 Add -mavx2 and -mno-avx2 command line support. Also add core-avx2 processor type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146835 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 19:55:21 +00:00
Nick Lewycky 7ec59c78f1 Add the value of "suitably aligned" from the C++11 standard to Basic/TargetInfo.
This is equal to alignof(std::max_align_t) on the platform and equal to the
alignment provided by malloc. (Platform owners please double-check your
platform's value.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146762 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 22:34:14 +00:00
Nick Lewycky 9952070fa2 Fix 80-column violation and whitespace. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146761 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 22:32:39 +00:00
Eli Friedman 62d829abaf gcov-style profiling support for OpenBSD. Patch by Jonathan Gray.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146631 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 02:15:56 +00:00
Tony Linthicum 9631939f82 Hexagon backend support
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146413 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 21:14:55 +00:00
Eli Friedman 6d402dc963 Misc Minix-specific changes to clang:
. move compiler-rt to a separate directory so the -L argument only includes compiler-rt (thanks joerg)
. build all clang subdirs
. switches the Minix platform to ELF
. normalizes toolchain invocation

Patch by Ben Gras.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146206 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 23:54:21 +00:00
Eric Christopher c5f9a011a5 Add support for AVX registers to clang inline asm. Add a small testcase
and update the Sema testcase with a register that we won't hit for a while
I hope.

Fixes rdar://10510405

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145671 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-02 02:12:16 +00:00
Eli Friedman ee1ad99f1c When we're passing a vector with an illegal type through memory on x86-64, use byval so we're sure the backend does the right thing. Fixes va_arg with illegal vectors and an obscure ABI mismatch with __m64 vectors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145652 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-02 00:11:43 +00:00
Benjamin Kramer 61ea4fe2c2 Add support for AMD's bulldozer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145606 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-01 18:23:59 +00:00
Rafael Espindola 53ac3d88f9 Make our handling of MMX x SSE closer to what gcc does:
* Enabling sse enables mmx.
* Disabling (-mno-mmx) mmx, doesn't disable sse (we got this right already).
* The order in not important. -msse -mno-mmx is the same as -mno-mmx -msse.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145194 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-27 20:00:43 +00:00
James Molloy a6d81f9a2d AAPCS compliance - 32-bit wchar_t should be unsigned for both aapcs and aapcs-linux.
Original behaviour of defining wchar_t as signed int has been kept for apcs-gnu as I don't have any spec for this to validate against.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145102 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-23 13:35:08 +00:00
Douglas Gregor c9a237168c Define some built-ins macros on mips32 platform, from Simon Atanasyan!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144189 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 15:17:16 +00:00
Akira Hatanaka 148735ecc7 Move definitions of SizeType and PtrDiffType to Mips32TargetInfoBase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143775 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-05 01:48:34 +00:00
Douglas Gregor 21a25167b8 Fix various minor issues find via unreachable code warnings, from
Ahmed Charles!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143569 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-02 20:52:01 +00:00
Anders Carlsson eea6480255 In x86_64, when calling an Objective-C method that returns a _Complex long double, make sure to use the objc_msgSend_fp2ret function which ensures that the return value will be {0, 0} if the receiver is nil.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143350 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-31 16:27:11 +00:00
Roman Divacky 80b32b8c65 Add support for sse4a and enable it for amdfam10 cpu.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143312 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-30 13:47:56 +00:00
Roman Divacky 01c770d6c9 Add support for amdfam10 cpu.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143305 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-30 07:48:46 +00:00
Dan Gohman 78cf13db14 Remove the Blackfin backend.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142881 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-25 00:06:12 +00:00
Dan Gohman 0986eb5c59 Remove the SystemZ backend.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142879 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-24 23:48:52 +00:00
Akira Hatanaka c7d0ab174c Make changes necessary for N32/64 ABI conformance.
- Size of long double is 16 bytes for both N32 and N64.
- Size of pointers and long is 8 bytes for N64.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142705 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-22 00:07:27 +00:00
Benjamin Kramer 474202f657 Use llvm::Triple's methods to parse FreeBSD version numbers.
Who could've thought that FreeBSD would ever reach version 10!
Patch from Dimitry Andric.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142349 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-18 10:10:08 +00:00
Benjamin Kramer 86d18c5638 Place static initializers on linux into the ".text.startup" section, so the linker can group them together for performance.
This only has an effect with fairly new binutils (2.21.51 or later). Other ELF targets probably want this as well, but on BSDs binutils is usually old so it doesn't matter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142076 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-15 17:53:33 +00:00
Eli Friedman 2be4607239 Misc fixes for atomics. Biggest fix is doing alignment correctly for _Atomic types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142002 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-14 20:59:01 +00:00
Anton Korobeynikov 7e1812fa60 Add target info for Linux on PPC & Sparc.
Patch by Hal Finkel!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141772 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-12 09:30:58 +00:00
David Meyer dd4a889f6a Allow regparm attribute for PNaCl target
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141638 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-11 03:12:01 +00:00
Lang Hames 567c60024a Fixed natural stack alignment for Linux x86-32. Thanks Eli.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141617 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-11 00:52:51 +00:00
Lang Hames f4f5003041 Update target data strings for ARM and X86 to include the natural stack
alignment parameter "S<size>" that was introduced in r141599.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141601 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-10 23:44:43 +00:00
Eli Friedman 209f5bb70b Add address spaces for TCE target. Patch by Pekka Jääskeläinen.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141390 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-07 19:51:42 +00:00
Justin Holewinski 25bedca834 PTX: Add some basic support for OpenCL address spaces
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141008 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-03 17:28:37 +00:00
Chandler Carruth 83450aa7e7 Fix a typo spotted by Jonathan Sauer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140708 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-28 18:17:30 +00:00
Chandler Carruth 5b7803db01 Attempt to silence the GCC -Wreturn-type warning...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140693 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-28 10:49:06 +00:00
Chandler Carruth 49defe6301 Generate tests for all of the x86 SIMD instruction feature set
predefines based on the output of GCC as well as the CPU predefines.

Invert tests for __AVX__, Clang's AVX feature is hard coded off still.

Switch Atom from 'SSE3' to 'SSSE3'. This matches GCC's behavior, Intel's
documentation, and ICC's documentation (such as I could dig up).

Switch Athlon and Geode to enable 3dnowa rather than just 3dnow and
nothing (resp.).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140692 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-28 10:36:46 +00:00
Chandler Carruth 53bf4f9418 Fix a think-o on my part that got enshrined in a FIXME by setting up the
__tune_...__ define as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140690 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-28 09:54:11 +00:00
Chandler Carruth 88c75b0af1 Move some of the defines down to more natural locations, consolidating
the target identifying macros at the top, including subtarget macros.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140689 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-28 09:54:07 +00:00
Chandler Carruth 26a3914eed Teach Clang to reject 32-bit only CPUs when compiling in 64-bit mode.
Add 64-bit preprocessor macro tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140688 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-28 09:45:08 +00:00
Chandler Carruth f17ba331e8 Simplify the control flow for predefined macro selection by using
fallthrough now that we're working with a switch. Also remove a dubious
"feature" regarding k6 processors and 3dnow and leave a fixme... Not
that anyone is likely to care about correct tuning for k6 processors
with and w/o 3dnow...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140687 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-28 09:45:05 +00:00
Chandler Carruth d9d3ddff44 Switch the X86TargetInfo object from a string representation of the
selected CPU model to the enumeration. This parses the string
representation once using a StringSwitch on SetCPU. It returns an error
for strings which are not recognized (yay!). Finally it replaces
ridiculous if-chains with switches that cover all enumerators.

The last change required adding several missing entries to the features
function. These were obvious on inspection. Yay for a pattern that gives
warnings when we miss one.

No new test cases yet, as I want to get the 64-bit errors working first.
I'll then start fleshing out the testing more. Currently I'm primarily
testing on Linux, but I'm hoping check whether there are interesting
differences on darwin before long...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140685 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-28 08:55:37 +00:00
Chandler Carruth 499d972f08 Introduce an enumeration for the x86 CPUs recognized by Clang. I've
tried to give these nice doxyments, but if I've gotten any of my history
wrong, please chime in.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140684 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-28 08:55:34 +00:00
Chandler Carruth c3a2e654f1 Clean up a bit of the uses of CPU in the TargetInfo classes. This makes
it an error if a CPU is provided for a target that doesn't implement
logic handling CPU settings, to match the ABI settings. It also removes
the CPU parameter from the getDefaultFeatures method. This parameter was
always filled in with the same value as setCPU was called with, and at
this point every single target implementation that referenced the CPU
within this function has needed to store the CPU via setCPU anyways in
order to implement other interface points.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140683 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-28 05:56:05 +00:00
Chandler Carruth f6cf1c28fb Begin fixing Clang's predefined macros for various architectures. This
is *very* much a WIP that I'll be refining over the next several
commits, but I need to get this checkpoint in place for sanity.

This also adds a much more comprehensive test for architecture macros,
which is roughly generated by inspecting the behavior of a trunk build
of GCC. It still requires some massaging, but eventually I'll even check
in the script that generates these so that others can use it to append
more tests for more architectures, etc.

Next up is a bunch of simplification of the Targets.cpp code, followed
by a lot more test cases once we can reject invalid architectures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140673 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-28 02:59:25 +00:00
David Blaikie d6471f7c19 Rename Diagnostic to DiagnosticsEngine as per issue 5397
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140478 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-25 23:23:43 +00:00
David Blaikie 9fe8c74a93 Fix missing includes for llvm_unreachable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140368 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 05:35:21 +00:00
David Blaikie b219cfc4d7 Switch assert(0/false) llvm_unreachable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140367 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 05:06:16 +00:00
Justin Holewinski d8e0fe617a PTX: Clean up target options code
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140320 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-22 17:57:40 +00:00
Akira Hatanaka bf5851a9f2 Define Mips64 TargetInfo classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140174 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 19:21:49 +00:00
Akira Hatanaka b6a37b38c9 Clean up TargetInfo class hierarchy. Define a base class from which TargetInfos
of Mips32 big and little endian derive.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140170 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 19:00:23 +00:00
Ivan Krasin 68018db767 Clarify PNaCl target characteristics: set LongDoubleWidth, PtrDiffType, IntPtrType,
change __builtin_va_list to from a structure to int[4] (same alignment
and size, but with a simpler representation). Patch by David Meyer!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140144 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 14:56:54 +00:00
Francois Pichet 62ec1f2fd7 Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear that this flag must be used only for Microsoft extensions and not emulation; to avoid confusion with the new LangOptions::MicrosoftMode flag.
Many of the code now under LangOptions::MicrosoftExt will eventually be moved under the LangOptions::MicrosoftMode flag.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139987 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-17 17:15:52 +00:00
Justin Holewinski 808ef66afb PTX: Define target options
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139789 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 12:13:38 +00:00
Akira Hatanaka ab9b154c93 Add comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139700 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 17:24:05 +00:00
Akira Hatanaka 36f37b6f57 O64 will not be supported.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139655 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 22:47:52 +00:00
Akira Hatanaka 1d19edc492 mips*-*-psp is no longer supported as a target.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139654 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 22:46:13 +00:00
Douglas Gregor e289d81369 Switch LangOptions over to a .def file that describes header of the
language options. Use that .def file to declare the LangOptions class
and initialize all of its members, eliminating a source of annoying
initialization bugs.

AST serialization changes are next up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139605 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 17:21:33 +00:00
Ivan Krasin f619cdc132 Clang/PNaCl: Improve test coverage for PNaClTargetInfo (type aligns), fixes nits:
- wrong alignment for double (it was 4, but 8 is desired),
- added checks for _REENTRANT define,
- fixed the issue that defines were not tested (because the check for inside #ifdef).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138775 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-29 22:39:12 +00:00
Ivan Krasin 089ee11529 PNaClTargetInfo: add __ELF__, _REENTRANT and _GNU_SOURCE defines and update the test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138607 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-25 23:49:20 +00:00
Ivan Krasin bba43efdec Follow up to r138470 (Add PNaCl TargetInfo). I've occasionally submitted wrong patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138489 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24 21:22:25 +00:00
Ivan Krasin ef05abda02 Add PNaCl TargetInfo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138470 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24 20:22:22 +00:00
Bruno Cardoso Lopes 292772c165 "-mavx" should also enable all other SSE levels.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137905 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-18 00:07:03 +00:00
Chad Rosier 6e43f3f0e2 Additional comments and whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136892 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04 17:52:43 +00:00
Chad Rosier 61a62216a0 Add partial support for using anonymous bitfields (e.g., int : 0) to enforce
alignment.  This fixes cases where the anonymous bitfield is followed by a 
non-bitfield member.  E.g.,

struct t4
{
  int foo : 1;
  long : 0;
  char bar;
};

Part of rdar://9859156

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136858 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04 01:21:14 +00:00
Benjamin Kramer b9a8adf57b Remove dead code flagged by GCC's -Wunused-but-set-variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136581 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-31 01:06:41 +00:00
Eric Christopher 895d4220e5 Add support for the 'Q' arm memory constraint.
Fixes rdar://9866494


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136524 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-29 21:20:35 +00:00
Chad Rosier 9f1210c328 After further discussion it has been determined that alignof should report
the preferred alignment.  Thus, revert r135934, r135935, and r135940.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136062 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-26 07:03:04 +00:00
Chad Rosier 822f54a7ba Allow target to specify about using minimum alignment vs preferred. Takes care of
FIXME: Override "preferred align" for double and long long for ARM apcs-gnu ABI. 
Also part of rdar://9802874

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135940 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-25 19:39:39 +00:00
Chris Lattner 5f9e272e63 remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-23 10:55:15 +00:00
Bruno Cardoso Lopes 8c24d1a294 Define the _MIPS_SIM builtin macro on MIPS platforms. Patch by Robert Millan!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135675 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-21 15:10:57 +00:00
Chad Rosier d9259f373f Refactor r135502 to avoid an empty if else condition, per Eric's suggestion (good call!).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135510 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-19 20:00:06 +00:00
Chad Rosier b536a1565c Clang asserts "Invalid environment!" when using -ccc-host-triple
arch-pc-win32-macho (e.g., x86_64-pc-win32-macho), which appears to be a false
positive.
rdar://9786307

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135502 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-19 19:36:03 +00:00
Chris Lattner 48b78bda3e simplify
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135170 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-14 18:45:41 +00:00
Chris Lattner 1e5f83ba51 StringMap::first() is about to start returning a StringRef, adapt.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135166 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-14 18:24:21 +00:00
Bruno Cardoso Lopes e02d391ffe Disable avx feature from corei7-avx, and use -mavx for now. Right now, if -mavx is
specified, 128 avx code is used and we're not sure yet if this the behavior
we want (and if it does, some improvements are needed before relying on it).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134939 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-11 23:33:46 +00:00