Commit Graph

57326 Commits

Author SHA1 Message Date
Benjamin Kramer 51680bccda CodeGen: Base the conditional cleanup machinery on variadic templates
This is complicated by the fact that we can't simply use side-effecting
calls in an argument list without losing all guarantees about the order
they're emitted. To keep things deterministic we use tuples and brace
initialization, which thankfully guarantees evaluation order.

No functionality change intended.

llvm-svn: 232121
2015-03-12 23:41:40 +00:00
Daniel Jasper 55ca608cdc clang-format: [OBJC] Don't indent 8 spaces in method declarations.
Before:
  - (void)aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:
          (SoooooooooooooooooooooomeType *)bbbbbbbbbb;

After:
  - (void)aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:
      (SoooooooooooooooooooooomeType *)bbbbbbbbbb;

llvm-svn: 232112
2015-03-12 22:13:45 +00:00
Sanjay Patel 0a6da5de55 [X86, AVX2] Replace inserti128 and extracti128 intrinsics with generic shuffles
This is nearly identical to the v*f128_si256 parts of r231792 and r232052.

AVX2 introduced proper integer variants of the hacked integer insert/extract
C intrinsics that were created for this same functionality with AVX1.

This should complete the front end fixes for insert/extract128 intrinsics. 
Corresponding LLVM patch to follow.

llvm-svn: 232109
2015-03-12 21:54:24 +00:00
Benjamin Kramer 8cbf749690 Sema: Make BoundTypeDiagnoser a variadic template
llvm-svn: 232101
2015-03-12 20:58:06 +00:00
Nico Weber 3f8dafb021 Fix grammar in a comment, wrap to 80 columns. No behavior change.
llvm-svn: 232087
2015-03-12 19:37:10 +00:00
Nico Weber bdae5c390c Remove duplicate "the". N+1 redundancy is not useful here.
llvm-svn: 232086
2015-03-12 19:35:34 +00:00
David Majnemer a1aea9aad4 MS ABI: Allow a nullptr_t exception to be caught by void * catch handler
A nullptr exception object can be caught by any pointer type catch
handler.  However, it is not possible to express this in the exception
info for the MS ABI.  As a middle ground, allow such exception objects
to be caught with pointer-to-void catch handlers.

llvm-svn: 232069
2015-03-12 17:44:49 +00:00
Logan Chien 0d59d603ef [docs] Update the doxygen configuration file.
Update the doxygen configuration file and the Makefile build rules
to provide better output (simply use the default stylesheet and template
from the Doxygen distribution.)

This CL has upgrade doxygen.cfg.in to Doxygen 1.8.6.

llvm-svn: 232066
2015-03-12 17:27:53 +00:00
Logan Chien 6f43a4fa25 [docs] Replace the doxygen qch option properly.
llvm-svn: 232065
2015-03-12 17:27:19 +00:00
Sanjay Patel f204b00940 Replace second (hopefully unused) access of macro input argument with zero vector to be safer.
Suggested by Craig Topper in D8275.

This is a follow-on to r232052.

llvm-svn: 232061
2015-03-12 17:23:46 +00:00
Benjamin Kramer b5356e7fcd ASTMatchers: Add an explicit dependency on libclangBasic.
In a static build the dependency is picked up implictly, but not in a shared
library build. This is needed for the new ObjC matchers that reference Selector.

llvm-svn: 232055
2015-03-12 16:25:19 +00:00
Sanjay Patel 0c351aba25 [X86, AVX] replace vextractf128 intrinsics with generic shuffles
This is very much like D8088 (checked in at r231792).

Now that we've replaced the vinsertf128 intrinsics,
do the same for their extract twins.

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

llvm-svn: 232052
2015-03-12 15:50:36 +00:00
Manuel Klimek bfa4357271 Add support for a few Objective-C matchers.
Add some matchers for Objective-C selectors and messages to
ASTMatchers.h. Minor mods to ASTMatchersTest.h to allow test files with
".m" extension in addition to ".cpp".  New tests added to
ASTMatchersTest.c.

Patch by Dean Sutherland.

