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

1311 Коммитов

Автор SHA1 Сообщение Дата
Adhemerval Zanella b0fc94ceaf PowerPC: fix __builtin_eh_return_data_regno return
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173188 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 20:02:45 +00:00
Akira Hatanaka dbee949171 [mips] Enable inlining of atomic ops on mips32 and mips64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172855 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 21:58:11 +00:00
Will Dietz 4f45bc099f [ubsan] Add support for -fsanitize-blacklist
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172808 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 11:30:38 +00:00
Douglas Gregor b6cbe51723 Implement parsing, AST, (de-)serialization, and placeholder global
metadata for linking against the libraries/frameworks for imported
modules.

The module map language is extended with a new "link" directive that
specifies what library or framework to link against when a module is
imported, e.g.,

  link "clangAST"

or

  link framework "MyFramework"

Importing the corresponding module (or any of its submodules) will
eventually link against the named library/framework.

For now, I've added some placeholder global metadata that encodes the
imported libraries/frameworks, so that we can test that this
information gets through to the IR. The format of the data is still
under discussion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172437 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14 17:21:00 +00:00
Dmitri Gribenko cfa88f8939 Remove useless 'llvm::' qualifier from names like StringRef and others that are
brought into 'clang' namespace by clang/Basic/LLVM.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172323 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-12 19:30:44 +00:00
Matt Beaumont-Gay c3cd6f7a5d Fix -Wunused-comparison for comparisons in arguments to function-like macros.
Previously, -Wunused-comparison ignored comparisons in both macro bodies and
macro arguments, but we would still emit a -Wunused-value warning for either.
Now we correctly emit -Wunused-comparison for expressions in macro arguments.

Also, add isMacroBodyExpansion to SourceManager, to go along with
isMacroArgExpansion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172279 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-12 00:54:16 +00:00
Guy Benyei 7266cf6464 Enable intel_ocl_bicc for x86_64 target only. Remove fix from 171969 that enabled this extension for multiple targets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172052 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 10:41:05 +00:00
Akira Hatanaka 390a70f718 [mips] Fix data layout string. Add 64 to the list of native integer widths
and add stack alignment information.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171588 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 02:04:34 +00:00
Argyrios Kyrtzidis 35abfcd328 DiagnosticIds: Fix offset/ID calculation, no impact outside this code.
Patch by Will Dietz:

Minor touchup so the values of Offset/ID reflect their intention.
Previously, the sum (Offset+ID) was correct, but Offset/ID
individually were wrong.

Caught by investigating unsigned overflow reported by -fsanitize=integer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171421 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 22:26:07 +00:00
Anshuman Dasgupta 1a090f1b23 Correct Hexagon DataLayout string. Fixes bug 14744.
Patch by Krzysztof Parzyszek!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171415 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 21:25:57 +00:00
Richard Smith 4e24f0f711 s/CXX0X/CXX11/g, except for __GNU_EXPERIMENTAL_CXX0X__, and update a few nearby 'C++0x' comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171372 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 12:01:23 +00:00
Chandler Carruth 3b844ba7d5 Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate to
reflect the migration in r171366.

