Commit Graph

36762 Commits

Author SHA1 Message Date
Chad Rosier 0a84f17882 [PR19983] SBPO_Always not covering all the cases.
Patch by "Roman Kashitsyn" <romankashicin@gmail.com>.
Phabricator revision: http://reviews.llvm.org/D4788

llvm-svn: 214904
2014-08-05 17:58:54 +00:00
Adam Nemet 5bf7baa938 [AVX512] Add intrinsic for valignd/q
Note that similar to palingr, we could further optimize these to emit
shufflevector when the shift count is <=64.  This however does not
change the overall design that unlike palignr we would still need the LLVM
intrinsic corresponding to this intruction to handle the >64 cases.  (palignr
uses the psrldq intrinsic in this case.)

llvm-svn: 214891
2014-08-05 17:28:23 +00:00
NAKAMURA Takumi 51d35107ff [CMake] clangCodeGen: Update libdeps to add clangLex for PPChainedCallbacks.
llvm-svn: 214869
2014-08-05 15:01:12 +00:00
Daniel Jasper ca4ea1ce59 clang-format: Add option to always break after a function's return type.
This is required for GNU coding style, among others.

Also update the configuration documentation.

Modified from an original patch by Jarkko Hietaniemi, thank you!

llvm-svn: 214858
2014-08-05 12:16:31 +00:00
Daniel Jasper d9670878d4 clang-format: Break before 'else' in Stroustrup style.
Seems to be the desired thing to do according to:
  http://www.stroustrup.com/Programming/PPP-style-rev3.pdf

Patch by Jarkko Hietaniemi, thank you!

llvm-svn: 214857
2014-08-05 12:06:20 +00:00
Tim Northover 00853e5b6a MachO: set sizeof result type to what embedded headers expect.
Embedded systems seem to have inherited Darwin's choise of "unsigned long" for
size_t (via a bunch of headers), so we should respect that.

rdar://problem/17872787

llvm-svn: 214854
2014-08-05 11:07:26 +00:00
David Majnemer bbe649c250 MS ABI: Make the alias template mangling more correct
llvm-svn: 214847
2014-08-05 06:42:40 +00:00
David Majnemer c017d3613e MS ABI: Aligned tentative definitions don't have CommonLinkage
int __declspec(align(16)) foo; is a tentative definition but the storage
for that variable should not have CommonLinkage.

llvm-svn: 214828
2014-08-05 00:01:13 +00:00
Bill Schmidt ccbe0a8022 [PPC64LE] Fix wrong IR for vec_sld and vec_vsldoi
My original LE implementation of the vsldoi instruction, with its
altivec.h interfaces vec_sld and vec_vsldoi, produces incorrect
shufflevector operations in the LLVM IR.  Correct code is generated
because the back end handles the incorrect shufflevector in a
consistent manner.

This patch and a companion patch for LLVM correct this problem by
removing the fixup from altivec.h and the corresponding fixup from the
PowerPC back end.  Several test cases are also modified to reflect the
now-correct LLVM IR.

The vec_sums and vec_vsumsws interfaces in altivec.h are also fixed,
because they used vec_perm calls intended to be recognized as vsldoi
instructions.  These vec_perm calls are now replaced with code that
more clearly shows the intent of the transformation.

llvm-svn: 214801
2014-08-04 23:21:26 +00:00
NAKAMURA Takumi 13a4f76d51 ThreadSafety.cpp: Prune bogus \param(s). [-Wdocumentation]
llvm-svn: 214796
2014-08-04 22:48:46 +00:00
NAKAMURA Takumi e9882cf315 ThreadSafetyAnalysis: Fix annotations in class members. [-Wdocumentation]
llvm-svn: 214795
2014-08-04 22:48:36 +00:00
Reid Kleckner fe5b4ed822 Remove separator parameter from static local naming code
It was always set to ".", which was duplicated in a few places.

llvm-svn: 214792
2014-08-04 22:35:30 +00:00
DeLesley Hutchins 3efd0495a0 Thread Safety Analysis: add a -Wthread-safety-negative flag that warns whenever
a mutex is acquired, but corresponding mutex is not provably not-held.  This
is based on the earlier negative requirements patch.

llvm-svn: 214789
2014-08-04 22:13:06 +00:00
Eric Christopher 3de0853b47 Update for LLVM API change.
llvm-svn: 214786
2014-08-04 21:33:42 +00:00
Hans Wennborg 7c4851e3ad Don't drop dllimport from qualified friend redeclarations (PR20512)
This matches MSVC's logic, which seems to be that when the friend
declaration is qualified, it cannot be a declaration of a new symbol
and so the dll linkage doesn't change.

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

