Commit Graph

64252 Commits

Author SHA1 Message Date
Reid Kleckner fb72718ebf [MS] Put member pointer representation flags in our debug info
llvm-svn: 273063
2016-06-17 22:27:59 +00:00
Vedant Kumar aecc0267e2 [Coverage] Adopt llvm::coverage::encodeFilenamesAndRawMappings (NFC)
Use an llvm helper function to encode filenames and raw mappings.

llvm-svn: 273056
2016-06-17 21:53:55 +00:00
Saleem Abdulrasool 62d42cd088 test: support / and \ as directory separators
Windows uses \ as the directory separator and this causes the tests to fail on
Windows.

llvm-svn: 273036
2016-06-17 19:59:01 +00:00
Jan Vesely 9674bd4f97 NVPTX: Add supported CL features
Fixes libclc compilation broken by r269670

Reviewers: jholewinsky

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

llvm-svn: 273031
2016-06-17 19:02:14 +00:00
David Majnemer 3370c20c7e [CodeGen] Use pointer-sized integers for ptrtoint sources
Given something like:
void *v = (void *)100;

We need to synthesize a ptrtoint operation from 100.  During constant
emission, we choose i64 as the type for our constant because it
guaranteed not to drop any bits from our CharUnits representation of the
value.  However, this is suboptimal for 32-bit targets: LLVM passes like
GlobalOpt will get confused by these sorts of casts resulting in
pessimization.

Instead, make sure the ptrtoint operand has a pointer-sized integer
type.

llvm-svn: 273020
2016-06-17 17:47:24 +00:00
Saleem Abdulrasool 003bd8c367 test: generalise the matching
Use a regex for the clang version as that will change all the time.

llvm-svn: 273018
2016-06-17 17:33:36 +00:00
Saleem Abdulrasool 88879e6559 Driver: introduce and use `-isystem-after` for cross-windows
This mirrors the many other -i*after options to insert a new system search
directory at the end of the search path.  This makes it possible to actually
inject a search path after the resource dir.  This option is similar in spirit
to the /imsvc option in the clang-cl driver.  This is needed to properly use the
driver for Windows targets where the clang headers wrap some of the system
headers.

This concept is actually useful on other targets (e.g. Linux) and would be
really easy to support on the core toolchain.

llvm-svn: 273016
2016-06-17 17:23:16 +00:00
Yaxun Liu b5044fe421 [OpenCL] Allow -std={cl|CL}{|1.1|1.2|2.0} in driver
Fix a regression which forbids using -std=cl|CL1.1|CL1.2|CL2.0 in driver.

Allow -std and -cl-std={cl|CL}{|1.1|1.2|2.0}.

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

llvm-svn: 273015
2016-06-17 17:19:28 +00:00
Bryan Chan d346ae6ee6 [Driver] Adapt Linux::GCCVersion::Parse to match GCC 5 installations
Summary:
Some GCC 5 installations store the libstdc++ includes and GCC-specific files in paths without 
the minor part of the version number, such as

  /usr/include/c++/5
  /usr/lib64/gcc/x86_64-suse-linux/5

Reviewers: cfe-commits, thiagomacieira, jroelofs

Subscribers: tinti, jroelofs

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

llvm-svn: 273012
2016-06-17 16:47:14 +00:00
Reid Kleckner 829398e5f0 [codeview] Stop emitting fully qualified subprogram display names
This effectively reverts r255744, and leaves the printing option tweaks.

We can add the name qualifiers easily in the backend.

llvm-svn: 273008
2016-06-17 16:11:20 +00:00
Simon Pilgrim d39d026324 [X86][SSE4A] Use native IR for mask movntsd/movntss intrinsics.
Depends on llvm side commit r273002.

llvm-svn: 273003
2016-06-17 14:28:16 +00:00
Jan Vesely 211ba785d9 AMDGPU: Fix supported CL features
Reviewers: arsenm

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