llvm-svn: 232051
2015-03-12 15:48:15 +00:00
Daniel Jasper b754a747be clang-format: When putting */& next to types, also wrap before them.
Before:
  LoooooooooooongType *
      loooooooooooongVariable;

After:
  LoooooooooooongType
      *loooooooooooongVariable;

llvm-svn: 232044
2015-03-12 15:04:53 +00:00
Daniel Jasper 6acf513099 clang-format: [Java] Support anonymous classes after = and return.
Before:
  A a = new A(){public String toString(){return "NotReallyA";
  }
  }
  ;

After:
  A a = return new A() {
    public String toString() {
      return "NotReallyA";
    }
  };

This fixes llvm.org/PR22878.

llvm-svn: 232042
2015-03-12 14:44:29 +00:00
Benjamin Kramer 8610cae98a Sema: Don't emit a missing prototype warning for deleted functions.
This is a bit more involved than I anticipated, so here's a breakdown
of the changes:
  1. Call ActOnFinishFunctionBody _after_ we parsed =default and
     =delete specifiers. Saying that we finished the body before parsing
     =default is just wrong. Changing this allows us to use isDefaulted
     and isDeleted on a decl in ActOnFinishFunctionBody.
  2. Check for -Wmissing-prototypes after we parsed the function body.
  3. Disable -Wmissing-prototypes when the Decl isDeleted.

llvm-svn: 232040
2015-03-12 14:28:47 +00:00
Benjamin Kramer e4812148e1 Use Sema's PrintingPolicy when diagnosing DeclSpecs.
Sema overrides ASTContext's policy on the first emitted diagnostic
(doesn't matter if it's ignored or not). This means changing the order
of diagnostic emission in Sema suddenly changes the text of diagnostic
emitted from the parser.

In the test case -Wmissing-prototypes (ignored) was the culprit, use
'int main' to suppress that warning so we see when this regresses.
Also move it into Sema/ as it's not testing any C++.

llvm-svn: 232039
2015-03-12 14:28:38 +00:00
Aaron Ballman e9f931f974 Reverting r232034, as it broke one of the bots with link errors. Details at: http://bb.pgr.jp/builders/ninja-clang-x64-mingw64-RA/builds/6352/steps/build/logs/stdio
llvm-svn: 232038
2015-03-12 14:14:48 +00:00
Aaron Ballman 0c22d5a339 Instead of dereferencing std::vector::end() (which is UB and causes failed assertions in debug builds with Visual Studio), use data() + size() to calculate the end iterator. Amends r231952.
llvm-svn: 232037
2015-03-12 13:49:45 +00:00
Alexander Musman 92bdaabf97 [OPENMP] CodeGen - 'omp for' with dynamic schedule kinds.
Differential Revision: http://reviews.llvm.org/D7138

llvm-svn: 232036
2015-03-12 13:37:50 +00:00
Aaron Ballman 12865302b7 Added some matchers for objective c selectors and messages to ASTMatchers.h. Minor mods to ASTMatchersTest.h to allow test files with ".m" extension in addition to ".cpp". New tests added to ASTMatchersTest.c.
Patch by Dean Sutherland, reviewed by Manuel Klimek. From http://reviews.llvm.org/D7710

llvm-svn: 232034
2015-03-12 13:21:19 +00:00
Alexey Bataev 2df54a07bf [OPENMP] Initial codegen for 'omp sections' and 'omp section' directives.
If only one section is found in the sections region, it is emitted just like single region.
Otherwise it is emitted as a static non-chunked loop.

#pragma omp sections
{
#pragma omp section
  {1}
  ...
  #pragma omp section
  {n}
}
is translated to something like