Re-sort the #include lines to reflect the new paths.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171369 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 11:45:17 +00:00
Richard Smith 80ad52f327 s/CPlusPlus0x/CPlusPlus11/g
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171367 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 11:42:31 +00:00
Guy Benyei 38980086c0 Add intel_ocl_bicc calling convention as a function attribute to clang. The calling convention is already implemented in LLVM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171056 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-25 08:53:55 +00:00
Quentin Colombet ab13751d76 Add ARM cortex-r5 subtarget as available mcpu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170909 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-21 17:57:47 +00:00
Daniel Jasper 65548b305a Remove namespace qualifier that lead to build breakage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170759 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-20 20:31:38 +00:00
Daniel Jasper 909610266e Move operator precedence calculation to new header
Thereby, it can be reused by clang-format and others.
Review: http://llvm-reviews.chandlerc.com/D229

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170757 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-20 20:25:19 +00:00
Bill Wendling ad017fa7a4 Revert r170500. It over-zealously converted *ALL* things named Attributes, which is wrong here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170721 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-20 19:22:21 +00:00
Richard Smith 5b9268f26a Fix code that attempted to produce a diagnostic with one DiagnosticEngine, then
produce a note for that diagnostic either with a different DiagnosticEngine or
after calling DiagnosticEngine::Reset(). That didn't make any sense, and did the
wrong thing if the original diagnostic was suppressed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170636 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-20 02:22:15 +00:00
Bill Wendling 094dbf9171 Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170500 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-19 07:18:12 +00:00
Craig Topper d53c2d30cf Don't use SourceLineCache in getColumnNumber if LastLineNoResult is past the end of the cache. Fixes PR14570.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170281 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-16 05:58:32 +00:00
NAKAMURA Takumi e72f4d93ed Targets.cpp: [cygwin] Add the predefined macro "_X86_", according to newer version of cygwin/w32api.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170188 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-14 10:17:26 +00:00
Guy Benyei 8a03357d13 Remove little endian specification from SPIR data layout - SPIR doesn't define endiannes in the data layout.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170125 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13 13:22:48 +00:00
Rafael Espindola 27fa2364b0 Initial support for FreeBSD on ARM.
Patch by Andrew Turner.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170096 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13 04:17:14 +00:00
Benjamin Kramer 21fa5d182f PR14581: Make SourceLocation::printToString work, or it will always return an empty string.
No test case, this is debugging code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169980 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-12 14:17:17 +00:00
Douglas Gregor 1b257afbae Use @import rather than @__experimental_modules_import, since the
latter is rather a mess to type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169919 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 22:11:52 +00:00
Guy Benyei bd5da3ca59 Add SPIR32/SPIR64 targets to Clang
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169917 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 21:38:14 +00:00
Benjamin Kramer a07b59e5e9 Speed up looking up static diagnostic infos.
Instead of doing a binary search over the whole diagnostic table (which weighs
a whopping 48k on x86_64), use the existing enums to compute the index in the
table. This avoids loading any unneeded data from the table and avoids littering
CPU caches with it. This code is in a hot path for code with many diagnostics.

1% speedup on -fsyntax-only gcc.c, which emits a lot of warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169890 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 18:00:22 +00:00
Argyrios Kyrtzidis e5d30e3b40 Extend stat query APIs to explicitly specify if the query is for
a file or directory, allowing just a stat call if a file descriptor
is not needed.

Doing just 'stat' is faster than 'open/fstat/close'.
This has the effect of cutting down system time for validating the input files of a PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169831 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11 07:48:23 +00:00
Aaron Ballman fff3248e69 Virtual method overrides can no longer have mismatched calling conventions. This fixes PR14339.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169705 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-09 17:45:41 +00:00
David Chisnall 6e399b42b5 long double should be 64 bits on FreeBSD/MIPS64. It possibly should be on
Linux too, as I think we inherited it from there.  The ABI spec says 128-bit,
although I think SGI's compiler on IRIX may be the only thing ever to support
this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169674 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-08 09:06:08 +00:00
DeLesley Hutchins 12f37e4114 Fix analysis based warnings so that all warnings are emitted when compiling
with -Werror.  Previously, compiling with -Werror would emit only the first
warning in a compilation unit, because clang assumes that once an error occurs,
further analysis is unlikely to return valid results.  However, warnings that
have been upgraded to errors should not be treated as "errors" in this sense.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169649 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07 22:53:48 +00:00
Eli Bendersky 441d9f7a36 Adapt to LLVM commit 169291 which streamlines the usage of NaCl/NativeClient
in the triple.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169292 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04 18:38:10 +00:00
Chandler Carruth 55fc873017 Sort all of Clang's files under 'lib', and fix up the broken headers
uncovered.

This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.