llvm-svn: 272986
2016-06-17 02:25:03 +00:00
NAKAMURA Takumi c690ee046e ToolingTests/runToolOnCode.TestSkipFunctionBody: Appease msc targets.
llvm-svn: 272985
2016-06-17 02:04:51 +00:00
Ranjeet Singh ca2b3e7b5c [ARM] Add mrrc/mrrc2 intrinsics and update existing mcrr/mcrr2 intrinsics.
Reapplying patch in r272777 which was reverted
because the llvm patch which added support
for generating the mcrr/mcrr2 instructions
from the intrinsic was causing an assertion
failure. This has now been fixed in llvm.

llvm-svn: 272983
2016-06-17 00:59:41 +00:00
Saleem Abdulrasool 5065d8cfc9 Headers: wordsmith error message
Use the marketing name for the MSVC release as pointed out by Nico Weber!

llvm-svn: 272979
2016-06-17 00:27:02 +00:00
George Burgess IV 419996ccb5 [CodeGen] Fix a segfault caused by pass_object_size.
This patch fixes a bug where we'd segfault (in some cases) if we saw a
variadic function with one or more pass_object_size arguments.

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

llvm-svn: 272971
2016-06-16 23:06:04 +00:00
Olivier Goffart f9e890cbf9 Fix a few issues while skipping function bodies
- In functions with try { } catch { }, only the try block would be
   skipped, not the catch blocks

 - The template functions would still be parsed.

 - The initializers within a constructor would still be parsed.

 - The inline functions within class would still be stored, only to be
   discared later.

 - Invalid code with try would assert (as in "int foo() try assert_here")

This attempt to do even less while skipping function bodies.

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

llvm-svn: 272963
2016-06-16 21:40:06 +00:00
Olivier Goffart 119dad63bc Keep invalid functions as part of the AST
Differential Revision: http://reviews.llvm.org/D19764

llvm-svn: 272962
2016-06-16 21:39:55 +00:00
Olivier Goffart 12b2219841 Functions declared in a scope should not hide previous declaration in earlier scopes
This code should be an error:

 void foo(int);
 void f3() {
   int foo(float);
   {
     float foo(int); // expected-error {{functions that differ only in their return type cannot be overloaded}}
   }
 }

the foo(float) function declared at function scope should not hide the float(int)
while trying to redeclare functions.

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

llvm-svn: 272961
2016-06-16 21:39:46 +00:00
Artem Belevich ce4ce7368f Minor fixes for miamcpu-opt.c test
Added -no-canonical-prefixes to make cc1 binary name more predictable.
Added appropriate REQUIRES keywords.

llvm-svn: 272947
2016-06-16 20:16:49 +00:00
Reid Kleckner 216d0a1674 [DebugInfo] Put the vftable index in the debug info
This won't always be enough info to call a virtual method from the
debugger, but it's a start.

llvm-svn: 272944
2016-06-16 20:08:51 +00:00
Sanjay Patel dbd68dd09d [x86] generate IR for AVX2 integer min/max builtins
Sibling patch to r272932:
http://reviews.llvm.org/rL272932

llvm-svn: 272933
2016-06-16 18:45:01 +00:00
Samuel Antao 6d0042642a Re-apply r272900 - [OpenMP] Cast captures by copy when passed to fork call so that they are compatible to what the runtime library expects.
An issue in one of the regression tests was fixed for 32-bit hosts.

llvm-svn: 272931
2016-06-16 18:39:34 +00:00
Samuel Antao b1f9501242 Revert r272900 - [OpenMP] Cast captures by copy when passed to fork call so that they are compatible to what the runtime library expects.
Was causing trouble in one of the regression tests for a 32-bit address space.

llvm-svn: 272908
2016-06-16 16:06:22 +00:00
Samuel Antao 4951617980 [OpenMP] Cast captures by copy when passed to fork call so that they are compatible to what the runtime library expects.
Summary:
This patch fixes an issue detected when firstprivate variables are passed to an OpenMP outlined function vararg list. Currently they are not compatible with what the runtime library expects causing malfunction in some targets.

This patch fixes the issue by moving the casting logic already in place for offloading to the common code that creates the outline function and arguments and updates the regression tests accordingly.

Reviewers: hfinkel, arpith-jacob, carlo.bertolli, kkwli0, ABataev

Subscribers: cfe-commits, caomhin

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

