Commit Graph

54903 Commits

Author SHA1 Message Date
Jonathan Roelofs 2b00d54676 Emit diagnostic for -munaligned-access on v6m
Patch by: Charlie Turner <charlie.turner@arm.com>

llvm-svn: 219211
2014-10-07 15:11:32 +00:00
Daniel Jasper 4281c5ae01 clang-format: Fix bug with comments between non-trival parameters.
Before:
  SomeFunction(a, a,
               // comment
                      b + x);

After:
  SomeFunction(a, a,
               // comment
               b + x);

llvm-svn: 219209
2014-10-07 14:45:34 +00:00
Rafael Espindola e04a17da81 Allow dllexport alias to base destructors.
We used to avoid these, but it looks like we did so just because we were
not handling dllexport alias correctly.

Dario Domizioli fixed that, so allow these aliases.

Based on a patch by Dario Domizioli!

llvm-svn: 219206
2014-10-07 13:34:42 +00:00
Daniel Jasper d8b4ec0dad clang-format: Add documentation about disabling formatting.
Patch by Marek Kurdej, thanks!

llvm-svn: 219204
2014-10-07 12:15:15 +00:00
Alexey Bataev 941bbec6f4 [OPENMP] 'omp teams' directive basic support.
Includes parsing and semantic analysis for 'omp teams' directive support from OpenMP 4.0. Adds additional analysis to 'omp target' directive with 'omp teams' directive.

llvm-svn: 219197
2014-10-07 10:13:33 +00:00
Alexander Musman d196ef2124 [OPENMP] Small refactoring of EmitOMPSimdLoop helper routine.
No functional changes intended.
Renamed EmitOMPSimdLoop to EmitOMPInnerLoop, I plan to re-use
it to emit inner loop in the future patches for CodeGen of the
worksharing loop directives (omp for, omp for simd).

llvm-svn: 219195
2014-10-07 08:57:09 +00:00
David Majnemer 3349872cf3 driver: Map closed standard file descriptors to /dev/null
Utilize Process::FixupStandardFileDescriptors, introduced in r219170, to
guard against files from being treated as one of the standard file
descriptors.

llvm-svn: 219174
2014-10-06 23:52:23 +00:00
Fariborz Jahanian 35ee87debe Objective-C SDK modernizer. Patch to support modernization
to NS_ENUM/NS_OPTION macros when typedef names are other
than NSInteger/NSUInteger (int8_t, etc.).
rdar://18532199

llvm-svn: 219173
2014-10-06 23:50:37 +00:00
Eli Bendersky 11b6badd7b Update title of the ReleaseNodes doc.
It was still "3.5 (In-Progress)" - should be 3.6

llvm-svn: 219153
2014-10-06 22:45:17 +00:00
Bill Schmidt cad3a5f7d4 [PATCH][Power] Fix (and deprecate) vec_lvsl and vec_lvsr for little endian
The use of the vec_lvsl and vec_lvsr interfaces are discouraged for
little endian targets since Power8 hardware is a minimum requirement,
and Power8 provides reasonable performance for unaligned vector loads
and stores.  Up till now we have not provided "correct" (i.e., big-
endian-compatible) code generation for these interfaces, as to do so
produces poorly performing code.  However, this has become the source
of too many questions.

With this patch, LLVM will now produce compatible code for these
interfaces, but will also produce a deprecation warning message for
PPC64LE when one of them is used.  This should make the porting direction
clearer to programmers.  A similar patch has recently been committed to
GCC.

This patch includes a test for the warning message.  There is a companion
patch that adds two unit tests to projects/test-suite.

llvm-svn: 219137
2014-10-06 19:02:20 +00:00
Rafael Espindola 6ff5f2e13b Remove cases that are now handled by the parent class implementation.
llvm-svn: 219132
2014-10-06 17:45:47 +00:00
Eric Christopher 7647109917 Turn on the integrated assembler by default for ppc64 and
ppc64le.

Reviewed by Hal Finkel and Bill Schmidt.

llvm-svn: 219129
2014-10-06 17:33:18 +00:00
Fariborz Jahanian 2618dbaf5f Patch to wrap up '_' as separator in version numbers
in availability attribute by preserving this info.
in VersionTuple and using it in pretty printing of attributes
and yet using '.' as separator when diagnosing unavailable 
message calls. rdar://18490958