i32 <iter_var>
i32 <last_iter> = 0
i32 <lower_bound> = 0
i32 <upper_bound> = n-1
i32 <stride> = 1
call void @__kmpc_for_static_init_4(<loc>, i32 <gtid>, i32 34/*static non-chunked*/, i32* <last_iter>, i32* <lower_bound>, i32* <upper_bound>, i32* <stride>, i32 1/*increment always 1*/, i32 1/*chunk always 1*/)
<upper_bound> = min(<upper_bound>, n-1)
<iter_var> = <lb>
check:
br <iter_var> <= <upper_bound>, label cont, label exit
continue:
switch (IV) {
  case 0:
  {1};
  break;
  ...
  case <NumSection> - 1:
  {n};
  break;
  }
  ++<iter_var>
  br label check
  exit:
  call void @__kmpc_for_static_fini(<loc>, i32 <gtid>)
Differential Revision: http://reviews.llvm.org/D8244

llvm-svn: 232021
2015-03-12 08:53:29 +00:00
Tanya Lattner cfeff2d237 Update copyright year to 2015.
llvm-svn: 231999
2015-03-12 01:36:10 +00:00
Justin Bogner 0cb14759fc Driver: Keep -isysroot flags in crash scripts if we're dumping a VFS
For crashes with a VFS (ie, with modules), the -isysroot flag is often
necessary to reproduce the crash. This is especially true if some
modules need to be rebuilt, since without the sysroot they'll try to
read headers that are outside of the VFS.

I find it likely that we should keep some of the other -i flags in
this case as well, but I haven't seen that come up in practice yet so
it seems better to be conservative.

llvm-svn: 231997
2015-03-12 00:52:56 +00:00
Peter Collingbourne 6e7908ddb7 docs: Document byte arrays.
llvm-svn: 231994
2015-03-12 00:30:41 +00:00
Justin Bogner 42220ed3da Driver: Print the clang version and original command in crash scripts
When a crash report script doesn't work for a reproduction on your
machine for one reason or another, it can be really tricky to figure
out why not. The compiler version that crashed and the original
command line before stripping flags are very helpful when this comes
up.

llvm-svn: 231989
2015-03-12 00:14:35 +00:00
Joerg Sonnenberger 27173288c2 Under duress, move check for target support of __builtin_setjmp/
__builtin_longjmp to Sema as requested by John McCall.

llvm-svn: 231986
2015-03-11 23:46:32 +00:00
Alexey Samsonov ce2e77c771 Add deprecation notice for -f(no-)sanitize-recover flags.
These flags should be replaced with corresponding
-f(no-)sanitize-recover=<list> flags.

llvm-svn: 231983
2015-03-11 23:34:25 +00:00
Anton Yartsev 1c6ff0ac2e [analyzer] www: +progress for undefbehavior.ZeroAllocDereference
llvm-svn: 231978
2015-03-11 22:29:32 +00:00
David Majnemer 678732933f Don't overconstrain a FileCheck pattern
llvm-svn: 231971
2015-03-11 21:50:09 +00:00
Hal Finkel 0d0a1a53e3 [PowerPC] ABI support for the QPX vector instruction set
Support for the QPX vector instruction set, used on the IBM BG/Q supercomputer,
has recently been added to the LLVM PowerPC backend. This vector instruction
set requires some ABI modifications because the ABI on the BG/Q expects
<4 x double> vectors to be provided with 32-byte stack alignment, and to be
handled as native vector types (similar to how Altivec vectors are handled on
mainline PPC systems). I've named this ABI variant elfv1-qpx, have made this
the default ABI when QPX is supported, and have updated the ABI handling code
to provide QPX vectors with the correct stack alignment and associated
register-assignment logic.

llvm-svn: 231960
2015-03-11 19:14:15 +00:00
David Majnemer f4d9a5a964 MS ABI: Mark 'throw' as implemented in the compatibility doc
llvm-svn: 231953
2015-03-11 18:38:51 +00:00
David Majnemer dfa6d2067c MS ABI: Implement copy-ctor closures, finish implementing throw
This adds support for copy-constructor closures.  These are generated
when the C++ runtime has to call a copy-constructor with a particular
calling convention or with default arguments substituted in to the call.

Because the runtime has no mechanism to call the function with a
different calling convention or know-how to evaluate the default
arguments at run-time, we create a thunk which will do all the
appropriate work and package it in a way the runtime can use.

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