llvm-svn: 272900
2016-06-16 15:09:31 +00:00
Marcin Koscielnicki a46fade624 [Builtin] Make __builtin_thread_pointer target-independent.
This is now supported for ARM, AArch64, PowerPC, SystemZ, SPARC, Mips.

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

llvm-svn: 272893
2016-06-16 13:41:54 +00:00
Haojian Wu 00cfe279c1 A follow-up fixing on cuda-march.cu: Don't match clang to other place.
llvm-svn: 272890
2016-06-16 13:27:02 +00:00
Andrey Turetskiy 83491bb7a5 Patch "Compilation for Intel MCU (Part 2/3)" caused the clang-x64-ninja-win7
buildbot to fail because of inaccurate CHECK in the test. This is a quick fix
for the test to make it platform independent.

llvm-svn: 272887
2016-06-16 12:26:20 +00:00
Andrey Turetskiy c410548071 Compilation for Intel MCU (Part 3/3)
This is the last patch required to support compilation for Intel MCU target (e.g. Intel(R) Quark(TM) micro controller D 2000).

When IAMCU triple is used:
 * Use IAMCU linker output format
 * Link with IAMCU crt objects
 * Link with IAMCU libraries

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

llvm-svn: 272885
2016-06-16 10:49:27 +00:00
Andrey Turetskiy 4798eb6d59 Compilation for Intel MCU (Part 2/3)
This is the second patch required to support compilation for Intel MCU target (e.g. Intel(R) Quark(TM) micro controller D 2000).
When IAMCU triple is used:
 * Recognize and use IAMCU GCC toolchain
 * Set up include paths
 * Forbid C++

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

llvm-svn: 272883
2016-06-16 10:36:09 +00:00
NAKAMURA Takumi 6e72651e59 clang/test/Driver/cuda-march.cu: Tweak not to match "clang" to other place like "path-to-clang-foo".
llvm-svn: 272874
2016-06-16 06:08:09 +00:00
George Burgess IV 5d3bd93101 [Lex] Try to fix a 'comparison is always false' warning. NFC.
llvm-svn: 272867
2016-06-16 02:30:33 +00:00
Reid Kleckner 45fe376dbd [DebugInfo] Enable generation of unique identifiers for externally visible MS ABI types
We implemented the mangling for this a long time ago.

llvm-svn: 272862
2016-06-16 01:21:28 +00:00
Paul Robinson afd2dde2fd Allow 'nodebug' on local variables.
Parameters and non-static members of aggregates are still excluded,
and probably should remain that way.

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

llvm-svn: 272859
2016-06-16 00:42:36 +00:00
Justin Lebar 4db224e199 [CUDA] Don't pass top-level -march down to device cc1 or ptxas.
Summary:
Previously if you did e.g.

  $ clang -march=haswell -x cuda foo.cu

we would pass "-march=haswell -march=sm_20" down to the ptxas tool.
This causes it to assert, and rightly so!

Reviewers: tra

Subscribers: cfe-commits, echristo

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

llvm-svn: 272857
2016-06-15 23:46:11 +00:00
Evgeniy Stepanov 322f21908d Fix sanitizer-ld test.
llvm-svn: 272856
2016-06-15 23:29:26 +00:00
Evgeniy Stepanov aac94b1e2e Fix linking of DFSan + coverage.
Broken in r272717 because of no test coverage.

llvm-svn: 272853
2016-06-15 23:05:21 +00:00
Sanjay Patel 280cfd1a69 [x86] translate SSE packed FP comparison builtins to IR
As noted in the code comment, a potential follow-on would be to remove
the builtins themselves. Other than ord/unord, this already works as 
expected. Eg:

  typedef float v4sf __attribute__((__vector_size__(16)));
  v4sf fcmpgt(v4sf a, v4sf b) { return a > b; }

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

llvm-svn: 272840
2016-06-15 21:20:04 +00:00
Etienne Bergeron e28e7f234d Add support to clang-cl driver for /GS switch
Summary:
This patch is adding command-line support for the MSVC buffer security check.

The buffer security check is turned on with the '/GS' compiler switch.
https://msdn.microsoft.com/en-us/library/8dbf701c.aspx

