Commit Graph

22403 Commits

Author SHA1 Message Date
Alp Toker e492fae27d Make MS i128 suffix test from r211446 more robust
We want to catch both negative and positive failure conditions.

llvm-svn: 211449
2014-06-21 23:32:05 +00:00
David Majnemer 355597e99e The i128 suffix isn't always available.
This Lexer test unconditionally used the i128 integer literal suffix.
This suffix is only available to targets that have 128-bit arithmetic
support.

llvm-svn: 211446
2014-06-21 22:49:50 +00:00
David Majnemer 65a407c2ce Lex: Use the correct types for MS integer suffixes
Something went wrong with r211426, it is an older version of this code
and should not have been committed.  It was reverted with r211434.

Original commit message:
We didn't properly implement support for the sized integer suffixes.
Suffixes like i16 were essentially ignored instead of mapping them to
the appropriately sized integer type.

This fixes PR20008.

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

llvm-svn: 211441
2014-06-21 18:46:07 +00:00
Argyrios Kyrtzidis 4f1560242a [test] Add '-target' option to fix bot failure.
llvm-svn: 211439
2014-06-21 18:28:44 +00:00
Argyrios Kyrtzidis d886f1a370 [PCH] Remove the BackingIvarReferencedInAccessor field from DECL_OBJC_IVAR abbreviation record.
Patch by Yiding Jia!

llvm-svn: 211438
2014-06-21 18:16:40 +00:00
Rafael Espindola d46e4a2303 Revert "Lex: Use the correct types for MS integer suffixes"
This reverts commit r211426.

This broke the arm bots. The crash can be reproduced on X86 by running.
./bin/clang -cc1  -fsyntax-only -verify -fms-extensions ~/llvm/clang/test/Lexer/ms-extensions.c -triple arm-linux

llvm-svn: 211434
2014-06-21 12:39:25 +00:00
David Majnemer 252cbe25cb Lex: Use the correct types for MS integer suffixes
We didn't properly implement support for the sized integer suffixes.
Suffixes like i16 were essentially ignored instead of mapping them to
the appropriately sized integer type.

This fixes PR20008.

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

llvm-svn: 211426
2014-06-21 00:51:59 +00:00
Justin Bogner a88f0122e3 Driver: In crashdumps with -fmodule, dump the module dependencies
llvm-svn: 211421
2014-06-20 22:59:50 +00:00
Saleem Abdulrasool 9d45e77dca Driver: enhance MSC version compatibility
The version information for Visual Studio is spread over multiple variables.
The newer Windows SDK has started making use of some of the extended versioning
variables that were previously undefined.  Enhance our compatibility definitions
for these cases.

_MSC_VER is defined to be the Major * 100 + Minor.  _MSC_FULL_VER is defined to
be Major * 10000000 + Minor * 100000 + Build.  And _MSC_BUILD is the build
revision of the compiler.

Extend the -fmsc-version option in a compatible manner.  If the value is the
previous form of MMmm, then we assume that the build number is 0.  Otherwise, a
specific build number may be passed by using the form MMmmbbbbb.  Due to
bitwidth limitations of the option, it is currently not possible to define a
revision value.

The version information can be passed as either the decimal encoded value
(_MSC_FULL_VER or _MSC_VER) or as a dot-delimited value.

The change to the TextDiagnostic is to deal with the updated encoding of the
version information.

llvm-svn: 211420
2014-06-20 22:58:35 +00:00
Justin Bogner 332a5e526e Driver: Record that we're in crashdump and push flags to ConstructJob
It's more flexible and arguably better layering to set flags to modify
compiling for diagnostics in the CC1 job themselves, rather than
tweaking the driver flags and letting them propagate.

There is one visible change this causes: crash report files will now
get preprocessed names (.i and friends).

llvm-svn: 211411
2014-06-20 22:16:00 +00:00
David Majnemer 0dc1e80a32 CodeGen: Fix test to work with assertions as well
llvm-svn: 211410
2014-06-20 22:08:59 +00:00
David Majnemer 160000c64c CodeGen: typeid/dynamic_cast tests don't need asserts
These tests relied on information that was only available for clang
builds that included asserts.  Fix these tests to lift that restriction.