llvm-svn: 231952
2015-03-11 18:36:39 +00:00
Richard Smith 7474dd92d3 [modules] When merging the pattern of a class template definition into a prior
definition, be sure to update the definition data on all declarations, not just
the canonical one, since the pattern might not be in the list of pending
definitions (if it used to be canonical itself).

One-line fix by me; reduced testcase by Daniel Jasper!

llvm-svn: 231950
2015-03-11 18:21:02 +00:00
Anastasia Stulova e8d88ac185 Reverted OpenCL2.0 atomic type commits r231932, r231935
(caused undesirable update of -std flag to use _Atomic)  

llvm-svn: 231942
2015-03-11 17:26:37 +00:00
Fariborz Jahanian 20cfff3d31 revert r231700 (designated initializer patch) which broke
several projects. rdar://20120666.

llvm-svn: 231939
2015-03-11 16:59:48 +00:00
Anastasia Stulova 7263c35440 OpenCL: CL2.0 atomic type diagnostics
Added restictions for atomic type usage from OpenCL C Spec Section 6.13.11.8

llvm-svn: 231935
2015-03-11 16:23:10 +00:00
Anastasia Stulova 0cb5d3333a OpenCL: CL2.0 atomic types
OpenCL C Spec v2.0 Section 6.13.11

- Made c11 _Atomic being accepted only for c11 compilations

- Implemented CL2.0 atomics by aliasing them to the corresponding c11 atomic types using implicit typedef

- Added diagnostics for atomics Khronos extension enabling

llvm-svn: 231932
2015-03-11 15:57:53 +00:00
Kit Barton 8553bec911 Add builtins for the 64-bit vector integer arithmetic instructions added in POWER8.
These are the Clang-related changes for the instructions added to LLVM in http://reviews.llvm.org/D7959.

Phabricator review: http://reviews.llvm.org/D8041

llvm-svn: 231931
2015-03-11 15:57:19 +00:00
Daniel Jasper 8c68a64ec8 clang-format: Recognize the .ts (TypeScript) extension as JavaScript.
Patch by Martin Probst. Thank you.

llvm-svn: 231926
2015-03-11 14:58:38 +00:00
Daniel Jasper dc4f725673 clang-format: Fix incorrect && recognition.
Before:
  if (a &&(b = c)) ..

After:
  if (a && (b = c)) ..

llvm-svn: 231920
2015-03-11 12:59:49 +00:00
Ed Schouten e5bdc8516e Enable security checks for arc4random() on CloudABI as well.
CloudABI also supports the arc4random() function. We can enable compiler
warnings for rand(), random() and *rand48() on this system as well.

llvm-svn: 231914
2015-03-11 08:48:55 +00:00
Ed Schouten 2b60d1eee5 Fix up default header paths for CloudABI.
CloudABI is a pure cross compilation target. This means that we should
not add /usr/include and /usr/local/include. Instead, headers are stored
in $sysroot/$triple/include.

The method of going back to the sysroot (by using "../../..") is also
used in this function for some of the other environments (e.g., MinGW).

llvm-svn: 231913
2015-03-11 08:46:01 +00:00
Ed Schouten f33c607c0a Add target information for CloudABI on x86-64.
CloudABI can be identified by the __CloudABI__ preprocessor definition. The
system uses ELF executables.

CloudABI uses Unicode 7.0.0 for the encoding of wchar_t. As Unicode 7.0.0 is
synchronized with ISO/IEC 10646:2012 (released on 2012-06-01),
__STDC_ISO_10646__ is defined as 201206L.

llvm-svn: 231912
2015-03-11 08:42:46 +00:00
David Majnemer f9bde287e8 Sema: Properly track mangling number/name for linkage for using decls
Using declarations which are aliases to struct types have their name
used as the struct type's name for linkage purposes.  Otherwise, make
sure to give an anonymous struct defined inside a using declaration a
mangling number to disambiguate it from other anonymous structs in the
same context.

This fixes PR22809.

