Commit Graph

1227 Commits

Author SHA1 Message Date
Bill Wendling 0517508c00 Don't emit a warning with an input/output parameter. We assume the user knows what they're doing here.
llvm-svn: 169059
2012-11-30 23:46:56 +00:00
Bill Wendling 3c6591d6ea Don't warn if the input size is less than the register size. Also don't warn if
the output size is greater than the register size. No truncation occurs with
those. Reword warning to make it clearer what's the problem is.

llvm-svn: 169054
2012-11-30 23:18:12 +00:00
Quentin Colombet 2e9952ef60 Add ARM cortex-a5 subtarget
llvm-svn: 168958
2012-11-29 23:15:27 +00:00
Quentin Colombet 9b541ff6af Revert commit revision r168953, to change the commit message, which was empty
llvm-svn: 168956
2012-11-29 23:07:08 +00:00
Quentin Colombet 2b14712eca (no commit message)
llvm-svn: 168953
2012-11-29 22:58:40 +00:00
Eli Friedman 4e91899e7b Fix the definition of the vfork() builtin on Haiku. PR14378.
llvm-svn: 168674
2012-11-27 02:58:24 +00:00
Eli Friedman 102dc4e30d Add missing "break". Thanks to Craig for spotting it.
I'm looking at ways to fix the relevant test so it can catch this sort of mistake.

llvm-svn: 168618
2012-11-26 21:57:28 +00:00
Benjamin Kramer 37196de31e Enable inlining of 4 byte atomic ops on ppc32, 8 byte atomic ops on ppc64.
Also fixes a bit/byte mismatch when checking if a target supports atomic ops of a certain size.

llvm-svn: 168260
2012-11-17 17:30:55 +00:00
Eli Friedman 3e94f57a0f Add missing features for misc x86 CPUs to CPU feature translation. Patch by Jung-uk Kim.
llvm-svn: 168239
2012-11-17 01:43:10 +00:00
Eli Friedman 1beddcffc3 Clean up X86 target feature translation code slightly. No intended functional change. Patch by Jung-uk Kim.
llvm-svn: 168237
2012-11-17 01:16:19 +00:00
Douglas Gregor f8715de599 Since CreateTargetInfo is taking ownership of the target options, pass
it as a pointer. 

llvm-svn: 168136
2012-11-16 04:24:59 +00:00
Richard Smith 0b50cb79ad Add -cc1 option -fno-diagnostics-use-presumed-location, a handy mode for
working with preprocessed testcases. This causes source locations in
diagnostics to point at the spelling location instead of the presumed location,
while still keeping the semantic effects of the line directives (entering and
leaving system-header mode, primarily).

llvm-svn: 168004
2012-11-14 23:55:25 +00:00
Eric Christopher fd081ca50a Remove the cellspu port.
Approved by Chris Lattner.

llvm-svn: 167983
2012-11-14 22:08:59 +00:00
Bill Wendling 3c7fed87d2 The register constraint could mean a 16- or 8-bit register.
llvm-svn: 167735
2012-11-12 18:52:32 +00:00
Bill Wendling 887b485dbe Check that the input size is correct for the given constraint.
The 'a', 'c', and 'd' constraints on i386 mean a 32-bit register. We cannot
place a 64-bit value into the 32-bit register. Error out instead of causing the
compiler to spew general badness.
<rdar://problem/12415959>

llvm-svn: 167717
2012-11-12 06:42:51 +00:00
Nico Weber 07351f8e78 Remove unneeded includes from IdentifierTable
llvm-svn: 167694
2012-11-11 21:39:39 +00:00
Michael Liao 625a875f05 Add clang support of RTM from TSX
- New options '-mrtm'/'-mno-rtm' are added to enable/disable RTM feature
- Builtin macro '__RTM__' is defined if RTM feature is enabled
- RTM intrinsic header is added and introduces 3 new intrinsics, namely
  '_xbegin', '_xend', and '_xabort'.
- 3 new builtins are added to keep compatible with gcc, namely
  '__builtin_ia32_xbegin', '__builtin_ia32_xend', and '__builtin_ia32_xabort'.
- Test cases for pre-defined macro and new intrinsic codegen are added.

llvm-svn: 167665
2012-11-10 05:17:46 +00:00
Argyrios Kyrtzidis dc6bb4982f Add a SourceLocation::printToString() that returns in a std::string what dump()
writes to stderr; for debugging purposes.

llvm-svn: 167629
2012-11-09 19:40:48 +00:00
Benjamin Kramer d0b9f090fb Set TLSSupported to false on Haiku.
Haiku does not support this (yet). Leaving it set to true leads to
configure scripts detecting __thread being available and Clang emitting
code for it, resulting in binaries the runtime_loader will refuse to
load.

Patch by Jonathan Schleifer!