llvm-svn: 211408
2014-06-20 21:44:39 +00:00
David Majnemer f1c9cbc2a2 CodeGen: Refactor dynamic_cast and typeid
This refactors the emission of dynamic_cast and typeid expressions so
that ABI specific knowledge lives in appropriate places.  There are
quite a few benefits for having the two implementations share a common
core like sharing logic for optimization opportunities.

While we are at it, clean up the tests.

llvm-svn: 211402
2014-06-20 21:11:00 +00:00
Richard Smith cf519ff519 Fix typo in r211394.
llvm-svn: 211395
2014-06-20 19:58:05 +00:00
Richard Smith 085a64ffc5 [C++1z] Implement N3928: message in static_assert is optional.
llvm-svn: 211394
2014-06-20 19:57:12 +00:00
Richard Smith 4676203011 [C++1z] Implement N3981: Disable trigraphs by default in C++1z mode.
llvm-svn: 211392
2014-06-20 19:23:57 +00:00
Richard Smith f3076ff2fd Don't crash when emitting a glvalue conditional where one arm is a
throw-expression. Based on a patch by Marius Wachtler!

llvm-svn: 211388
2014-06-20 18:43:47 +00:00
Serge Pavlov eb57aa65dc Fix crash caused by unnamed union or struct when doing ast-print
llvm-svn: 211380
2014-06-20 17:08:28 +00:00
Ulrich Weigand bebc55b13b [PowerPC] Fix small argument stack slot offset for LE
When small arguments (structures < 8 bytes or "float") are passed in a
stack slot in the ppc64 SVR4 ABI, they must reside in the least
significant part of that slot.  On BE, this means that an offset needs
to be added to the stack address of the parameter, but on LE, the least
significant part of the slot has the same address as the slot itself.

For the most part, this is handled in the LLVM back-end, where I just
fixed the LE case in commit r211368.

However, there is one piece of the clang front-end that is also aware of
these stack-slot offsets: PPC64_SVR4_ABIInfo::EmitVAArg.  This patch
updates that routine to take endianness into account.

llvm-svn: 211370
2014-06-20 16:37:40 +00:00
NAKAMURA Takumi 5e3d1414a4 Disable Modules/dependency-dump-dependent-module.m on win32 for now.
FIXME: This fails on win32 due to ERROR_FILENAME_EXCED_RANGE if the working directory is too deep.

We should make Win32/Path.inc capable of long pathnames with '\\?\'.

llvm-svn: 211363
2014-06-20 15:04:25 +00:00
James Molloy 9eef2659bf The ability to use vector initializer lists is a GNU vector extension
and is unrelated to the NEON intrinsics in arm_neon.h. On little
endian machines it works fine, however on big endian machines it
exhibits surprising behaviour:

    uint32x2_t x = {42, 64};
    return vget_lane_u32(x, 0); // Will return 64.

Because of this, explicitly call out that it is unsupported on big
endian machines.

This patch will emit the following warning in big-endian mode:

    test.c:3:15: warning: vector initializers are a GNU extension and are not compatible with NEON intrinsics [-Wgnu]
    int32x4_t x = {0, 1, 2, 3};
                  ^
    test.c:3:15: note: consider using vld1q_s32() to initialize a vector from memory, or vcombine_s32(vcreate_s32(), vcreate_s32()) to initialize from integer constants
    1 warning generated.

llvm-svn: 211362
2014-06-20 14:35:13 +00:00
Ulrich Weigand 454ac7c6f3 Add file missed in r211360 commit
llvm-svn: 211361
2014-06-20 14:32:39 +00:00
Ulrich Weigand 68e902c360 [PowerPC] Fix ELF interpreter name for powerpc64le-linux
On PowerPC LE the system uses the /lib64/ld64.so.2 dynamic linker name
instead of /lib64/ld64.so.1 (to indicate the ELFv2 ABI version).

This fixes the clang driver to pass the appropriate -dynamic-linker
setting, and adds some more tests to linux-ld.c.

llvm-svn: 211360
2014-06-20 14:19:02 +00:00
Ulrich Weigand a8331b9925 [PowerPC] Add MultiarchIncludeDirs for powerpc64le
There was already partial support for multi-arch on powerpc64le,
but the MultiarchIncludeDirs setting was missing.  This patch
adds the appropriate definition, and also extends the
linux-header-search.cpp test case to verify an Ubuntu 14.04
powerpc64le tree.