llvm-svn: 231909
2015-03-11 06:45:39 +00:00
Daniel Jasper a61e212a43 Prevent test from accessing files.
llvm-svn: 231907
2015-03-11 06:01:01 +00:00
Alexey Bataev 10fec57e5a [OPENMP] Fix for ExprWithCleanups in 'omp atomic' constructs.
This patch allows using of ExprWithCleanups expressions and other complex expressions in 'omp atomic' construct
Differential Revision: http://reviews.llvm.org/D8200

llvm-svn: 231905
2015-03-11 04:48:56 +00:00
NAKAMURA Takumi 7304a2427e CGOpenMPRuntime.h: Fix an incorrect \param on emitTaskOutlinedFunction(). [-Wdocumentation]
llvm-svn: 231903
2015-03-11 03:51:40 +00:00
Richard Smith 8ce51084b8 [modules] Avoid accidentally completing the redeclaration chain when updating
all the existing declarations of a record-like entity with a pointer to its
definition.

llvm-svn: 231901
2015-03-11 01:44:51 +00:00
Richard Smith 67375c3bbc Fix test to specify an Itanium triple.
llvm-svn: 231900
2015-03-11 01:09:01 +00:00
Rafael Espindola 3937738b81 Remove a bugus test.
This was using the driver to test LLVM.

I checked that disabling the code path that the test was testing causes
llvm tests to fail.

llvm-svn: 231895
2015-03-11 00:28:59 +00:00
Richard Smith ed1cb88c8a For PR22870: produce an error rather than asserting if a designated initializer appears in a signature.
llvm-svn: 231892
2015-03-11 00:12:17 +00:00
Nico Weber e93bcd1752 Gender-neutralize a comment.
llvm-svn: 231891
2015-03-11 00:05:26 +00:00
Richard Smith 9ab4ccecb3 [modules] Fix iterator invalidation issue with names being added to a module
while we're writing out the identifier table.

llvm-svn: 231890
2015-03-11 00:00:51 +00:00
Anton Yartsev 2487dd6501 [analyzer] Make getCheckIfTracked() return either leak or regular checker.
llvm-svn: 231863
2015-03-10 22:24:21 +00:00
Eric Christopher e0646e6a0a Update clang for llvm r231861.
llvm-svn: 231862
2015-03-10 22:03:27 +00:00
Fariborz Jahanian 2954c67e4b [Objective-C Sema]. Remove -Wreceiver-is-weak warning.
It is incorrect and better warning is issued under
-Warc-repeated-use-of-weak. rdar://16316934.

llvm-svn: 231851
2015-03-10 21:28:33 +00:00
David Majnemer 999cbf9d21 MS ABI: Mangle the location of the catchable type into it's name
Because the catchable type has a reference to its name, mangle the
location to ensure that two catchable types with different locations are
distinct.

llvm-svn: 231819
2015-03-10 19:01:51 +00:00
John McCall af6b3f8ba6 Recognize objc_bridge(id) on bridged casts to CF types.
Fixes <rdar://20107345>.

llvm-svn: 231814
2015-03-10 18:41:23 +00:00
Benjamin Kramer d910d16c89 Make helper functions static. NFC.
llvm-svn: 231811
2015-03-10 18:24:01 +00:00
Aaron Ballman 9bf6b75f04 The semantic spelling enumeration should retain values to the spelling list indexes used by the attribute. The only attribute affected by this in practice is the OpenCLImageAccessAttr, which has duplicate semantic spellings that are automatically stripped.
We do not implicitly create an OpenCLImageAccessAttr, so this change only affects out of tree users. There is no way to test this behavior specifically that I can see, since this only affects implicit creation of attributes.

Fixes PR22403.

llvm-svn: 231803
2015-03-10 17:19:18 +00:00
Sanjay Patel 7f6aa52e93 [X86, AVX] Replace vinsertf128 intrinsics with generic shuffles.
We want to replace as much custom x86 shuffling via intrinsics
as possible because pushing the code down the generic shuffle
optimization path allows for better codegen and less complexity
in LLVM.

This is the sibling patch for the LLVM half of this change:
http://reviews.llvm.org/D8086

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

llvm-svn: 231792
2015-03-10 15:19:26 +00:00
Ben Langmuir 921f2e6746 Document __has_feature(modules) in LanguageExtensions
Fixes PR18985