llvm-svn: 219124
2014-10-06 16:46:02 +00:00
Daniel Jasper a45eb4c000 clang-format: If in doubt, assume '+' is a binary operator.
Before:
  #define LENGTH(x, y) (x) - (y)+1

After:
  #define LENGTH(x, y) (x) - (y) + 1

llvm-svn: 219119
2014-10-06 13:16:43 +00:00
Samuel Benzaquen a117002d93 Fix bug in DynTypedMatcher::constructVariadic() that would cause false negatives.
Summary:
DynTypedMatcher::constructVariadic() where the restrict kind of the
different matchers are not related causes the matcher to have a "None"
restrict kind. This causes false negatives for anyOf and eachOf.
Change the logic to get a common ancestor if there is one.
Also added regression tests that fail without the fix.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 219118
2014-10-06 13:14:30 +00:00
Aaron Ballman d2a3f4765b Using an explicit cast to work around MSVC 2013 not picking the conversion operator as expected. NFC, should fix the MSVC build bots.
llvm-svn: 219116
2014-10-06 12:42:31 +00:00
Alexander Musman 81e652f86e [OPENMP] Fix target triple of a test, which uses __int128 type
llvm-svn: 219114
2014-10-06 11:36:48 +00:00
Alexander Musman 174b3ca682 [OPENMP] Limit the loop counters to 64 bits for the worksharing loops
llvm-svn: 219113
2014-10-06 11:16:29 +00:00
David Blaikie 6dddfe30d6 Add FIXME/notes to the future.
llvm-svn: 219104
2014-10-06 05:52:27 +00:00
David Blaikie fd58072675 DebugInfo: Don't include implicit special members in the list of class members
By leaving these members out of the member list, we avoid them being
emitted into type unit definitions - while still allowing the
definition/declaration to be injected into the compile unit as expected.

llvm-svn: 219101
2014-10-06 05:18:55 +00:00
David Blaikie 56cfbe841f DebugInfo: Don't include member function template specializations in the list of class members
By leaving these members out of the member list, we avoid them being
emitted into type unit definitions - while still allowing the
definition/declaration to be injected into the compile unit as expected.

llvm-svn: 219100
2014-10-06 05:06:54 +00:00
David Majnemer a00381fb73 MS ABI: Make comment more accurate
The ABI for function-scope statics changed in VS "14", not MSVC 2013.

llvm-svn: 219076
2014-10-05 06:44:55 +00:00
David Majnemer 040fa34bec MS ABI: Use '1' (instead of '0') relative scope discriminators
This changes the scope discriminator's behavior to start at '1' instead
of '0'.  Symbol table diffing, for ABI compatibility testing, kept
finding these as false positives.

llvm-svn: 219075
2014-10-05 06:44:53 +00:00
David Majnemer b3341ea453 MS ABI: Implement thread_local for global variables
Summary:
This add support for the C++11 feature, thread_local global variables.
The ABI Clang implements is an improvement of the MSVC ABI.  Sadly,
further improvements could be made but not without sacrificing ABI
compatibility.

The feature is implemented as follows:
- All thread_local initialization routines are pointed to from the
  .CRT$XDU section.
- All non-weak thread_local variables have their initialization routines
  call from a single function instead of getting their own .CRT$XDU
  section entry.  This is done to open up optimization opportunities to
  the compiler.
- All weak thread_local variables have their own .CRT$XDU section entry.
  This entry is in a COMDAT with the global variable it is initializing;
  this ensures that we will initialize the global exactly once.
- Destructors are registered in the initialization function using
  __tlregdtor.

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

llvm-svn: 219074
2014-10-05 05:05:40 +00:00
Benjamin Kramer 07935294be Return a reference instead of vector copy for parentmap queries.
The map is immutable until the whole ASTContext dies. While there
movify a couple of copies in ASTMatchFinder away. NFC.

llvm-svn: 219062
2014-10-04 17:01:26 +00:00
Hal Finkel 64567a80d2 Emit @llvm.assume for non-parameter lvalue align_value-attribute loads
We already add the align parameter attribute for function parameters that have
the align_value attribute (or those with a typedef type having that attribute),
which is an important special case, but does not handle pointers with value
alignment assumptions that come into scope in any other way. To handle the
general case, emit an @llvm.assume-based alignment assumption whenever we load
the pointer-typed lvalue of an align_value-attributed variable (except for
function parameters, which we already deal with at entry).

I'll also note that this is more general than Intel's described support in:
  https://software.intel.com/en-us/articles/data-alignment-to-assist-vectorization