llvm-svn: 214774
2014-08-04 20:54:39 +00:00
Aaron Ballman e7c544d388 A static_assert declaration cannot be a template; adding the diagnostic for this instead of silently accepting and producing possibly-unexpected behavior.
llvm-svn: 214770
2014-08-04 20:28:35 +00:00
Alex Lorenz b4cb487c10 Revert r214757 (Same fix as r214758)
llvm-svn: 214759
2014-08-04 19:04:38 +00:00
David Blaikie 8fd9732905 Add CoverageMappingGen.cpp (introduced in r214752) to CMakeLists.txt
llvm-svn: 214758
2014-08-04 18:59:39 +00:00
Alex Lorenz 4521e19c15 add lib/CodeGen/CoverageMappingGen.cpp to CMake
llvm-svn: 214757
2014-08-04 18:55:53 +00:00
Alex Lorenz ee02499a8f Add coverage mapping generation.
This patch adds the '-fcoverage-mapping' option which
allows clang to generate the coverage mapping information
that can be used to provide code coverage analysis using
the execution counts obtained from the instrumentation 
based profiling (-fprofile-instr-generate).

llvm-svn: 214752
2014-08-04 18:41:51 +00:00
Olivier Goffart f6fabcc27b Fix crash when accessing a property of an invalid interface
llvm-svn: 214735
2014-08-04 17:28:11 +00:00
Olivier Goffart 4c182c8bb1 Fix crash when assiging to a property with an invalid type
This is a regression from clang 3.4

Set the result to ExprError and returns true, rather than simply
returns false because errors have been reported already and returning
false show a confusing error

llvm-svn: 214734
2014-08-04 17:28:05 +00:00
Aaron Ballman 5d153e3133 Diagnose GNU-style attributes preceding virt-specifiers, but only when the attribute is known to GCC. Clang accepts attributes in this position, but
GCC does not, so this is a GCC-compat warning. If the attribute is not known to GCC, then the diagnostic is suppressed.

llvm-svn: 214730
2014-08-04 17:03:51 +00:00
DeLesley Hutchins 4266522ab9 Thread safety analysis: Add support for negative requirements, which are
capability expressions of the form !expr, and denote a capability that must
not be held.

llvm-svn: 214725
2014-08-04 16:10:59 +00:00
Aaron Ballman dfe8cc51c2 Highlight the offending function parameter when the format argument refers to an invalid function parameter type.
llvm-svn: 214723
2014-08-04 15:26:33 +00:00
Aaron Ballman 2f9e88b9f2 Highlight the offending function parameter when the format_arg argument refers to an invalid function parameter type.
llvm-svn: 214722
2014-08-04 15:17:29 +00:00
Daniel Jasper 65df5aa918 clang-format: Understand parameter pack initialization.
Before:
  Constructor(A... a) : a_(X<A> { std::forward<A>(a) }...) {}

After:
  Constructor(A... a) : a_(X<A>{std::forward<A>(a)}...) {}

llvm-svn: 214720
2014-08-04 14:51:02 +00:00
Simon Atanasyan 2c590ffa0e [Driver][Mips] Construct dynamic linker path by string concatination.
That reduces a number of `if` operators and prevent a combinatorics explosion
if/when more dynamic linker path variants added.

No functional changes.

llvm-svn: 214712
2014-08-04 12:57:52 +00:00
Pavel Chupin fd223e1680 [x32] Add __int128 support
Summary:
Adding __int128 support explicitly for x86_64 because currently it's on
only when pointer size >= 64 which is not the case for x32.

Test Plan: One of the tests using __int128 is updated

Reviewers: atanasyan, chandlerc

Subscribers: cfe-commits, rob.khasanov, zinovy.nis, dschuff

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

llvm-svn: 214710
2014-08-04 12:39:43 +00:00
David Majnemer 11d2427b21 AST: Fix the mangling for unqualified-blocks
CXXNameMangler::mangleUnqualifiedBlock believed that
MangleContext::getBlockId returned something that used Itanium-style
discriminator numbers.

Discriminator numbers start their numberign from 1 and the first
mangling that actually gets any sort of number mangled in is the second
discriminator.

However, Block IDs start from zero.  The logic for omitting the mangling
number did a ' > 1' instead of a ' > 0' comparison; this could
potentially cause mangling conflicts.

llvm-svn: 214699
2014-08-04 06:16:50 +00:00
David Majnemer 37bffb6f3a AST: Propagate 'AlignIsRequired' though many levels of typedefs
A typedef of a typedef should have AlignIsRequired if *either* typedef
has an AlignAttr attached to it.

llvm-svn: 214698
2014-08-04 05:11:01 +00:00
Richard Smith 077d083b4d PR11778: Fix the rejects-valid half of this bug. We still produce the same
poorly-worded warning for a case value that is not a possible value of the
switched-on expression.

llvm-svn: 214678
2014-08-04 00:40:48 +00:00
Richard Smith 06f621d349 Don't destroy MacroInfos if we find the macro definition is invalid; it'll get
destroyed on shutdown regardless. Fixes a double-delete.

