Commit Graph

683 Commits

Author SHA1 Message Date
Ehsan Akhgari 9be07e1acd Do not define __STRICT_ANSI__ in clang-cl
llvm-svn: 212066
2014-06-30 20:36:33 +00:00
Jim Grosbach be83cb8c96 ARM: Correctly identify cortex-m4 as v7em.
Get the predefined macro for the architecture correct.
cortex-m4: __ARM_ARCH_7EM__
cortex-m3: __ARM_ARCH_7M__
cortex-m0: __ARM_ARCH_6M__

rdar://17420090

llvm-svn: 211792
2014-06-26 17:24:16 +00:00
Will Schmidt f048751912 Add ppc64/power8 as a target
llvm-svn: 211778
2014-06-26 13:34:10 +00:00
JF Bastien ab8d0a0dd5 Implement predefined stdint macros
Add predefined stdint macros that match the given patterns:

U?INT{_,_FAST,_LEAST}{8,16,32,64}_{MAX,TYPE}
U?INT{PTR,MAX}_{MAX,TYPE}

http://reviews.llvm.org/D4141

Author: binji
llvm-svn: 211657
2014-06-25 01:31:33 +00:00
Richard Smith dbd4d4c837 Add -std=c++1z flag for C++17 features.
llvm-svn: 211030
2014-06-16 15:16:56 +00:00
Saleem Abdulrasool 52a5d41b67 test: add missed file in previous commit
llvm-svn: 210992
2014-06-15 18:48:41 +00:00
Saleem Abdulrasool 0e3258cea8 Preprocessor: improve ACLE 6.4.1, 6.4.2 support
This improves conformance with ACLE 6.4.1.  Define additional macros that
indicate support for the ARM and Thumb instruction set architecture.  This
includes the following set of macros:

  __ARM_ARCH
  __ARM_ARCH_ISA_ARM
  __ARM_ARCH_ISA_THUMB
  __ARM_32BIT_STATE

These help identify the environment that the code is intended to execute on.

Adjust the handling for ACLE 6.4.2 to be more correct.  We would define the
profile as a free-standing token rather than a quoted single character.

llvm-svn: 210991
2014-06-15 18:35:07 +00:00
Kevin Qin afd8847189 [AArch64] Add default features for CPUs on AArch64 target.
For ARM target, we can use CRYPTO and CRC features if we select
cortex-a57 by '-mcpu', but for AArch64 target, it doesn't work
unless adding with '-mfpu=crypto-neon-fp-armv8'. To keep consistency
between front-end and back-end and get end-users more easier to use,
we'd better add default feature for CPUs on AArch64 target as well.

llvm-svn: 210625
2014-06-11 01:42:16 +00:00
Matheus Almeida b84b37d606 [mips] Add macros _MIPS_ISA and __mips_isa_rev (same expansion as defined by GCC).
Summary: The Linux Kernel is one example of a piece of software that relies on them.

Reviewers: atanasyan

Reviewed By: atanasyan

Differential Revision: http://reviews.llvm.org/D3756

llvm-svn: 210270
2014-06-05 14:59:18 +00:00
Alp Toker e03e9e15f2 Preprocessor: make C++ operator names as macro identifiers a compatible extension
With recent changes, this is now a compatible language extension and can be
safely enabled with -ms-extensions instead of requiring the full
-ms-compatibility MSVC drop-in mode. As such we can now also emit an extension
warning under -Wmicrosoft to help users port their code.

llvm-svn: 209978
2014-05-31 16:32:22 +00:00
Alp Toker c5d194fcd3 Preprocessor: recover gracefully when C++ operator names are used as macro identifiers
This failure mode shows up occasionally when users try to include C headers in
C++ projects or when porting from Windows. We might as well recover in the way
the user expected, thus avoiding confusing diagnostic messages at point of use.

llvm-svn: 209963
2014-05-31 03:38:17 +00:00
Alp Toker 6521ecc083 Provide an aka for the C++ operator name macro diagnostic
llvm-svn: 209322
2014-05-21 21:23:39 +00:00
Alp Toker b05e0b53b9 Preprocessor: support defined() with operator names for MS compatibility
Also flesh out missing tests, improve diagnostic QOI and fix a couple of corner
cases found in the process.

Fixes PR10606.

llvm-svn: 209276
2014-05-21 06:13:51 +00:00
Joerg Sonnenberger cc1edb5a45 Add __ARM_DWARF_EH__ to signify the use of Itanium ABI for unwind
instructions.

llvm-svn: 208719
2014-05-13 18:58:36 +00:00
Joerg Sonnenberger 4645b44fc6 Test preprocessor defines for NetBSD/ARM.
llvm-svn: 208718
2014-05-13 18:58:00 +00:00
Saleem Abdulrasool 6323a2d63c Target: fix wchar_t definition for Windows on ARM
Windows on ARM uses AAPCS, but has some deviations.  wchar_t remains an unsigned
short on WoA, which does not conform to AAPCS.  Ensure that wchar_t is defined
accordingly.