llvm-svn: 211359
2014-06-20 13:41:24 +00:00
Eli Bendersky 36a6193bf4 Fix PR20081: Parsing templates in the presence of -x cuda -std=c++11
http://reviews.llvm.org/D4222

llvm-svn: 211357
2014-06-20 13:09:59 +00:00
Oliver Stannard e3a4fb6512 Add module flags metadata to record the settings for enum and wchar width
Add module flags metadata to record the settings for enum and wchar width,
to allow correct ARM build attribute generation

llvm-svn: 211354
2014-06-20 12:43:07 +00:00
Alexey Bataev 236070f20d [OPENMP] Initial support for 'nowait' clause.
llvm-svn: 211352
2014-06-20 11:19:47 +00:00
Alexey Bataev 142e1fc9ea [OPENMP] Initial support for 'ordered' clause.
llvm-svn: 211347
2014-06-20 09:44:06 +00:00
Daniel Jasper b3b0b8034c Fix/Improve SourceRange of explicitly defaulted members
When adding the implicit compound statement (required for Codegen?), the
end location was previously overridden by the start location, probably
based on the assumptions:

* The location of the compound statement should be the member's location
* The compound statement if present is the last element of a FunctionDecl

This patch changes the location of the compound statement to the
member's end location.

Code review: http://reviews.llvm.org/D4175

llvm-svn: 211344
2014-06-20 08:44:22 +00:00
Alexey Bataev 56dafe87c2 [OPENMP] Initial support for 'schedule' clause.
llvm-svn: 211342
2014-06-20 07:16:17 +00:00
Fariborz Jahanian d329674028 Objective-C qoi. When Objective-C pointer mismatches with
a qualified-id type because pointer is object of a forward
class declaration, include this info in a diagnostic note.
// rdar://10751015

llvm-svn: 211324
2014-06-19 23:05:46 +00:00
Justin Bogner 2960d47665 test: Just check the VFS when testing module-dependency-dump
Checking the filesystem seems to be a bit unreliable. Limit the tests
to the VFS map for now.

llvm-svn: 211310
2014-06-19 20:18:00 +00:00
Justin Bogner 86d1259ca7 Frontend: Add a CC1 flag to dump module dependencies to a directory
This adds the -module-dependency-dir to clang -cc1, which specifies a
directory to copy all of a module's dependencies into in a form
suitable to be used as a VFS using -ivfsoverlay with the generated
vfs.yaml.

This is useful for crashdumps that involve modules, so that the module
dependencies will be intact when a crash report script is used to
reproduce a problem on another machine.

We currently encode the absolute path to the dump directory, due to
limitations in the VFS system. Until we can handle relative paths in
the VFS, users of the VFS map may need to run a simple search and
replace in the file.

llvm-svn: 211303
2014-06-19 19:36:03 +00:00
Eli Bendersky f637790102 Fix PR20069: bad loop pragma arguments crash FE
This patch fixes a crash when handling malformed arguments to loop pragmas such
as: "#pragma clang loop vectorize(()".  Essentially any argument which is not an
identifier or constant resulted in a crash.  This patch also changes a couple of
the error messages which weren't quite correct.  New behavior with this patch vs
old behavior:

#pragma clang loop vectorize(1)
OLD: error: missing keyword; expected 'enable' or 'disable'
NEW: error: invalid argument; expected 'enable' or 'disable'

#pragma clang loop vectorize()
OLD: error: expected ')'
NEW: error: missing argument to loop pragma 'vectorize'

#pragma clang loop vectorize_width(bad)
OLD: error: missing value; expected a positive integer value
NEW: error: invalid argument; expected a positive integer value

#pragma clang loop vectorize(bad)
OLD: invalid keyword 'bad'; expected 'enable' or 'disable'
NEW: error: invalid argument; expected 'enable' or 'disable'

http://reviews.llvm.org/D4197

Patch by Mark Heffernan