llvm-svn: 167576
2012-11-08 12:59:15 +00:00
Daniel Dunbar 65706d85b6 Basic: Windows doesn't define S_IFIFO.
llvm-svn: 167468
2012-11-06 17:08:24 +00:00
Daniel Dunbar e2951f48bf Frontend: Add support for reading named pipes as the main file.
- The whole {File,Source}Manager is built around wanting to pre-determine the
   size of files, so we can't fit this in naturally. Instead, we handle it like
   we do STDIN, where we just replace the main file contents upfront.

llvm-svn: 167419
2012-11-05 22:53:33 +00:00
Richard Smith 43f9d9c6d9 Rename LangOptions members for address sanitizer and thread sanitizer from
*Sanitizer to Sanitize* in preparation for later patches.

llvm-svn: 167405
2012-11-05 21:48:12 +00:00
Seth Cantrell 4902e033b5 isLegalUTF8() was giving the wrong answer
invalid but not caught by isLegalUTF8(): 0xED 0x75 0x84

llvm-svn: 167063
2012-10-30 23:50:26 +00:00
Bill Schmidt cec4cb151a This patch adds alignment information for long double to the 64-bit PowerPC
ELF subtarget.

The existing description string is moved from PPC64TargetInfo to its
DarwinTargetInfo subclass, to avoid any changes to the Darwin ABI.
PPC64TargetInfo now has two possible description strings: one for FreeBSD,
which requires 8-byte alignment, and a default string that requires
16-byte alignment.

I've added a test for PPC64 Linux to verify the 16-byte alignment.  If
somebody wants to add a separate test for FreeBSD, that would be great.

Note that there is a companion patch to update the alignment information
in LLVM, which I am committing now as well.

llvm-svn: 166927
2012-10-29 14:59:24 +00:00
Ulrich Weigand 7bcc7ec745 Handle '*' and '#' asm constraint modifiers.
llvm-svn: 166924
2012-10-29 12:20:54 +00:00
Bill Wendling 9d1ee1175d Recommit Eric's code to validate ASM string's constraints and modifiers.
This code checks the ASM string to see if the output size is able to fit within
the variable specified as the output. For instance, scalar-to-vector conversions
may not really work. It's on by default, but can be turned off with a flag if
you think you know what you're doing.

This is placed under a flag ('-Wasm-operand-widths') and flag group ('-Wasm').

<rdar://problem/12284092>

llvm-svn: 166737
2012-10-25 23:28:48 +00:00
David Tweed 8f67653d26 Modify the targets to set appropriate calling convention defaults and C variables when using a gnueabihf or aapcs-vfp target.
Tested by me and Wei-Ren Chen.

llvm-svn: 166679
2012-10-25 13:33:01 +00:00
Bill Wendling d75987dde9 Revert r166647 to rethink the patch...
llvm-svn: 166655
2012-10-25 00:32:44 +00:00
Bill Wendling 753c8782df Add some support for diagnosing possibly mismatched constraint, type size and
modifiers. (From an idea by Eric...)
<rdar://problem/12284092>

llvm-svn: 166647
2012-10-25 00:05:55 +00:00
Douglas Gregor 811db4eac4 Make DiagnosticOptions intrusively reference-counted, and make sure
the various stakeholders bump up the reference count. In particular,
the diagnostics engine now keeps the DiagnosticOptions object alive.

llvm-svn: 166508
2012-10-23 22:26:28 +00:00
Daniel Dunbar d9debab629 Fix pre-commit refacto failure.
llvm-svn: 166431
2012-10-22 18:56:43 +00:00
Daniel Dunbar f7124da497 driver/Darwin: Follow up to last patch, M-class CPUs are AAPCS but not EABI.
llvm-svn: 166430
2012-10-22 18:51:13 +00:00
Argyrios Kyrtzidis 73ccdb9c15 When associating file ranges of macro arguments with their
macro expansion ranges, make sure to check all the FileID
entries that are contained in the spelling range of the
expansion for the macro argument.

Fixes rdar://12537982

llvm-svn: 166359
2012-10-20 00:51:32 +00:00
Craig Topper 5e79ee087e Teach getColumnNumber to use the line cache to get the start of the line if its on the same line as the last call to getLineNumber. Prevents needing to scan backwards for the new line. Fixes PR14106.
llvm-svn: 166265
2012-10-19 04:40:38 +00:00
Douglas Gregor cb177f15e7 Serialize TargetOptions into an AST file, and make sure that we keep
target options around so they can be accessed at any point (rather
than keeping them transient).