which states that the compiler inserts __assume_aligned directives in response
to align_value-attributed variables only for function parameters and for the
initializers of local variables. I think that we can make the optimizer deal
with this more-general scheme (which could lead to a lot of calls to
@llvm.assume inside of loop bodies, for example), but if not, I'll rework this
to be less aggressive.

llvm-svn: 219052
2014-10-04 15:26:49 +00:00
Nikola Smiljanic 905bfda957 -ms-extensions: Allow __super in return stements.
llvm-svn: 219050
2014-10-04 10:17:57 +00:00
David Majnemer 5da21da4f6 MS ABI: Disallow dllimported/exported variables from having TLS
Windows TLS relies on indexing through a tls_index in order to get at
the DLL's thread local variables.  However, this index is not exported
along with the variable: it is assumed that all accesses to thread local
variables are inside the same module which created the variable in the
first place.

While there are several implementation techniques we could adopt to fix
this (notably, the Itanium ABI gets this for free), it is not worth the
heroics.

Instead, let's just ban this combination.  We could revisit this in the
future if we need to.

This fixes PR21111.

llvm-svn: 219049
2014-10-04 06:51:54 +00:00
David Majnemer 7656f41809 Sema: Simplify checkAttributesAfterMerging
Use getDLLAttr to factor out some common dllimport/dllexport code.

llvm-svn: 219048
2014-10-04 06:16:45 +00:00
Richard Smith a9d100178c PR20991: ::decltype is not valid.
llvm-svn: 219043
2014-10-04 01:57:39 +00:00
Benjamin Kramer 719772c269 Remove stray enum keywords. MSVC sees this as a redeclaration at global scope.
llvm-svn: 219031
2014-10-03 22:20:30 +00:00
Justin Bogner fa9df7af07 test: Disable standard system includes in %clang_cc1
This adds -nostdsysteminc to the %clang_cc1 expansion, which should
make it harder to accidentally write tests that depend on headers in
/usr/include. It also updates a few tests that use -isysroot <x> and a
darwin triple to omit the triple and use -isystem <x>/usr/include
instead, making them a little bit more general.

Incidentally, this fixes a test failure I'm seeing on darwin in
Modules/stddef.c, that happens because my system finds a stddef.h in
/usr/include.

llvm-svn: 219030
2014-10-03 22:18:49 +00:00
Jingyue Wu 3c3b48805f Suppress defined-but-unused warnings
by adding a fake use

llvm-svn: 219029
2014-10-03 22:16:40 +00:00
Jonathan Roelofs b140a100a0 CFE Knob for: Add a thread-model knob for lowering atomics on baremetal & single threaded systems
http://reviews.llvm.org/D4985