Patch by Vassil Vassilev!

llvm-svn: 231789
2015-03-10 14:39:26 +00:00
Renato Golin 496059c8c9 Allow -target= and --target options
Using clang as a cross-compiler with the 'target' option could be confusing
for those inexperienced in the realm of cross compiling.

This patch would allow the use of all these four variants of the target option:
-target <triple>
--target <triple>
-target=<triple>
--target=<triple>

Patch by Gabor Ballabas.

llvm-svn: 231787
2015-03-10 13:58:33 +00:00
Yaron Keren 09fb7c6e7a Teach raw_ostream to accept SmallString.
Saves adding .str() call to any raw_ostream << SmallString usage
and a small step towards making .str() consistent in the ADTs by
removing one of the SmallString::str() use cases, discussion at

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141013/240026.html

I'll update the Phabricator patch http://reviews.llvm.org/D6372
for review of the Twine SmallString support, it's more complex
than this one.

llvm-svn: 231763
2015-03-10 07:33:23 +00:00
Alexey Bataev 62b63b197d [OPENMP] Initial codegen for 'omp task' directive.
The task region is emmitted in several steps:

Emit a call to kmp_task_t *__kmpc_omp_task_alloc(ident_t *, kmp_int32 gtid, kmp_int32 flags, size_t sizeof_kmp_task_t, size_t sizeof_shareds, kmp_routine_entry_t *task_entry).
Here task_entry is a pointer to the function:
kmp_int32 .omp_task_entry.(kmp_int32 gtid, kmp_task_t *tt) {
    TaskFunction(gtid, tt->part_id, tt->shareds);
      return 0;
}
Copy a list of shared variables to field shareds of the resulting structure kmp_task_t returned by the previous call (if any).
Copy a pointer to destructions function to field destructions of the resulting structure kmp_task_t.
Emit a call to kmp_int32 __kmpc_omp_task(ident_t *, kmp_int32 gtid, kmp_task_t *new_task), where new_task is a resulting structure from previous items.
Differential Revision: http://reviews.llvm.org/D7560

llvm-svn: 231762
2015-03-10 07:28:44 +00:00
Alexey Bataev da19af4f42 [OPENMP] Fixed tests for non-debug builds. NFC.
llvm-svn: 231758
2015-03-10 05:28:46 +00:00
Alexey Bataev 36bf011e83 [OPENMP] Improved code for generating debug info + generation of all OpenMP regions in termination scope
Patch adds proper generation of debug info for all OpenMP regions. Also, all OpenMP regions are generated in a termination scope, because standard does not allow to throw exceptions out of structured blocks, associated with the OpenMP regions
Differential Revision: http://reviews.llvm.org/D7935

llvm-svn: 231757
2015-03-10 05:15:26 +00:00
Rafael Espindola eb26ddf559 Revert "[OPENMP] Improved code for generating debug info + generation of all OpenMP regions in termination scope Patch adds proper generation of debug info for all OpenMP regions. Also, all OpenMP regions are generated in a termination scope, because standard does not allow to throw exceptions out of structured blocks, associated with the OpenMP regions Differential Revision: http://reviews.llvm.org/D7935"
This reverts commit r231752.

It was failing to link with cmake:

lib64/libclangCodeGen.a(CGOpenMPRuntime.cpp.o):/home/espindola/llvm/llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:function clang::CodeGen::InlinedOpenMPRegionRAII::~InlinedOpenMPRegionRAII(): error: undefined reference to 'clang::CodeGen::EHScopeStack::popTerminate()'
clang-3.7: error: linker command failed with exit code 1 (use -v to see invocation)

llvm-svn: 231754
2015-03-10 04:40:21 +00:00
Alexey Bataev 7ab2cc178f [OPENMP] Improved code for generating debug info + generation of all OpenMP regions in termination scope
Patch adds proper generation of debug info for all OpenMP regions. Also, all OpenMP regions are generated in a termination scope, because standard does not allow to throw exceptions out of structured blocks, associated with the OpenMP regions
Differential Revision: http://reviews.llvm.org/D7935