llvm-svn: 166072
2012-10-16 23:40:58 +00:00
Derek Schuff a202096dc0 Add pnaclcall convention to Native Client targets.
Because PNaCl bitcode must be target-independent, it uses some
different bitcode representations from other targets (e.g. byval and
sret for structures). This means that without additional type
information, it cannot meet some native ABI requirements for some
targets (e.g. passing structures containing unions by value on
x86-64). To allow generation of code which uses the correct native
ABIs, we also support triples such as x86_64-nacl, which uses
target-dependent IR (as opposed to le32-nacl, which uses byval and
sret).

To allow interoperation between the two types of code, this patch adds
a calling convention attribute to be used in code compiled with the
target-dependent triple, which will generate code using the le32-style
bitcode. This calling convention does not need to be explicitly
supported in the backend because it determines bitcode representation
rather than native conventions (the backend just needs to undersand
how to handle byval and sret for the Native Client OS).

This patch implements __attribute__((pnaclcall)) to generate calls in
bitcode according to the le32 bitcode conventions, an attribute which
is accepted by any Native Client target, but issues a warning
otherwise.

llvm-svn: 166065
2012-10-16 22:30:41 +00:00
Douglas Gregor bc10b9fbc5 Teach TargetInfo to hold on to the TargetOptions with which it was
created.

llvm-svn: 165943
2012-10-15 16:45:32 +00:00
Douglas Gregor 5952766628 Introduce the notion of excluded headers into the module map
description. Previously, one could emulate this behavior by placing
the header in an always-unavailable submodule, but Argyrios guilted me
into expressing this idea properly.

llvm-svn: 165921
2012-10-15 06:28:11 +00:00
Eli Friedman d13b41e32a Add TargetInfo for r600.
Patch by Tom Stellard.

llvm-svn: 165850
2012-10-12 23:32:00 +00:00
Ted Kremenek bd1d7fa460 Silence dead store warning. It is conceptually possible we will
add more code that references SourceFile, so removing the dead store
doesn't seem appropriate for the long term.

llvm-svn: 165837
2012-10-12 22:56:33 +00:00
Derek Schuff 57b7e8f63f Properly factor Native Client defines to support NaCl as an OS
with x86/ARM architecture

llvm-svn: 165722
2012-10-11 16:55:58 +00:00
Derek Schuff c7dd722f0f Make X86_64ABIInfo clean for ABIs with 32 bit pointers, such as X32
and Native Client

llvm-svn: 165715
2012-10-11 15:52:22 +00:00
Manman Ren a45358c284 X86: add F16C support in Clang
Support the following intrinsics:
  _mm_cvtph_ps, _mm256_cvtph_ps, _mm_cvtps_ph, _mm256_cvtps_ph

rdar://12407875

llvm-svn: 165685
2012-10-11 00:59:55 +00:00
Logan Chien 57086ce248 Fix PR 11709: Change the definition of va_list to meet AAPCS requirement
AAPCS ABI Section 7.1.4 [1] specifies that va_list
should be defined as struct __va_list { void *__ap;};
And in C++, it is defined in namespace std.

[1] http://infocenter.arm.com/help/topic
         /com.arm.doc.ihi0042d/IHI0042D_aapcs.pdf

Patch by Weiming Zhao.

llvm-svn: 165609
2012-10-10 06:56:20 +00:00
Aaron Ballman e91c6be01e Allowing individual targets to determine whether a given calling convention is allowed or ignored with warning. This allows for correct name mangling for x64 targets on Windows, which in turn allows for linking against the Win32 APIs.
Fixes PR13782

llvm-svn: 165015
2012-10-02 14:26:08 +00:00
Bob Wilson 6fc8fb8da5 Add ARM VFPv4 feature and enable it by default for Swift.
llvm-svn: 164906
2012-09-29 23:52:52 +00:00
Bob Wilson d7cf104dae Add armv7s and some other arm variants supported by Mach-O files.
llvm-svn: 164905
2012-09-29 23:52:50 +00:00
Argyrios Kyrtzidis 43af5132c5 In the Module class, add a reference to the corresponding AST file.
llvm-svn: 164873
2012-09-29 01:06:04 +00:00
Daniel Jasper d2e6f65b1b Set Diag.ErrorOccurred even if a DiagnosticConsumer does not want it in
diagnostic count.

If a DiagnosticConsumer sub-class overwrites IncludeInDiagnosticCounts,
this should change diagnostic counts. However, it currently also
influences Diag.ErrorOccurred, which in turn influences the behavior of
parsing and semantic analysis (in a way that can make it crash).

llvm-svn: 164824
2012-09-28 15:45:07 +00:00
Alexander Kornienko 1d26c02722 Macro history (de-)serialization. Deserialization currently reads only the latest macro definition. Needs more work.
Summary: Passes all tests (+ the new one with code completion), but needs a thorough review in part related to modules.

Reviewers: doug.gregor

Reviewed By: alexfh

CC: cfe-commits, rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D41

llvm-svn: 164610
2012-09-25 17:18:14 +00:00