I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04 09:13:33 +00:00
Bill Wendling 6e6330c07a Don't emit a warning with an input/output parameter. We assume the user knows what they're doing here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169059 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-30 23:46:56 +00:00
Bill Wendling e2dbaa9f78 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169054 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-30 23:18:12 +00:00
Quentin Colombet 74632aab3a Add ARM cortex-a5 subtarget
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168958 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-29 23:15:27 +00:00
Quentin Colombet 398b8e86ab Revert commit revision r168953, to change the commit message, which was empty
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168956 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-29 23:07:08 +00:00
Quentin Colombet b3233f5ed4 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168953 91177308-0d34-0410-b5e6-96231b3b80d8 2012-11-29 22:58:40 +00:00
Eli Friedman 6902e4146d Fix the definition of the vfork() builtin on Haiku. PR14378.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168674 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-27 02:58:24 +00:00
Eli Friedman f582499870 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168618 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-26 21:57:28 +00:00
Benjamin Kramer 7baa711e61 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168260 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-17 17:30:55 +00:00
Eli Friedman faf3538605 Add missing features for misc x86 CPUs to CPU feature translation. Patch by Jung-uk Kim.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168239 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-17 01:43:10 +00:00
Eli Friedman 612db2aa10 Clean up X86 target feature translation code slightly. No intended functional change. Patch by Jung-uk Kim.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168237 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-17 01:16:19 +00:00
Douglas Gregor 49a87549f4 Since CreateTargetInfo is taking ownership of the target options, pass
it as a pointer. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168136 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-16 04:24:59 +00:00
Richard Smith 62221b17c9 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).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168004 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-14 23:55:25 +00:00
Eric Christopher 825d386c1d Remove the cellspu port.
Approved by Chris Lattner.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167983 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-14 22:08:59 +00:00
Bill Wendling f634bdfbf4 The register constraint could mean a 16- or 8-bit register.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167735 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-12 18:52:32 +00:00
Bill Wendling 68fd608c2c 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>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167717 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-12 06:42:51 +00:00
Nico Weber 18f236886b Remove unneeded includes from IdentifierTable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167694 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-11 21:39:39 +00:00
Michael Liao 463eb89d5e 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167665 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-10 05:17:46 +00:00
Argyrios Kyrtzidis 9410928fb8 Add a SourceLocation::printToString() that returns in a std::string what dump()
writes to stderr; for debugging purposes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167629 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-09 19:40:48 +00:00
Benjamin Kramer ef7bceadf4 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!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167576 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-08 12:59:15 +00:00
Daniel Dunbar 6a1f49423b Basic: Windows doesn't define S_IFIFO.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167468 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-06 17:08:24 +00:00
Daniel Dunbar ce36ecd5a5 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167419 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-05 22:53:33 +00:00
Richard Smith ca1b62a33c Rename LangOptions members for address sanitizer and thread sanitizer from
*Sanitizer to Sanitize* in preparation for later patches.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167405 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-05 21:48:12 +00:00
Seth Cantrell 31ba273ef8 isLegalUTF8() was giving the wrong answer
invalid but not caught by isLegalUTF8(): 0xED 0x75 0x84

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167063 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 23:50:26 +00:00
Bill Schmidt dbaf4bc586 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166927 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 14:59:24 +00:00
Ulrich Weigand e6b3dbae38 Handle '*' and '#' asm constraint modifiers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166924 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 12:20:54 +00:00
Bill Wendling 50d46caf00 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>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166737 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-25 23:28:48 +00:00
David Tweed b16abb1bd8 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166679 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-25 13:33:01 +00:00
Bill Wendling c6cd9afd15 Revert r166647 to rethink the patch...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166655 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-25 00:32:44 +00:00
Bill Wendling a0b9ce0388 Add some support for diagnosing possibly mismatched constraint, type size and
modifiers. (From an idea by Eric...)
<rdar://problem/12284092>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166647 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-25 00:05:55 +00:00
Douglas Gregor 02c23ebf41 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166508 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23 22:26:28 +00:00
Daniel Dunbar 4d3ee9bc48 Fix pre-commit refacto failure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166431 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-22 18:56:43 +00:00
Daniel Dunbar 849289e531 driver/Darwin: Follow up to last patch, M-class CPUs are AAPCS but not EABI.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166430 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-22 18:51:13 +00:00
Argyrios Kyrtzidis 0872a06d1e 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166359 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-20 00:51:32 +00:00
Craig Topper d9cad403c0 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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166265 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-19 04:40:38 +00:00
Douglas Gregor 57016dda61 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).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166072 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16 23:40:58 +00:00
Derek Schuff 263366f924 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166065 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16 22:30:41 +00:00
Douglas Gregor 9a022bb007 Teach TargetInfo to hold on to the TargetOptions with which it was
created.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165943 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15 16:45:32 +00:00
Douglas Gregor 2b49d1f0ad 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165921 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15 06:28:11 +00:00
Eli Friedman 6505a29cfd Add TargetInfo for r600.
Patch by Tom Stellard.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165850 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12 23:32:00 +00:00
Ted Kremenek 186ec9c2e6 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165837 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12 22:56:33 +00:00
Derek Schuff 7da46f949f Properly factor Native Client defines to support NaCl as an OS
with x86/ARM architecture

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165722 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11 16:55:58 +00:00
Derek Schuff babaf31d40 Make X86_64ABIInfo clean for ABIs with 32 bit pointers, such as X32
and Native Client

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165715 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11 15:52:22 +00:00
Manman Ren 146e5a4a78 X86: add F16C support in Clang
Support the following intrinsics:
  _mm_cvtph_ps, _mm256_cvtph_ps, _mm_cvtps_ph, _mm256_cvtps_ph