llvm-svn: 231752
2015-03-10 04:22:11 +00:00
Richard Smith 202850a025 [modules] Don't bother looking up a declaration to merge into if we're not
actually loading a formerly-canonical declaration.

llvm-svn: 231742
2015-03-10 02:57:50 +00:00
Mehdi Amini b3d5209927 Update for LLVM API change: getOrEnforceKnownAlignment() requires a DataLayout
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 231739
2015-03-10 02:36:43 +00:00
Richard Smith 80969754b7 PR21687: when adding a redeclaration of a function with an implicit exception
specification, update all prior declarations if the new one has an explicit
exception specification and the prior ones don't.

Patch by Vassil Vassilev! Some minor tweaking and test case by me.

llvm-svn: 231738
2015-03-10 02:00:53 +00:00
Richard Smith f81340096d [modules] Don't clobber a destructor's operator delete when adding another one;
move the operator delete updating into a separate update record so we can cope
with updating another module's destructor's operator delete.

llvm-svn: 231735
2015-03-10 01:41:22 +00:00
Richard Smith 2708e52029 [modules] This check is run before we resolve the header, not after, so just
check that private headers are in a list matching the role. (We can't perform
the opposite checks for non-private headers because we infer those.)

llvm-svn: 231728
2015-03-10 00:19:04 +00:00
Richard Smith 00bc95ec9a [modules] Don't assert if the same header is named as both a public and a
private header within the same module.

llvm-svn: 231725
2015-03-09 23:46:50 +00:00
NAKAMURA Takumi f65421ad9f Suppress a couple of tests, clang/test/CodeGen/catch-undef-behavior.c and one, for -Asserts for now. They were introduced in r231711.
llvm-svn: 231717
2015-03-09 22:32:03 +00:00
Alexey Samsonov 21d2dda3d2 [UBSan] Split -fsanitize=shift into -fsanitize=shift-base and -fsanitize=shift-exponent.
This is a recommit of r231150, reverted in r231409. Turns out
that -fsanitize=shift-base check implementation only works if the
shift exponent is valid, otherwise it contains undefined behavior
itself.

Make sure we check that exponent is valid before we proceed to
check the base. Make sure that we actually report invalid values
of base or exponent if -fsanitize=shift-base or
-fsanitize=shift-exponent is specified, respectively.

llvm-svn: 231711
2015-03-09 21:50:19 +00:00
Tim Northover d157e19562 ARM: use ABI-specified alignment for byval parameters.
When passing a type with large alignment byval, we were specifying the type's
alignment rather than the alignment that the backend is actually capable of
producing (ABIAlign).

This would be OK (if odd) assuming the backend dealt with it prooperly,
unfortunately it doesn't and trying to pass types with "byval align 16" can
cause it to set fp incorrectly and trash the stack during the prologue. I'll be
fixing that in a separate patch, but Clang should still be emitting IR that's
as close to its intent as possible.

rdar://20059039

llvm-svn: 231706
2015-03-09 21:40:42 +00:00
Fariborz Jahanian 29dec576e6 [PATCH Sema Objective-C]. Patch to warn on missing designated initializer
override where at least a declaration of a designated initializer is in a super
class and not necessarily in the current class. rdar://19653785.

llvm-svn: 231700
2015-03-09 20:39:51 +00:00
Benjamin Kramer 82f6e433ac Roll functions back into namespaces, msvc has problems with name lookup outside of it.
llvm-svn: 231671
2015-03-09 17:00:48 +00:00
Alexander Kornienko 85fb1be610 Correct doxygen for matcher macros that require a body. NFC.
http://reviews.llvm.org/D8146

Patch by Richard Thomson!

llvm-svn: 231670
2015-03-09 16:57:49 +00:00
Benjamin Kramer 8407df72a3 Make helper functions static. NFC.
Found by -Wmissing-prototypes.

llvm-svn: 231668
2015-03-09 16:47:52 +00:00
Benjamin Kramer 3a7434582d Make helper functions static
NFC.