llvm-svn: 207929
2014-05-04 01:56:04 +00:00
Benjamin Kramer 56c582279b Add support for -march=bdver4.
llvm-svn: 207848
2014-05-02 15:47:51 +00:00
Bradley Smith 9a6b29540e [ARM64/AArch64] Define the correct value for __ARM_NEON_FP
llvm-svn: 207842
2014-05-02 15:18:38 +00:00
Bradley Smith 418c5935f8 [ARM64/AArch64] Hook up CRC32 subtarget feature to the driver
llvm-svn: 207841
2014-05-02 15:17:51 +00:00
Lubos Lunak 576a0415cb do not warn about unknown pragmas in modes that do not handle them (pr9537)
And refactor to have just one place in code that sets up the empty
pragma handlers.

llvm-svn: 207758
2014-05-01 12:54:03 +00:00
Alp Toker f424a597df Fix and restore the macro-multiline.c test
This test didn't work as intended and was ultimately disabled some years ago in
r169458.

Indeed it's not clear if the '\n' was ever passed through to the driver
correctly given that lit would insert '&& {' at the newline.

Test rewritten to use printf/xargs to insert '\n' in a more reliable manner and
to use FileCheck for verification.

llvm-svn: 206703
2014-04-19 21:40:58 +00:00
James Molloy 96061a6db1 [ARM64] Add ARM64 RUN lines to a bunch of tests that had AARCH64 RUN lines.
This covers all tests in tests/Driver and tests/Preprocessor, but there are some
failing tests in test/Sema that need looking into.

llvm-svn: 206464
2014-04-17 12:51:36 +00:00
Reid Kleckner 6f6e76dfe0 Revert "Move -fms-extensions predefined macros into InitPreprocessor"
This reverts commit r206413.

This was proposed before, but it's not clear if this is really a good
idea:
http://reviews.llvm.org/D3034

llvm-svn: 206415
2014-04-16 20:10:16 +00:00
Reid Kleckner ae4759df00 Move -fms-extensions predefined macros into InitPreprocessor
If someone on Linux asks for -fms-extensions, there's no reason not to
define the feature test macros that MSVC defines.

llvm-svn: 206413
2014-04-16 19:47:06 +00:00
James Molloy 75f5f9e629 [ARM64] Allow the disabling of NEON and crypto instructions. Update tests to pass -target-feature +neon.
llvm-svn: 206394
2014-04-16 15:33:48 +00:00
James Molloy 5e73df5cf0 [ARM64] Fix up predefines, including adding big endian support to Targets.cpp
llvm-svn: 206390
2014-04-16 15:06:20 +00:00
Saleem Abdulrasool f4c9e49f94 Driver: add target definition for Windows on ARM
This introduces the definitions needed for the Windows on ARM target.  Add
target definitions for both the MSVC environment and the MSVC + Itanium C++ ABI
environment.  The Visual Studio definitions correspond to the definitions
provided by Visual Studio 2012.

llvm-svn: 205650
2014-04-04 20:31:19 +00:00
Reid Kleckner 98a1266218 Put macro redefinition warnings under -Wmacro-redefined
This is consistent with -Wbuiltin-macro-redefined, and puts this common
extension warning under a flag.

Reviewers: rsmith

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

llvm-svn: 205591
2014-04-04 00:17:16 +00:00
NAKAMURA Takumi c1e8aa06aa clang/test/Preprocessor/headermap-rel2.c: Recognize dos path.
llvm-svn: 205152
2014-03-30 15:09:08 +00:00
Chandler Carruth 705cd965e3 Force a header file input to the headermap test to have different
contents than the header file by the same name under the system header
search root. Surprisingly, this is required to get the test to pass on
some systems.

So, it turns out that there exist filesystems in the world which unique
the inode of all files based on their contents. This results in two
files with the same contents at different paths suddenly having the same
inode. This doesn't actually cause any problems in practice as the
contents are the same, and the path used to access the files are the
same. However, it can cause tests like this one to be more brittle
because the file manager ends up de-duplicating the file entries by
inode. We don't have any other really easy ways to observe the behavior
shift because the whole point is that the #include written in the source
code doesn't contain the information -- instead it is contained in the
header map.

If folks have other solutions they would prefer, I'm more than happy to
work on them, but this seems a reasonable way to ensure that the test in
question exercises the code it wants to exercise.

llvm-svn: 205149
2014-03-30 14:04:32 +00:00
Argyrios Kyrtzidis 48fb488706 [test] Add a triple to the test.
llvm-svn: 205073
2014-03-29 04:05:21 +00:00
Argyrios Kyrtzidis ca1aa4626d [test] Add a RUN line to get a hint on why the test is failing at the buildbots.
llvm-svn: 205072
2014-03-29 03:37:04 +00:00
Argyrios Kyrtzidis 7bd78a910a [HeaderSearch] Make sure we clear the mapped name from the LookupFileCacheInfo when we reset the start point.
rdar://16462455