The MSVC buffer security check in implemented here:
http://reviews.llvm.org/D20346

Reviewers: hans, rnk

Subscribers: chrisha, cfe-commits, rnk, hans, thakis

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

llvm-svn: 272832
2016-06-15 20:34:33 +00:00
Rafael Espindola b31478bf40 Add a few Musl related tests that already pass.
Patch by Lei Zhang.

llvm-svn: 272825
2016-06-15 20:02:22 +00:00
Matthias Braun 7005a9272b cc1_main: Do not print statistics twice in -disable_free mode.
llvm statistics are currently printed when the destructor of a "static
ManagedStatic<StatisticInfo> StatInfo" in llvm runs.  This destructor
currently runs in each case as part of llvm_shutdown() which is run even
in disable_free mode as part of main(). I assume that this hasn't always
been the case.

Removing the special code here avoids the statistics getting printed
twice.

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

llvm-svn: 272820
2016-06-15 19:24:55 +00:00
Sanjay Patel 7495ec026e [x86] generate IR for SSE integer min/max builtins
Sibling patch to r272806:
http://reviews.llvm.org/rL272806

llvm-svn: 272807
2016-06-15 17:18:50 +00:00
Chris Dewhurst fe9e509b0c [Sparc] setjmp and longjmp intrinsic support update to add unit tests and remove accidentally checked-in code.
Related to revision r272782

llvm-svn: 272798
2016-06-15 16:08:13 +00:00
Ranjeet Singh d48760da64 Reverting r272777 because one of the tests
added in the llvm patch is causing an assertion
to fail.

llvm-svn: 272790
2016-06-15 14:21:28 +00:00
Benjamin Kramer 7320b99b2c Apply some suggestions from clang-tidy's performance-unnecessary-value-param.
No functionality change intended.

llvm-svn: 272789
2016-06-15 14:20:56 +00:00
John Brawn 771721cb35 Don't use static variables in LambdaCapture
When static variables are used in inline functions in header files anything that
uses that function ends up with a reference to the variable. Because
RecursiveASTVisitor uses the inline functions in LambdaCapture that use static
variables any AST plugin that uses RecursiveASTVisitor, such as the
PrintFunctionNames example, ends up with a reference to these variables. This is
bad on Windows when building with MSVC with LLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON
as variables used across a DLL boundary need to be explicitly dllimported in
the DLL using them.

This patch avoids that by adjusting LambdaCapture to be similar to before
r263921, with a capture of either 'this' or a VLA represented by a null Decl
pointer in DeclAndBits with an extra flag added to the bits to distinguish
between the two. This requires the use of an extra bit, and while Decl does
happen to be sufficiently aligned to allow this it's done in a way that means
PointerIntPair doesn't realise it and gives an assertion failure. Therefore I
also adjust Decl slightly to use LLVM_ALIGNAS to allow this.

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

llvm-svn: 272788
2016-06-15 14:14:51 +00:00
Craig Topper a54c21e742 [AVX512] Use native IR for mask pcmpeq/pcmpgt intrinsics.
llvm-svn: 272787
2016-06-15 14:06:34 +00:00
Chris Dewhurst 0381cd7dbf [Sparc] Change to let clang know that setjmp and longjmp intrinsics are implemented in the back-end.
Differential Revision: http://reviews.llvm.org/D19798

llvm-svn: 272782
2016-06-15 12:44:47 +00:00
Ranjeet Singh 8d5ad5bdf2 [ARM] Add mrrc/mrrc2 intrinsics and update existing mcrr/mcrr2 intrinsics.
Patch adds intrinsics for mrrc/mrrc2. The
intrinsics for mrrc/mrrc2 return a single
uint64_t to represent two 32 bit values.

The mcrr/mcrr2 intrinsic was changed to
accept a single uint64_t instead of two
32 bit values as the input for consistency.

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

llvm-svn: 272777
2016-06-15 11:32:18 +00:00
Alexey Bataev 61deb4dadc Revert accidential "[MSVC] Late parsing of in-class defined member functions in template"
This reverts commit 0253605771b8bd9d414aba74fe2742c730d6fd1a.

llvm-svn: 272776
2016-06-15 11:24:54 +00:00