llvm-svn: 219027
2014-10-03 21:57:44 +00:00
Anna Zaks 0820e13e2a [analyzer] Refactor and cleanup IsCompleteType
There are three copies of IsCompleteType(...) functions in CSA and all
of them are incomplete (I experienced  crashes in some CSA's test cases).
I have replaced these function calls with Type::isIncompleteType() calls.

A patch by Aleksei Sidorin!

llvm-svn: 219026
2014-10-03 21:49:03 +00:00
Anna Zaks d79b840716 [analyzer] Make Malloc Checker track memory allocated by if_nameindex
The MallocChecker does currently not track the memory allocated by
if_nameindex. That memory is dynamically allocated and should be freed
by calling if_freenameindex. The attached patch teaches the checker
about these functions.

Memory allocated by if_nameindex is treated as a separate allocation
"family". That way the checker can verify it is freed by the correct
function.

A patch by Daniel Fahlgren!

llvm-svn: 219025
2014-10-03 21:48:59 +00:00
Anna Zaks 2d2f137ed4 [analyzer] Make CStringChecker correctly calculate return value of mempcpy
The return value of mempcpy is only correct when the destination type is
one byte in size. This patch casts the argument to a char* so the
calculation is also correct for structs, ints etc.

A patch by Daniel Fahlgren!

llvm-svn: 219024
2014-10-03 21:48:54 +00:00
Benjamin Kramer de952d1180 Initialize MCObjectFileInfo when parsing ms-style asm.
Otherwise we're left with an half-initialized bag of variables that may or may
not explode later on. Should bring the MSVC buildbot back to life.

llvm-svn: 219023
2014-10-03 21:48:23 +00:00
Fariborz Jahanian aae7fefce8 Objective-C. Assortment of improvements pretty printing
objective-C declarations, including printing of availability
attributes on methods.

llvm-svn: 219013
2014-10-03 20:05:33 +00:00
Duncan P. N. Exon Smith 3c51fa6aae Revert "Revert "DI: LLVM schema change: fold constants into string""
This reverts commit r218917, effectively reapplying r218913.  Original
commit message follows.

--

Update debug info testcases for an LLVM metadata schema change to fold
metadata constant operands into a single `MDString`.

Part of PR17891.

llvm-svn: 219011
2014-10-03 20:01:52 +00:00
Benjamin Kramer 1a6e0a9b40 ASTUnit: Replace out parameter with return value, we have NRVO for this.
And elide the copy when pushing the return value into a vector. NFC.

llvm-svn: 219001
2014-10-03 18:52:54 +00:00
Benjamin Kramer d0eed3a006 Format: ArrayRefize some implicit copies away.
NFC.

llvm-svn: 219000
2014-10-03 18:52:48 +00:00
Hal Finkel 92e31a5ead Add getOpenMPSimdDefaultAlignment for PowerPC
When the aligned clause of an OpenMP simd pragma is not provided with an
explicit alignment, a target-dependent default must be used. This adds such a
default of PPC targets.

This will become slightly more complicated when BG/Q support is added (because
then it will depend on the type). For now, 16 is a correct value for all
systems, and covers Altivec and VSX vectors.

llvm-svn: 218994
2014-10-03 17:45:20 +00:00
Fariborz Jahanian b6161611b1 Add comment about separators must match in
version numbers.

llvm-svn: 218993
2014-10-03 17:21:12 +00:00
Hal Finkel 0dd05d4b59 constexpr evaluation for __builtin_assume_aligned
Richard noted in the review of r217349 that extra handling of
__builtin_assume_aligned inside of the expression evaluator was needed. He was
right, and this should address the concerns raised, namely:

 1. The offset argument to __builtin_assume_aligned can have side effects, and
    we need to make sure that all arguments are properly evaluated.

 2. If the alignment assumption does not hold, that introduces undefined
    behavior, and undefined behavior cannot appear inside a constexpr.

and hopefully the diagnostics produced are detailed enough to explain what is
going on.

llvm-svn: 218992
2014-10-03 17:18:37 +00:00
Dan Liew fe7268600d [sphinx clean up] Fix warning introduced by r218957
llvm-svn: 218983
2014-10-03 12:36:20 +00:00
Asiri Rathnayake 9e3c7cbfa1 Revert changes in r218863, r218864
Summary: The changes introduced in the above two commits are giving
a rough time to one of the build bots. Reverting the changes for the
moment so that the bot can go green again.

Change-Id: Id19f6cb2a8bc292631fac2262268927563d820c2
llvm-svn: 218970
2014-10-03 09:11:41 +00:00
Alexander Potapenko e2e8b0e009 Revert r218925 - "Patch to warn if 'override' is missing"
This CL has caused bootstrap failures on Linux and OSX buildbots running with -Werror.

Example report from http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/13183/steps/bootstrap%20clang/logs/stdio:

================================================================
[ 91%] Building CXX object tools/clang/tools/diagtool/CMakeFiles/diagtool.dir/ShowEnabledWarnings.cpp.o
In file included from /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/AMDGPUISelDAGToDAG.cpp:20:
In file included from /home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/SIISelLowering.h:19:
/home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/lib/Target/R600/SIInstrInfo.h:71:8: error: 'getLdStBaseRegImmOfs' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
  bool getLdStBaseRegImmOfs(MachineInstr *LdSt,
       ^
/home/dtoolsbot/build/sanitizer-x86_64-linux/build/llvm/include/llvm/Target/TargetInstrInfo.h:815:16: note: overridden virtual function is here
  virtual bool getLdStBaseRegImmOfs(MachineInstr *LdSt,
               ^
================================================================

llvm-svn: 218969
2014-10-03 09:02:53 +00:00
David Majnemer 749b68630b MS ABI: Move test from virtual-inheritance to single-inheritance
The test didn't actually use virtual inheritance.

llvm-svn: 218966
2014-10-03 08:03:23 +00:00
David Majnemer 312c8049f2 MS ABI: Add a vftable test for pure virtual methods
llvm-svn: 218965
2014-10-03 07:54:12 +00:00