llvm-svn: 205071
2014-03-29 03:22:54 +00:00
Christian Pirker f01cd6f57b Add ARM big endian Target (armeb, thumbeb)
Reviewed at http://llvm-reviews.chandlerc.com/D3096

llvm-svn: 205008
2014-03-28 14:40:46 +00:00
Joerg Sonnenberger 1f5984ca82 From Matt Thomas: use long long for [u]int64_t and [u]intmax_t on
NetBSD/aarch64 to simplify code sharing with NetBSD/arm.

llvm-svn: 204798
2014-03-26 11:48:29 +00:00
Will Schmidt 5fa50f3c57 Update the powerpc64le check to include CALL_ELF=2 check.
This is a testcase follow-up to r204627.
(see also r204614 for CALL_ELF usage).

llvm-svn: 204669
2014-03-24 21:09:16 +00:00
Christian Pirker 227f5ed547 AArch64_BE test case for predefined macros
llvm-svn: 204604
2014-03-24 13:57:21 +00:00
Argyrios Kyrtzidis 34fad42003 [HeaderSearch] Fix issue where if a headermap entry maps the filename to a framework import (non-absolute path)
then we fail to find it if it is re-included later on.

rdar://16285490

llvm-svn: 203542
2014-03-11 06:21:28 +00:00
Robert Lytton 2c942c64fb Make __LITTLE_ENDIAN__/__BIG_ENDOAN__ common PredefinedMacros
llvm-svn: 203455
2014-03-10 12:06:29 +00:00
David Majnemer dbd6acb64b Revert "Preprocessor: Add __ALIGNOF_MAX_ALIGN_T__"
This commit reverts r201037, it's functionality is not needed given the
definition of std::max_align_t in libcxx circa r201843.

llvm-svn: 202667
2014-03-02 23:01:10 +00:00
NAKAMURA Takumi 210fbcdd5a clang/test/Preprocessor/init.c: Split conditions to win32 and non-win32.
FIXME: Implement and check x86_64-cygwin.
llvm-svn: 202094
2014-02-25 00:30:14 +00:00
Richard Smith 5b2f7c5f60 If preprocessing results in a token with leading whitespace that was expanded
from a macro in column 0, ensure that we print whitespace before it in the -E
output. Patch by Harald van Dijk!

llvm-svn: 202070
2014-02-24 20:50:36 +00:00
Richard Smith f2baa70396 If the first token in a macro that appears at the start of a line expands to
nothing, be sure to inform the *next* token expanded from the macro that it is
now at the start of a line. Patch by Harald van Dijk!

llvm-svn: 202068
2014-02-24 20:45:00 +00:00
Richard Barton c9b5f35ec1 Implement -fno-short-wchar
llvm-svn: 202058
2014-02-24 18:43:28 +00:00
Kevin Qin ad64f6d4e5 [AArch64] Change int64_t from 'long long int' to 'long int' for AArch64 target.
Most 64-bit targets define int64_t as long int, and AArch64 should
make same definition to follow LP64 model. In GNU tool chain, int64_t
is defined as long int for 64-bit target. So to get consistent with GNU,
it's better Changing int64_t from 'long long int' to 'long int',
otherwise clang will get different name mangling suffix compared with g++.

llvm-svn: 202004
2014-02-24 02:45:03 +00:00
Richard Smith 51bacfd9c7 Update __cplusplus to match the value in the C++14 DIS preview (D3937).
llvm-svn: 202003
2014-02-24 01:35:45 +00:00
Reid Kleckner 0e73ec4550 Expand macros in pragmas with -fms-extensions and -E
gcc never expands macros in pragmas and MSVC always expands macros
before processing pragmas.  Clang usually allows macro expansion, except
in a handful of pragmas, most of which are handled by the lexer.

Also remove PPCallbacks for pragmas that are currently handled in the
parser.  Without a Parser, such as with clang -E, these callbacks would
never be called.

Fixes PR18576.

llvm-svn: 201821
2014-02-20 22:59:51 +00:00
Reid Kleckner 064eaba99c Add missing test file for r201615
llvm-svn: 201617
2014-02-18 23:57:59 +00:00
Reid Kleckner a97d4c0679 Fix false positives in -Wmsvc-include by continuing header search
This makes Clang and LLVM -Wmsvc-include clean.

I believe the correct behavior here is to avoid updating the cache when
we find the header via MSVC's search rules.

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

llvm-svn: 201615
2014-02-18 23:49:24 +00:00
Nico Rieck e6a1582595 Fix broken CHECK lines
llvm-svn: 201477
2014-02-16 07:29:41 +00:00