llvm-svn: 231657
2015-03-09 15:03:32 +00:00
Benjamin Kramer 6a1457e6c1 Tooling: Hide implementation details
NFC.

llvm-svn: 231656
2015-03-09 15:03:26 +00:00
Benjamin Kramer 6afa168e31 InheritViz: Hide implementation details
NFC.

llvm-svn: 231655
2015-03-09 15:03:20 +00:00
Benjamin Kramer 66a97ee957 Hide away implementation details of the ThreadSafetyAnalysis in anonymous namespaces
NFC.

llvm-svn: 231653
2015-03-09 14:19:54 +00:00
Sylvestre Ledru b062fd587d Fix a menu issue. patch by Vassil Vassilev
llvm-svn: 231637
2015-03-09 09:09:55 +00:00
Daniel Jasper ac5c97e36b clang-format: Don't remove newline if macro ends in access specifier.
I.e.:

  #define A public:

  // The new line before this line would be removed.
  int a;

llvm-svn: 231636
2015-03-09 08:13:55 +00:00
Nico Weber eb0cfb5ab0 Warn when jumping out of a __finally block via goto.
This only warns on direct gotos and indirect gotos with a unique label
(`goto *&&label;`).  Jumping out ith a true indirect goto is already an error.

This isn't O(1), but goto statements are less common than continue, break, and
return.  Also, the GetDeepestCommonScope() call in the same function does the
same amount of work, so this isn't worse than what's there in a complexity
sense, and it should be pretty fast in practice.

This is the last piece that was missing in r231623.   

llvm-svn: 231628
2015-03-09 04:27:56 +00:00
Nico Weber ce90329824 Fix a theoretical bug when ParseCompoundStatement() returns StmtError.
ParseCompoundStatement() currently never returns StmtError, but if it did,
Sema would keep the __finally scope on its stack indefinitely.  Explicitly
add an error callback that clears it.

llvm-svn: 231625
2015-03-09 03:17:15 +00:00
Nico Weber d64657f298 Warn when jumping out of a __finally block via continue, break, return, __leave.
Since continue, break, return are much more common than __finally, this tries
to keep the work for continue, break, return O(1).  Sema keeps a stack of active
__finally scopes (to do this, ActOnSEHFinally() is split into
ActOnStartSEHFinally() and ActOnFinishSEHFinally()), and the various jump
statements then check if the current __finally scope (if present) is deeper
than then destination scope of the jump.

The same warning for goto statements is still missing.

This is the moral equivalent of MSVC's C4532.

llvm-svn: 231623
2015-03-09 02:47:59 +00:00
Nico Weber 9af63b22a5 Fix typo in comment.
llvm-svn: 231622
2015-03-09 02:34:29 +00:00
Nico Weber 620660cfde Wrap to 80 columns. No behavior change.
llvm-svn: 231621
2015-03-09 02:33:32 +00:00
David Blaikie 7a3cbb2997 Simplify boolean expressions in clang with clang-tidy
Patch by Richard (legalize at xmission dot com).

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

llvm-svn: 231619
2015-03-09 02:02:07 +00:00
Benjamin Kramer 3162f29fcd Properly initialize the parser_crash debug token.
Found by msan.

llvm-svn: 231605
2015-03-08 19:28:24 +00:00
Benjamin Kramer 72b7d3ed4b Fix the MSVC build.
Type traits are hard.

llvm-svn: 231604
2015-03-08 18:20:22 +00:00
Benjamin Kramer d503c1c531 Make Token a real POD type.
We copy them around a lot and skip construction in favor of startToken,
make the default construction trivial to reflect that.

llvm-svn: 231603
2015-03-08 18:11:59 +00:00
Benjamin Kramer 28b45ce151 Make constant static variables const so they can go into a read-only section
NFC.

llvm-svn: 231597
2015-03-08 16:06:46 +00:00
Argyrios Kyrtzidis 69e6f1f257 [Rewrite] Make RewriteBuffer accessible on its own, and add a unit test for it.
llvm-svn: 231588
2015-03-08 04:00:33 +00:00