rdar://12407875


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165685 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11 00:59:55 +00:00
Logan Chien eae5a820bc 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165609 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-10 06:56:20 +00:00
Aaron Ballman 82bfa19fe3 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165015 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 14:26:08 +00:00
Bob Wilson cfaab00963 Add ARM VFPv4 feature and enable it by default for Swift.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164906 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-29 23:52:52 +00:00
Bob Wilson 336bfa3fb4 Add armv7s and some other arm variants supported by Mach-O files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164905 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-29 23:52:50 +00:00
Argyrios Kyrtzidis e2ac16b09e In the Module class, add a reference to the corresponding AST file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164873 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-29 01:06:04 +00:00
Daniel Jasper 1c84c68b6d 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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164824 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-28 15:45:07 +00:00
Alexander Kornienko 4d7e0ced7f 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164610 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-25 17:18:14 +00:00
Jordan Rose 615a092a51 Use llvm::getOrdinalSuffix to print ordinal numbers in diagnostics.
Just a refactoring of common infrastructure. No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164443 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-22 01:24:42 +00:00
Alexander Potapenko 087c65fb27 Disable source fortification on Darwin with AddressSanitizer.
ASan doesn't play well with -D_FORTIFY_SOURCE, which is enabled by default starting at OS X 10.7


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164299 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-20 10:10:01 +00:00
Hal Finkel 7de3296402 Add e500mc and e5500 to the list of valid PPC CPU names.
Patch by Tobias von Koch!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164176 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-18 22:25:03 +00:00
Silviu Baranga 2df67ea86f This patch introduces A15 as a target in Clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163804 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13 15:06:00 +00:00
Anton Korobeynikov 8b0703d641 Do not construct StringRef from NULL argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163465 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-08 08:22:13 +00:00
Anton Korobeynikov 70a5cca8e7 Provide some ACLE C defines. This should fix PR13796
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163464 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-08 08:08:27 +00:00
Richard Smith e5f0588840 When a bad UTF-8 encoding or bogus escape sequence is encountered in a
string literal, produce a diagnostic pointing at the erroneous character
range, not at the start of the literal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163459 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-08 07:16:20 +00:00
Enrico Granata 2675b8ed40 Enabling the UTF conversion routines that were previously conditionally ifdef'ed out. This change is required to support enhancements in the LLDB data formatters
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163331 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-06 17:03:42 +00:00
Roman Divacky 31ba613537 Dont cast away const needlessly. Found by gcc48 -Wcast-qual.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163325 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-06 15:59:27 +00:00
Abramo Bagnara 5b86ffd219 Allow disabling of wchar_t type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163221 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-05 17:30:57 +00:00
Logan Chien 94a7142f74 Rename ANDROIDEABI to Android.
Most of the code guarded with ANDROIDEABI are not
ARM-specific, and having no relation with arm-eabi.
Thus, it will be more natural to call this
environment "Android" instead of "ANDROIDEABI".

Note: We are not using ANDROID because several projects
are using "-DANDROID" as the conditional compilation
flag.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163088 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-02 09:30:11 +00:00
Simon Atanasyan 600a513a0f Define __mips64 / __mips64__ macros for MIPS 64-bit targets.
The patch suggested by Brad Smith.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162858 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 20:50:11 +00:00
Simon Atanasyan 1d8ae1d706 Use getTargetDefines() virtual function in MipsTargetInfoBase successors
to define all macros for MIPS targets. Remove redundant virtual function
getArchDefines(). Two virtual functions for this task are really too much.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162853 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 19:59:32 +00:00
Simon Atanasyan d4935a0fbe Factor out MIPS macro definitions common for all MIPS targets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162852 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 19:14:58 +00:00
Simon Atanasyan 260e5067f3 Define _MIPS_ARCH and _MIPS_ARCH_<cpu name> macros for MIPS targets.
The patch suggested by Logan Chien.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162840 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 15:17:29 +00:00
Richard Smith 9e63dc582b Avoid binding a reference to a dereferenced null pointer, if we try to emit a
diagnostic before we have a source manager.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162070 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-17 00:55:32 +00:00