llvm-svn: 214675
2014-08-03 23:41:04 +00:00
Justin Bogner 6bcf724f52 Driver: Simplify a use of the path API
It's a bit more obvious what's going on if we use path::filename
rather than decrementing an iterator here.

llvm-svn: 214668
2014-08-03 21:46:33 +00:00
NAKAMURA Takumi 0f9447d1ce Tools.cpp: Avoid std::to_string() on -fbuild-session-timestamp to appease mingw32 builder.
llvm-svn: 214656
2014-08-03 01:11:44 +00:00
Richard Smith 6d0e97afcf In the case of mangling collisions, make an attempt to note both definitions
involved.

llvm-svn: 214606
2014-08-02 00:50:16 +00:00
Alexey Samsonov d9ad5cec0c [ASan] Use metadata to pass source-level information from Clang to ASan.
Instead of creating global variables for source locations and global names,
just create metadata nodes and strings. They will be transformed into actual
globals in the instrumentation pass (if necessary). This approach is more
flexible:
1) we don't have to ensure that our custom globals survive all the optimizations
2) if globals are discarded for some reason, we will simply ignore metadata for them
   and won't have to erase corresponding globals
3) metadata for source locations can be reused for other purposes: e.g. we may
   attach source location metadata to alloca instructions and provide better descriptions
   for stack variables in ASan error reports.

No functionality change.

llvm-svn: 214604
2014-08-02 00:35:50 +00:00
Justin Bogner 9c6818ef00 InstrProf: Update for LLVM API change
We've added support for a multiple functions with the same name in
LLVM's profile data, so the lookup returning the function hash it
found doesn't make sense anymore. Update to pass in the hash we
expect.

This also adds a test that the version 1 format is still readable,
since the new API is expected to handle that.

llvm-svn: 214586
2014-08-01 22:50:16 +00:00
Richard Smith 7f5755cfac Notional simplification: defer emitting deferred inline methods until we finish
emitting everything, rather than potentially doing this reentrantly.

llvm-svn: 214582
2014-08-01 22:42:16 +00:00
Richard Smith 570706dd7c Actually fix problem with modules buildbot this time.
llvm-svn: 214579
2014-08-01 22:17:28 +00:00
Ben Langmuir 19e6acbd51 Add -fbuild-session-file as an alternative to -fbuild-session-timestamp
Build systems tend to traffic in files and modification times, so having
them touch a file at the beginning of the build can be easier than
having them update the compile command they use every time they build.

llvm-svn: 214577
2014-08-01 22:12:21 +00:00
Alexey Samsonov 4b8de11c81 [Sanitizer] Introduce SanitizerMetadata class.
It is responsible for generating metadata consumed by sanitizer instrumentation
passes in the backend. Move several methods from CodeGenModule to SanitizerMetadata.
For now the class is stateless, but soon it won't be the case.

Instead of creating globals providing source-level information to ASan, we will create
metadata nodes/strings which will be turned into actual global variables in the
backend (if needed).

No functionality change.

llvm-svn: 214564
2014-08-01 21:35:28 +00:00
Joerg Sonnenberger 254f8729d0 Let's assume PowerPC has no SSE.
llvm-svn: 214562
2014-08-01 21:20:02 +00:00
Richard Smith 1ba0a07e46 Re-commit r214547 with tests fixed. Hopefully all the bots will be happy now.
Original message:

Fix iterator invalidation issues that are breaking my modules buildbot's
bootstrap.

llvm-svn: 214555
2014-08-01 20:39:36 +00:00
Richard Smith 455768e2af Revert r214547 due to test breakage.
llvm-svn: 214549
2014-08-01 20:09:39 +00:00
Richard Smith cf08ff50dd Fix iterator invalidation issues that are breaking my modules buildbot's bootstrap.
llvm-svn: 214547
2014-08-01 19:59:14 +00:00
Aaron Ballman e13d00996d Dropping some else-after-returns. No functional changes intended.
llvm-svn: 214526
2014-08-01 17:02:34 +00:00
Daniel Sanders 2ef3cdd3d5 Revert r214497: [mips] Defer va_arg expansion to the backend.
It appears that the backend does not handle all cases that were handled by clang.
In particular, it does not handle structs as used in
SingleSource/UnitTests/2003-05-07-VarArgs.

llvm-svn: 214512
2014-08-01 13:26:28 +00:00
Aaron Ballman 41b10ac3b7 Replacing some more complex logic with a helper function call to ObjCMethod::getReturnTypeSourceRange. No functional changes intended.
llvm-svn: 214511
2014-08-01 13:20:09 +00:00
Robert Lytton f9710b32b1 Xcore target: Fix CXXStdlibIncludeArgs to check 'nostdinc++' flag too.
Summary:
There are no tests as it is dependant upon the environment variables
XCC_C_INCLUDE_PATH & XCC_CPLUS_INCLUDE_PATH  being set.

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

llvm-svn: 214510
2014-08-01 13:11:46 +00:00