llvm-svn: 211292
2014-06-19 18:30:15 +00:00
Oliver Stannard c8e3b5f849 Improve robustness of tests for module flags metadata
Fix clang tests to not break if the ID numbers of module flags metadata
nodes change.

llvm-svn: 211276
2014-06-19 16:10:21 +00:00
Argyrios Kyrtzidis 0f99537eca Fix assertion hit or bogus compiler error in cases when instantiating ObjC property accesses used with overloaded binary operators.
rdar://17153478

llvm-svn: 211270
2014-06-19 14:45:16 +00:00
Richard Smith 955bf016ee [c++1z] Implement N3994: a range-based for loop can declare a variable with super-terse notation
for (x : range) { ... }

which is equivalent to

  for (auto &&x : range) { ... }

llvm-svn: 211267
2014-06-19 11:42:00 +00:00
Alexey Bataev 7ff5524f7e [OPENMP] Improved diagnostic messages for vars with the predetermined data sharing attributes and reformatting
llvm-svn: 211262
2014-06-19 09:13:45 +00:00
Fariborz Jahanian c03ef578eb Objective-C ARC. Allow conversion of (void*) pointers to
retainable ObjC pointers without requiring a bridge-cast
in the context of pointer comparison as this is in effect 
a +0 context. // rdar://16627903

llvm-svn: 211243
2014-06-18 23:52:49 +00:00
David Majnemer 5b63fa02b2 Sema: Static redeclaration after extern declarations is a Microsoft Extension
CL permits static redeclarations to follow extern declarations.  The
storage specifier on the latter declaration has no effect.

This fixes PR20034.

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

llvm-svn: 211238
2014-06-18 23:26:25 +00:00
Fariborz Jahanian 1ad83a35b1 Objective-C. Revert my patch in r211234.
llvm-svn: 211237
2014-06-18 23:22:38 +00:00
Fariborz Jahanian 62aeb8b653 Objective-C ARC. Allow conversion of (void*) pointers to
retainable ObjC pointers without requiring a bridge-cast
by recognizing this as a +0 context. // rdar://16627903

llvm-svn: 211234
2014-06-18 22:50:40 +00:00
Saleem Abdulrasool 11415c6120 tests: relax ms-intrinsics test
Relax the tests to allow for differences between release and debug builds.  This
should fix the buildbots.

Thanks to Benjamin Kramer and Eric Christo for their invaluable tip that this
was release build specific issue.

llvm-svn: 211227
2014-06-18 21:48:44 +00:00
Reid Kleckner 7d0c066346 Relax the cl-inputs.c test a little bit in case link.exe is on PATH
llvm-svn: 211224
2014-06-18 21:34:36 +00:00
Warren Hunt 747e301ea0 [MS-ABI] Implement typeid
This patch enables clang to generate calls to __RTtypeid when lowering 
typeid on win32 targets.  Test cases are included.

llvm-svn: 211223
2014-06-18 21:15:55 +00:00
Saleem Abdulrasool 114efe0dc8 CodeGen: improve ms instrincics support
Add support for _InterlockedCompareExchangePointer, _InterlockExchangePointer,
_InterlockExchange.  These are available as a compiler intrinsic on ARM and x86.
These are used directly by the Windows SDK headers without use of the intrin
header.

llvm-svn: 211216
2014-06-18 20:51:10 +00:00
Fariborz Jahanian 5d64abba0a Objective-C. Check for integer overflow in Objective-C's
boxed expression. // rdar://16417427

llvm-svn: 211215
2014-06-18 20:49:02 +00:00
Jordan Rose 6914e2f339 [analyzer] Don't create new PostStmt nodes if we don't have to.
Doing this caused us to mistakenly think we'd seen a particular state before
when we actually hadn't, which resulted in false negatives. Credit to
Rafael Auler for discovering this issue!

llvm-svn: 211209
2014-06-18 19:23:30 +00:00
Fariborz Jahanian caaa5f55b6 Objective-C. Try to fix the test in buildbot in my last patch.
llvm-svn: 211197
2014-06-18 18:16:37 +00:00
Fariborz Jahanian 285b6b6585 Objective-C. Attributes on class declarations carry over
to forward class declarations for diagnosis. 
// rdar://16681279

llvm-svn: 211195
2014-06-18 17:58:27 +00:00