]> granicus.if.org Git - clang/log
clang
9 years agoRemove redundant virtual on member functions marked 'override'.
David Blaikie [Wed, 8 Apr 2015 17:01:55 +0000 (17:01 +0000)]
Remove redundant virtual on member functions marked 'override'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234417 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[OPENMP] Allow redeclaration of variables as threadprivate.
Alexey Bataev [Wed, 8 Apr 2015 12:45:41 +0000 (12:45 +0000)]
[OPENMP] Allow redeclaration of variables as threadprivate.

No need to emit an error message if the variable is redeclared as threadprivate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234402 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAppease build bots that cannot find a viable conversion through CanQualType.
Aaron Ballman [Wed, 8 Apr 2015 00:13:33 +0000 (00:13 +0000)]
Appease build bots that cannot find a viable conversion through CanQualType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234376 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoGenerate a diagnostic when a catch handler cannot execute due to class hierarchy...
Aaron Ballman [Wed, 8 Apr 2015 00:05:29 +0000 (00:05 +0000)]
Generate a diagnostic when a catch handler cannot execute due to class hierarchy inversion with regards to other catch handlers for the same block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234375 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse the most recent previous decl to check if inline is added after a definition
Reid Kleckner [Wed, 8 Apr 2015 00:04:47 +0000 (00:04 +0000)]
Use the most recent previous decl to check if inline is added after a definition

This affects this test case:
  void foo();
  template <typename T> class C {
    friend inline void foo();
  };
  inline void foo() {}
  C<int> c;

Here, we instantiate the foo friend decl and add it to foo's redecl
chain. However, our previous decl pointer happens to reference the first
declaration of foo, which is not marked inline. When we check to see if
foo was already defined, we implicitly search all previous decls. We
should do the same for the inline check, instead of just checking this
particular previous decl.

Reviewers: rsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234374 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Sema] Correctly recurse when looking for [*] in function definitions
David Majnemer [Tue, 7 Apr 2015 22:08:51 +0000 (22:08 +0000)]
[Sema] Correctly recurse when looking for [*] in function definitions

A [*] is only allowed in a declaration for a function, not in its
definition.  We didn't correctly recurse while looking for it, causing
us to crash in CodeGen instead of rejecting it.

This fixes PR23151.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234363 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "Mark instantiated function decls as inline specified if any pattern is"
Reid Kleckner [Tue, 7 Apr 2015 20:46:51 +0000 (20:46 +0000)]
Revert "Mark instantiated function decls as inline specified if any pattern is"

It breaks down on this test case:
  void foo();
  template <typename T> class C {
    friend void foo();
  };
  inline void foo() {}
  C<int> c;

We shouldn't be marking the instantiation of the friend decl of foo as
inline-specified. It may be possible to fix this by determining if the
full definition is part of the current template, but it seems better to
rever tot green until we come up with a full solution.

This reverts commit r233817, as well as follow-ups r233820 and r233821.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234355 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "Fix a compiler error under MSVC"
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 18:41:26 +0000 (18:41 +0000)]
Revert "Fix a compiler error under MSVC"

This reverts the bandaid commit in r234308 now that I have a proper fix
in LLVM as of r234326.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234339 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agofix typo; NFC
Sanjay Patel [Tue, 7 Apr 2015 18:39:20 +0000 (18:39 +0000)]
fix typo; NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234338 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Objective-C Sema] Patch to not issue unavailbility/deprecated
Fariborz Jahanian [Tue, 7 Apr 2015 16:56:27 +0000 (16:56 +0000)]
[Objective-C Sema] Patch to not issue unavailbility/deprecated
warning when multiple method declarations are found in global pool
with differing types and some are available.
rdar://20408445

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234328 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: LLVM API change in r234326 for array-like tuple wrappers
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 16:50:49 +0000 (16:50 +0000)]
DebugInfo: LLVM API change in r234326 for array-like tuple wrappers

Update a few calls to `DIBuilder` now that `MDTuple` array-wrappers
don't have implicit conversions to `MDTuple*`.  I may circle back and
update `DIBuilder` to take arrays here, to make it easier for the
callers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234327 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Fix regression formatting QT's "signals:" from r234318.
Daniel Jasper [Tue, 7 Apr 2015 15:04:40 +0000 (15:04 +0000)]
clang-format: Fix regression formatting QT's "signals:" from r234318.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234320 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Don't allow labels when expecting declarations.
Daniel Jasper [Tue, 7 Apr 2015 14:36:33 +0000 (14:36 +0000)]
clang-format: Don't allow labels when expecting declarations.

This fixes formatting unnamed bitfields (llvm.org/PR21999).

Before:
  struct MyStruct {
    uchar data;
  uchar:
    8;
  uchar:
    8;
    uchar other;
  };

After:
  struct MyStruct {
    uchar data;
    uchar : 8;
    uchar : 8;
    uchar other;
  };

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234318 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix a compiler error under MSVC
Timur Iskhodzhanov [Tue, 7 Apr 2015 11:26:00 +0000 (11:26 +0000)]
Fix a compiler error under MSVC

Error message was:
CGDebugInfo.cpp(1047) : error C2666: 'llvm::MDTypeRefArray::operator []' : 2 overloads have similar conversions
  DebugInfoMetadata.h(106): could be 'llvm::MDTypeRef llvm::MDTypeRefArray::operator [](unsigned int) const'
  while trying to match the argument list '(llvm::DITypeArray, int)'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234308 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "[SEH] Implement filter capturing in CodeGen"
Daniel Jasper [Tue, 7 Apr 2015 10:07:47 +0000 (10:07 +0000)]
Revert "[SEH] Implement filter capturing in CodeGen"

Test fails:
http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/3182/

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234306 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Improve nested block formatting.
Daniel Jasper [Tue, 7 Apr 2015 08:20:35 +0000 (08:20 +0000)]
clang-format: Improve nested block formatting.

Before:
  functionA(functionB({
    int i;
    int j;
  }),
            aaaa, bbbb, cccc);

After:
  functionA(functionB({
              int i;
              int j;
            }),
            aaaa, bbbb, cccc);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234304 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Indent relative to the ./-> and not the function name.
Daniel Jasper [Tue, 7 Apr 2015 06:41:24 +0000 (06:41 +0000)]
clang-format: Indent relative to the ./-> and not the function name.

Before:
  aaaaaaaaaaa     //
      .aaaa(      //
           bbbb)  // This is different ..
      .aaaa(      //
          cccc);  // .. from this.

After:
  aaaaaaaaaaa     //
      .aaaa(      //
          bbbb)   // This is identical ..
      .aaaa(      //
          cccc);  // .. to this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234300 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Sema] Don't crash when __attribute__((nonnull)) is applied to blocks
David Majnemer [Tue, 7 Apr 2015 06:01:53 +0000 (06:01 +0000)]
[Sema] Don't crash when __attribute__((nonnull)) is applied to blocks

A simple case of asserting isFunctionOrMethod when we should have
asserted isFunctionOrMethodOrBlock.

This fixes PR23117.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234297 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Update for LLVM change in r234290
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 04:14:45 +0000 (04:14 +0000)]
DebugInfo: Update for LLVM change in r234290

The API for `DIArray` changed; use the new one.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234291 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Sema] Don't permit dependent alignments on non-dependent typedef-names
David Majnemer [Tue, 7 Apr 2015 02:37:09 +0000 (02:37 +0000)]
[Sema] Don't permit dependent alignments on non-dependent typedef-names

A dependent alignment attribute (like __attribute__((aligned(...))) or
__declspec(align(...))) on a non-dependent typedef or using declaration
poses a considerable challenge: the type is _not_ dependent, the size
_may_ be dependent if the type is used as an array type, the alignment
_is_ dependent.

It is reasonable for a compiler to be able to query the size and
alignment of a complete type.  Let's help that become an invariant.

This fixes PR22042.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234280 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReport an error when -m<os>-version-min= does not specify a version.
Bob Wilson [Tue, 7 Apr 2015 01:03:35 +0000 (01:03 +0000)]
Report an error when -m<os>-version-min= does not specify a version.

Currently if you use -mmacosx-version-min or -mios-version-min without
specifying a version number, clang silently sets the minimum version to
"0.0.0". This is almost certainly not what was intended, so it is better
to report it as an error. rdar://problem/20433945

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234270 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[WinEH] Don't create an alloca for unnamed catch parameters
Reid Kleckner [Tue, 7 Apr 2015 00:09:59 +0000 (00:09 +0000)]
[WinEH] Don't create an alloca for unnamed catch parameters

The catch object parameter to llvm.eh.begincatch is optional, and can be
null. We can save some ourselves the stack space, copy ctor, and dtor
calls if we pass null.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234264 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SEH] Implement filter capturing in CodeGen
Reid Kleckner [Mon, 6 Apr 2015 23:51:44 +0000 (23:51 +0000)]
[SEH] Implement filter capturing in CodeGen

While capturing filters aren't very common, we'd like to outline
__finally blocks in the frontend to simplify -O0 EH preparation and
reduce code size. Finally blocks are usually have captures, and this is
the first step towards that.

Currently we don't support capturing 'this' or VLAs.

Reviewers: majnemer

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234261 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCGDebugInfo: Stop using DIDescriptor::is*() and auto-casting
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 23:21:33 +0000 (23:21 +0000)]
CGDebugInfo: Stop using DIDescriptor::is*() and auto-casting

The clang edition of r234255: use built-in `isa<>`, `dyn_cast<>`, etc.,
and only build `DIDescriptor`s from pointers that are correctly typed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234256 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Use DILexicalBlockFile::getContext() over getScope()
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 22:04:18 +0000 (22:04 +0000)]
DebugInfo: Use DILexicalBlockFile::getContext() over getScope()

`getScope()` passes the scope back through a `DILexicalBlock` even
though the underlying pointer may be an incompatible `MDSubprogram`.
Just use `getContext()` directly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234245 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix a call to std::unique to actually discard the trailing (junk) elements.
James Dennett [Mon, 6 Apr 2015 21:09:24 +0000 (21:09 +0000)]
Fix a call to std::unique to actually discard the trailing (junk) elements.

Found by inspection.  (No other instances of this problem were found.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234221 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMSan told me that we actually dump the entire scratch buffer into PCH files, initiali...
Benjamin Kramer [Mon, 6 Apr 2015 20:01:49 +0000 (20:01 +0000)]
MSan told me that we actually dump the entire scratch buffer into PCH files, initialize it.

Writing 4k of zeros is preferrable to 4k of random memory. Document that. While
there remove the initialization of the first byte of the buffer and start at
index zero. It was writing a literal '0' instead of a null byte at the
beginning anyways, which didn't matter since we never read it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234202 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPrefer uninitialized memory for scratch space.
Benjamin Kramer [Mon, 6 Apr 2015 17:45:11 +0000 (17:45 +0000)]
Prefer uninitialized memory for scratch space.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234184 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Objective-C patch] Patch to fix a crash in IRGen because
Fariborz Jahanian [Mon, 6 Apr 2015 16:56:39 +0000 (16:56 +0000)]
[Objective-C patch] Patch to fix a crash in IRGen because
of incorrect AST when a compound literal of Objective-C
property access is used to initialize a vertor of floats.
rdar://20407999

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234176 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix this test so it doesn't try to open a file to write to the source tree
David Blaikie [Mon, 6 Apr 2015 16:33:18 +0000 (16:33 +0000)]
Fix this test so it doesn't try to open a file to write to the source tree

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234173 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoGating clang-fuzzer on the same conditions required to build the LLVMFuzzer library...
Aaron Ballman [Mon, 6 Apr 2015 16:10:32 +0000 (16:10 +0000)]
Gating clang-fuzzer on the same conditions required to build the LLVMFuzzer library. Otherwise, we can run into a situation where clang-fuzzer attempts to build, but its dependency was never built.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234170 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoHasSideEffects() should return false for calls to pure and const functions.
Michael Kuperstein [Mon, 6 Apr 2015 13:22:01 +0000 (13:22 +0000)]
HasSideEffects() should return false for calls to pure and const functions.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234152 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate our list of distros a bit.
Benjamin Kramer [Mon, 6 Apr 2015 12:30:43 +0000 (12:30 +0000)]
Update our list of distros a bit.

- Debian jessie will be released this month, add the next testing version to the list.
- RHEL7 was released last june.
- Ubuntu utopic was released last october, vivid will follow later this month.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234149 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang/test/Profile/profile-does-not-exist.c: Avoid checking a message line in the...
NAKAMURA Takumi [Mon, 6 Apr 2015 08:16:36 +0000 (08:16 +0000)]
clang/test/Profile/profile-does-not-exist.c: Avoid checking a message line in the message catalog.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234146 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoThis reverts commit r234104, bringing back 233393 now that ARM is fixed.
Rafael Espindola [Mon, 6 Apr 2015 04:36:45 +0000 (04:36 +0000)]
This reverts commit r234104, bringing back  233393 now that ARM is fixed.

Original message:

Don't use unique section names by default if using the integrated as.

This saves some IO and ccache space by not creating long section names. It
should work with every ELF linker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234143 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't crash when passing a non-existent file to -fprofile-instr-use=.
Nico Weber [Mon, 6 Apr 2015 04:16:48 +0000 (04:16 +0000)]
Don't crash when passing a non-existent file to -fprofile-instr-use=.

Fixes a regression from r229434.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234141 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format my last commit
David Blaikie [Sun, 5 Apr 2015 22:47:07 +0000 (22:47 +0000)]
clang-format my last commit

(sorry, keep forgetting that)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234129 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[opaque pointer type] More GEP API migrations
David Blaikie [Sun, 5 Apr 2015 22:45:47 +0000 (22:45 +0000)]
[opaque pointer type] More GEP API migrations

Looks like the VTable code in particular will need some work to pass
around the pointee type explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234128 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReplace copy loop with std::copy.
Benjamin Kramer [Sun, 5 Apr 2015 18:55:02 +0000 (18:55 +0000)]
Replace copy loop with std::copy.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234123 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSwitch test from wchar_t to char32_t
David Majnemer [Sun, 5 Apr 2015 05:42:02 +0000 (05:42 +0000)]
Switch test from wchar_t to char32_t

Windows has a 16-bit wchar_t, most Unix platforms have a 32-bit wchar_t.
Use a char32_t to keep the test's output stable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234111 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[AST] String literal operator templates have two template args, not one
David Majnemer [Sun, 5 Apr 2015 05:32:54 +0000 (05:32 +0000)]
[AST] String literal operator templates have two template args, not one

StmtPrinter assumed that the first template arg was the pack and
attempted to iterate it.  However, the GNU extension (which is really
just N3599), has two template arguments.  In this case, the second
argument is the pack containing the string contents.

Handle this by desugaring the call to the explicit operator.

For example:
"qux" _zombocom will be shown as
operator "" _zombocom<char, 'q', 'u', 'x'>() in diagnostics and AST
dumps.

N.B.  It is actually impossible to render the arguments back to the
source form without storing more information in the AST.  For example,
we cannot tell if the user wrote u8"qux" or "qux".  We also lose
fidelity when it comes to non-char types for this exact reason (e.g. it
is hard to render a list of wchar_t back to something that can be
printed to the screen even if you don't have to consider surrogate
pairs).

This fixes PR23120.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234110 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[opaque pointer type] More GEP API migrations
David Blaikie [Sat, 4 Apr 2015 21:07:17 +0000 (21:07 +0000)]
[opaque pointer type] More GEP API migrations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234109 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "Revert "Revert "Don't use unique section names by default if using the integr...
Rafael Espindola [Sat, 4 Apr 2015 19:32:41 +0000 (19:32 +0000)]
Revert "Revert "Revert "Don't use unique section names by default if using the integrated as."""

This reverts commit r234101. I will debug what went wrong with ARM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234104 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "Revert "Don't use unique section names by default if using the integrated...
Rafael Espindola [Sat, 4 Apr 2015 18:21:14 +0000 (18:21 +0000)]
Revert "Revert "Don't use unique section names by default if using the integrated as.""

This reverts commit r233398, bringing back 233393 now that LLVM is fixed.

Original message:

Don't use unique section names by default if using the integrated as.

This saves some IO and ccache space by not creating long section names. It
should work with every ELF linker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234101 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[opaque pointer type] more GEP API migrations
David Blaikie [Sat, 4 Apr 2015 15:12:29 +0000 (15:12 +0000)]
[opaque pointer type] more GEP API migrations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234097 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove the cl-no-signed-zeros cc1 option
Sanjay Patel [Sat, 4 Apr 2015 14:54:24 +0000 (14:54 +0000)]
Remove the cl-no-signed-zeros cc1 option

Use the driver flag -fno-signed-zeros instead.

This was recommended but not implemented in D6873:
http://reviews.llvm.org/D6873

which was checked in at r226915:
http://reviews.llvm.org/rL226915

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234093 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [JS] Understand object literals with only methods.
Daniel Jasper [Sat, 4 Apr 2015 07:56:55 +0000 (07:56 +0000)]
clang-format: [JS] Understand object literals with only methods.

Before:
  let theObject = {someMethodName() {
    doTheThing();
    doTheOtherThing();
  },
                   someOtherMethodName() {
                     doSomething();
                     doSomethingElse();
                   }};

After:
  let theObject = {
    someMethodName() {
      doTheThing();
      doTheOtherThing();
    },
    someOtherMethodName() {
      doSomething();
      doSomethingElse();
    }
  };

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234091 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MS ABI] A pointer-to-function cannot be caught as a pointer-to-void
David Majnemer [Sat, 4 Apr 2015 05:37:48 +0000 (05:37 +0000)]
[MS ABI] A pointer-to-function cannot be caught as a pointer-to-void

Don't assume that all pointers are convertible to void pointer.
Instead correctly respect [conv.ptr]p2; only allow pointer types with an
object pointee type to be caught as pointer-to-void.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234090 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoComplete comment. Reflow conditional.
Eric Christopher [Sat, 4 Apr 2015 03:34:43 +0000 (03:34 +0000)]
Complete comment. Reflow conditional.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234083 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[opaque pointer type] Explicitly specify some types for GEP
David Blaikie [Fri, 3 Apr 2015 22:54:16 +0000 (22:54 +0000)]
[opaque pointer type] Explicitly specify some types for GEP

Not all of them (there's still a fallback for this specific function
that omits the type parameter) but it's some I bothered to do now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234063 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [Proto] No alternate operator names.
Daniel Jasper [Fri, 3 Apr 2015 21:15:46 +0000 (21:15 +0000)]
clang-format: [Proto] No alternate operator names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234055 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[i386 ABI] expand small C like structs in C++, just like how we handle small
Manman Ren [Fri, 3 Apr 2015 18:10:29 +0000 (18:10 +0000)]
[i386 ABI] expand small C like structs in C++, just like how we handle small
C structs.

This comes up when we have a function that takes a struct and is defined in a
C++ file and used in a C file.

Before this commit, we will generate byval for C++ and will expand the struct
for C, thus causing difference at IR level. We will use bitcast of function type
at the callsite, which causes the inliner to not inline the function.

This commit changes how we handle small C like structs at IR level, but at
backend, we should generate the same argument passing before and after the
commit.

Note that the condition for expanding is still over conservative. We should be
able to expand type that is spelled with “class” and types that are not C-like.
But this commit fixes the inconsistent argument passing between C/C++.

Reviewed by John.

rdar://20121030

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234033 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[opaque pointer type] Explicitly specify type to CreateGEP
David Blaikie [Fri, 3 Apr 2015 17:47:16 +0000 (17:47 +0000)]
[opaque pointer type] Explicitly specify type to CreateGEP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234032 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMake this test not rely on a backend being registered.
Eric Christopher [Fri, 3 Apr 2015 01:27:02 +0000 (01:27 +0000)]
Make this test not rely on a backend being registered.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233993 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdded support for attributed types to the ASTImporter.
Sean Callanan [Thu, 2 Apr 2015 23:50:08 +0000 (23:50 +0000)]
Added support for attributed types to the ASTImporter.

<rdar://problem/20403544>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233985 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd a question mark to the end of an interrogatory warning.
Eric Christopher [Thu, 2 Apr 2015 22:30:23 +0000 (22:30 +0000)]
Add a question mark to the end of an interrogatory warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233982 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUnify warnings/errors from "maybe you meant" to "did you mean".
Eric Christopher [Thu, 2 Apr 2015 22:10:06 +0000 (22:10 +0000)]
Unify warnings/errors from "maybe you meant" to "did you mean".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233981 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCorrect typos in SEH filter expressions
Reid Kleckner [Thu, 2 Apr 2015 22:09:32 +0000 (22:09 +0000)]
Correct typos in SEH filter expressions

Otherwise we assert due to uncorrected delayed typos.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233980 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Objective-C SDK modernizer]. Patch to convert setter/getter
Fariborz Jahanian [Thu, 2 Apr 2015 21:36:03 +0000 (21:36 +0000)]
[Objective-C SDK modernizer]. Patch to convert setter/getter
methods in protocols to their respective property
declarations. rdar://19372798

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233977 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[opaque pointer type] Update for GEP API changes in LLVM
David Blaikie [Thu, 2 Apr 2015 18:55:21 +0000 (18:55 +0000)]
[opaque pointer type] Update for GEP API changes in LLVM

Now the GEP constant utility functions require the type to be explicitly
passed (since eventually the pointer type will be opaque and not convey
the required type information). For now callers can still pass nullptr
(though none were needed here in Clang, which is nice) if
convenienc/necessary, but eventually that will be disallowed as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233937 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[AST] Shrink the Stmt hierarchy with LLVM_PTR_SIZE for MSVC 2013
Reid Kleckner [Thu, 2 Apr 2015 18:02:39 +0000 (18:02 +0000)]
[AST] Shrink the Stmt hierarchy with LLVM_PTR_SIZE for MSVC 2013

Follow-up to r233921 that removes the 'void *Aligner' Stmt union member
for MSVC 2013.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233932 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoLower the default alignment on ASTContext's operator new.
Benjamin Kramer [Thu, 2 Apr 2015 16:19:54 +0000 (16:19 +0000)]
Lower the default alignment on ASTContext's operator new.

It was documented as 8 and operator new[] defaults to 8, but the normal
operator new was never updated and happily wasted bytes on every other
allocation.

We still have to allocate all Types with 16 byte alignment, update the
allocation calls for Types that were missing explicit alignment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233922 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ast] Put the Stmt hierarchy on a diet for 64 bit targets.
Benjamin Kramer [Thu, 2 Apr 2015 15:29:07 +0000 (15:29 +0000)]
[ast] Put the Stmt hierarchy on a diet for 64 bit targets.

Previously we would waste 32 bits on alignment, use LLVM_ALIGNAS to
free that space for derived classes an place. Sadly still have to #ifdef
out MSVC 2013 because it can't align based on a sizeof expr.

No intended functionality change. New byte counts:
sizeof(before) | sizeof(after)

LabelStmt: 32 | LabelStmt: 24
SwitchStmt: 48 | SwitchStmt: 40
WhileStmt: 40 | WhileStmt: 32
DoStmt: 40 | DoStmt: 32
ForStmt: 64 | ForStmt: 56
ContinueStmt: 16 | ContinueStmt: 8
BreakStmt: 16 | BreakStmt: 8
ReturnStmt: 32 | ReturnStmt: 24
AsmStmt: 40 | AsmStmt: 32
GCCAsmStmt: 80 | GCCAsmStmt: 72
MSAsmStmt: 96 | MSAsmStmt: 88
SEHExceptStmt: 32 | SEHExceptStmt: 24
SEHFinallyStmt: 24 | SEHFinallyStmt: 16
SEHLeaveStmt: 16 | SEHLeaveStmt: 8
CapturedStmt: 32 | CapturedStmt: 24
CXXCatchStmt: 32 | CXXCatchStmt: 24
CXXForRangeStmt: 72 | CXXForRangeStmt: 64
ObjCAtFinallyStmt: 24 | ObjCAtFinallyStmt: 16
ObjCAtSynchronizedStmt: 32 | ObjCAtSynchronizedStmt: 24
ObjCAtThrowStmt: 24 | ObjCAtThrowStmt: 16
ObjCAutoreleasePoolStmt: 24 | ObjCAutoreleasePoolStmt: 16

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233921 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[utils] Add Check Compile Flow Consistency tool (check_cfc.py).
Russell Gallop [Thu, 2 Apr 2015 15:01:53 +0000 (15:01 +0000)]
[utils] Add Check Compile Flow Consistency tool (check_cfc.py).

This is a tool for checking consistency of code generation with different
compiler options (such as -g or outputting to .s). This tool has found a number
of code generation issues. The script acts as a wrapper to clang or clang++
performing 2 (or more) compiles then comparing the object files. Instructions
for use are in check_cfc.py including how to use with LNT.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233919 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[OPENMP] Fix crash on private variables not used in OpenMP region in templates.
Alexey Bataev [Thu, 2 Apr 2015 13:07:08 +0000 (13:07 +0000)]
[OPENMP] Fix crash on private variables not used in OpenMP region in templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233913 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPartially revert "Replace custom alignment enforcement with LLVM_ALIGNAS."
Benjamin Kramer [Thu, 2 Apr 2015 12:43:31 +0000 (12:43 +0000)]
Partially revert "Replace custom alignment enforcement with LLVM_ALIGNAS."

MSVC 2013 can't even parse __declspec(align(sizeof(foo))). We'll have to
wait until MSVC 2015 for this.

This partially reverts commit r233911.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233912 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReplace custom alignment enforcement with LLVM_ALIGNAS.
Benjamin Kramer [Thu, 2 Apr 2015 12:25:07 +0000 (12:25 +0000)]
Replace custom alignment enforcement with LLVM_ALIGNAS.

This isn't perfect as it still assumes sizeof(void*) == alignof(void*),
but we can fix that when compiler support gets better.

Shrinks some Stmts that happen to inherit from Stmt and have a
SourceLocation as the first member (64 bit archs only).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233911 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[OPENMP] Fix crash on private variables not used in OpenMP region.
Alexey Bataev [Thu, 2 Apr 2015 07:48:16 +0000 (07:48 +0000)]
[OPENMP] Fix crash on private variables not used in OpenMP region.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233902 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoImplement CFI type checks for non-virtual calls.
Peter Collingbourne [Thu, 2 Apr 2015 00:23:30 +0000 (00:23 +0000)]
Implement CFI type checks for non-virtual calls.

This uses the same class metadata currently used for virtual call and
cast checks.

The new flag is -fsanitize=cfi-nvcall. For consistency, the -fsanitize=cfi-vptr
flag has been renamed -fsanitize=cfi-vcall.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233874 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd test intended for commit in r231317
Reid Kleckner [Wed, 1 Apr 2015 23:32:03 +0000 (23:32 +0000)]
Add test intended for commit in r231317

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233866 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[UBSan] Embed UBSan into ASan runtime (Clang part).
Alexey Samsonov [Wed, 1 Apr 2015 22:42:25 +0000 (22:42 +0000)]
[UBSan] Embed UBSan into ASan runtime (Clang part).

Summary:
Change the way we use ASan and UBSan together. Instead of keeping two
separate runtimes (libclang_rt.asan and libclang_rt.ubsan), embed UBSan
into ASan and get rid of libclang_rt.ubsan. If UBSan is not supported on
a platform, all UBSan sources are just compiled into dummy empty object
files. UBSan initialization code (e.g. flag parsing) is directly called
from ASan initialization, so we are able to enforce correct
initialization order.

This mirrors the approach we already use for ASan+LSan. This change doesn't
modify the way we use standalone UBSan.

Test Plan: regression test suite

Reviewers: kubabrecka, zaks.anna, kcc, rsmith

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233860 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSet the type of ptrdiff_t to signed on NVPTX targets
Eli Bendersky [Wed, 1 Apr 2015 20:29:18 +0000 (20:29 +0000)]
Set the type of ptrdiff_t to signed on NVPTX targets

It was unsigned before, which is unlike any other target and also doesn't make
much sense.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233836 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRe-land "MS ABI: lambda call operators are instance methods and should use thiscall"
Reid Kleckner [Wed, 1 Apr 2015 20:22:13 +0000 (20:22 +0000)]
Re-land "MS ABI: lambda call operators are instance methods and should use thiscall"

Update the test cases to pass when lambda call operators use thiscall.

Update the lambda-to-block conversion operator to use the default free
function calling convention instead of the call operator's convention.

This reverts commit r233082 and re-instates r233023.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233835 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRun dos2unix on test/PCH/cxx1y-lambdas.mm
Reid Kleckner [Wed, 1 Apr 2015 20:21:34 +0000 (20:21 +0000)]
Run dos2unix on test/PCH/cxx1y-lambdas.mm

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233834 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMinor simplification: do typo-correction before handling inheriting
Richard Smith [Wed, 1 Apr 2015 19:31:06 +0000 (19:31 +0000)]
Minor simplification: do typo-correction before handling inheriting
constructors, instead of having the typo-correction code also dispatch to the
inheriting constructor special case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233833 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSet NVPTX64 target's size_t to match other 64-bit targets
Eli Bendersky [Wed, 1 Apr 2015 18:29:27 +0000 (18:29 +0000)]
Set NVPTX64 target's size_t to match other 64-bit targets

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233830 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix inlinehint.cpp with an explicit triple to avoid x86_thiscallcc problems
Reid Kleckner [Wed, 1 Apr 2015 16:48:54 +0000 (16:48 +0000)]
Fix inlinehint.cpp with an explicit triple to avoid x86_thiscallcc problems

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233821 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove comdats from inlinehint.cpp to pass test on Darwin
Reid Kleckner [Wed, 1 Apr 2015 16:45:17 +0000 (16:45 +0000)]
Remove comdats from inlinehint.cpp to pass test on Darwin

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233820 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix data layout mismatch between LLVM and Clang for i686-pc-windows-msvc-elf
Reid Kleckner [Wed, 1 Apr 2015 16:45:06 +0000 (16:45 +0000)]
Fix data layout mismatch between LLVM and Clang for i686-pc-windows-msvc-elf

Do the same thing as win64. If we're not using COFF, use the ELF
manglings. Maybe if we are targetting *-windows-msvc-macho, we should
use darwin manglings, but I don't need to stir that pot today.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233819 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTry to fix nacl-direct.c driver test in Cygwin environment
Reid Kleckner [Wed, 1 Apr 2015 16:27:07 +0000 (16:27 +0000)]
Try to fix nacl-direct.c driver test in Cygwin environment

Why is NaCl not using the integrated assembler, by the way?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233818 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMark instantiated function decls as inline specified if any pattern is
Reid Kleckner [Wed, 1 Apr 2015 16:23:44 +0000 (16:23 +0000)]
Mark instantiated function decls as inline specified if any pattern is

A function template pattern can be declared without the 'inline'
specifier and defined later with the 'inline' specifier. However, during
instantiation, we were only looking at the canonical decl to see if we
should mark the instantiated decl as inline specified. Since the
instantiated decl actually represents many pattern declarations, put the
inline specifier on the instantiation decl if any of the pattern decls
have it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233817 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SystemZ] Add BuiltinsSystemZ.def to Clang_Basic modulemap
Ulrich Weigand [Wed, 1 Apr 2015 15:34:53 +0000 (15:34 +0000)]
[SystemZ] Add BuiltinsSystemZ.def to Clang_Basic modulemap

This should fix the last remaining build bot failures
resulting from the r233804 commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233814 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SystemZ] Add header files to Makefile / module.modulemap
Ulrich Weigand [Wed, 1 Apr 2015 14:15:35 +0000 (14:15 +0000)]
[SystemZ] Add header files to Makefile / module.modulemap

This should fix build-bot failures after r233804.

The patch also adds a "systemz" feature, and renames the
"transactional-execution" feature to "htm", since it turns
out "-" is not a legal character in module feature names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233807 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SystemZ] Support transactional execution on zEC12
Ulrich Weigand [Wed, 1 Apr 2015 12:54:25 +0000 (12:54 +0000)]
[SystemZ] Support transactional execution on zEC12

The zEC12 provides the transactional-execution facility.  This is exposed
to users via a set of builtin routines on other compilers.  This patch
adds clang support to enable those builtins.  In partciular, the patch:

- enables the transactional-execution feature by default on zEC12
- allows to override presence of that feature via the -mhtm/-mno-htm options
- adds a predefined macro __HTM__ if the feature is enabled
- adds support for the transactional-execution GCC builtins
- adds Sema checking to verify the __builtin_tabort abort code
- adds the s390intrin.h header file (for GCC compatibility)
- adds s390 sections to the htmintrin.h and htmxlintrin.h header files

Since this is first use of target-specific intrinsics on the platform,
the patch creates the include/clang/Basic/BuiltinsSystemZ.def file and
hooks it up in TargetBuiltins.h and lib/Basic/Targets.cpp.

An associated LLVM patch adds the required LLVM IR intrinsics.

For reference, the transactional-execution instructions are documented
in the z/Architecture Principles of Operation for the zEC12:
http://publibfp.boulder.ibm.com/cgi-bin/bookmgr/download/DZ9ZR009.pdf
The associated builtins are documented in the GCC manual:
http://gcc.gnu.org/onlinedocs/gcc/S_002f390-System-z-Built-in-Functions.html
The htmxlintrin.h intrinsics provided for compatibility with the IBM XL
compiler are documented in the "z/OS XL C/C++ Programming Guide".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233804 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAVX-512: added clang intrinsics for logical and, or xor for 512 bits
Elena Demikhovsky [Wed, 1 Apr 2015 06:54:16 +0000 (06:54 +0000)]
AVX-512: added clang intrinsics for logical and, or xor for 512 bits
by Asaf Badouh (asaf.badouh@intel.com)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233794 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MS ABI] Disregard restrictive exception specifications
David Majnemer [Wed, 1 Apr 2015 04:45:52 +0000 (04:45 +0000)]
[MS ABI] Disregard restrictive exception specifications

MSVC treats all non-empty exception specifications the same way: all
exceptions are permitted.  The .xdata tables provide a way to
efficiently lower exception specifications *but* this probably has to be
implemented as a catch-all/rethrow mechanism instead of the Itanium way.

This fixes PR23092.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233787 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[OPENMP] Sema analysis for 'atomic capture' construct.
Alexey Bataev [Wed, 1 Apr 2015 03:33:17 +0000 (03:33 +0000)]
[OPENMP] Sema analysis for 'atomic capture' construct.

Added sema checks for forms of expressions/statements allowed under control of 'atomic capture' directive + generation of helper objects for future codegen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233785 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Objective-C metadata patch]. Patch to allocate one more space for
Fariborz Jahanian [Tue, 31 Mar 2015 22:22:40 +0000 (22:22 +0000)]
[Objective-C metadata patch]. Patch to allocate one more space for
Protocol objects in OBJC2. rdar://20286356

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233766 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix nacl's clang driver tests to tolerate libdir suffixes and Windows paths.
Derek Schuff [Tue, 31 Mar 2015 21:43:52 +0000 (21:43 +0000)]
Fix nacl's clang driver tests to tolerate libdir suffixes and Windows paths.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233764 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[lex] Bitfieldize some booleans.
Benjamin Kramer [Tue, 31 Mar 2015 18:47:05 +0000 (18:47 +0000)]
[lex] Bitfieldize some booleans.

Lets us fuse some branches into bit tests downstream. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233725 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd sm_37 target to Clang for NVPTX
Eli Bendersky [Tue, 31 Mar 2015 17:03:16 +0000 (17:03 +0000)]
Add sm_37 target to Clang for NVPTX

Support for this target was added in LLVM r233575 and r233583

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233715 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSema: Accept pointers to any address space for builtin functions
Tom Stellard [Tue, 31 Mar 2015 16:39:02 +0000 (16:39 +0000)]
Sema: Accept pointers to any address space for builtin functions

As long as they don't have an address space explicitly defined.

This allows builtins with pointer arguments to be used with OpenCL.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233706 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [JS] Support getters, setters and methods in object literals.
Daniel Jasper [Tue, 31 Mar 2015 14:34:15 +0000 (14:34 +0000)]
clang-format: [JS] Support getters, setters and methods in object literals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233698 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMake new test slightly more generic to allow running it under
Daniel Jasper [Tue, 31 Mar 2015 09:08:16 +0000 (09:08 +0000)]
Make new test slightly more generic to allow running it under
non-standard test runners.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233677 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Use getHostCPUFeatures when 'native' is specified for cpu.
Craig Topper [Tue, 31 Mar 2015 05:45:00 +0000 (05:45 +0000)]
[X86] Use getHostCPUFeatures when 'native' is specified for cpu.

This is necessary because not aall Sandybridge, Ivybrige, Haswell, and Broadwell CPUs support AVX. Currently we modify the CPU name back to Nehalem for this case, but that turns off additional features for these CPUs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233672 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate for llvm commit r233648.
Eric Christopher [Tue, 31 Mar 2015 00:10:23 +0000 (00:10 +0000)]
Update for llvm commit r233648.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233649 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Objective-C patch]. Amend TransformObjCMessageExpr to handle call
Fariborz Jahanian [Mon, 30 Mar 2015 23:30:24 +0000 (23:30 +0000)]
[Objective-C patch]. Amend TransformObjCMessageExpr to handle call
to 'super' of instance/class methods and not assert.
rdar://20350364

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233642 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd driver support for Native Client SDK
Derek Schuff [Mon, 30 Mar 2015 20:31:33 +0000 (20:31 +0000)]
Add driver support for Native Client SDK

Add Tool and ToolChain support for clang to target the NaCl OS using the NaCl
SDK for x86-32, x86-64 and ARM.

Includes nacltools::Assemble and Link which are derived from gnutools. They
are similar to Linux but different enought that they warrant their own class.
Also includes a NaCl_TC in ToolChains derived from Generic_ELF with library
and include paths suitable for an SDK and independent of the system tools.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233594 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[analyzer] Add test for previous commit.
Jordan Rose [Mon, 30 Mar 2015 20:18:04 +0000 (20:18 +0000)]
[analyzer] Add test for previous commit.

Again, this is being applied in a separate commit so that the previous commit
can be reverted while leaving the test in place.

rdar://problem/20335433

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233593 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[analyzer] Disable all retain count diagnostics on values that come from ivars.
Jordan Rose [Mon, 30 Mar 2015 20:18:00 +0000 (20:18 +0000)]
[analyzer] Disable all retain count diagnostics on values that come from ivars.

This is imitating a pre-r228174 state where ivars are not considered tracked by
default, but with the addition that even ivars /with/ retain count information
(e.g. "[_ivar retain]; [ivar _release];") are not being tracked as well. This is
to ensure that we don't regress on values accessed through both properties and
ivars, which is what r228174 was trying to fix.

The issue occurs in code like this:

  [_contentView retain];
  [_contentView removeFromSuperview];
  [self addSubview:_contentView]; // invalidates 'self'
  [_contentView release];

In this case, the call to -addSubview: may change the value of self->_contentView,
and so the analyzer can't be sure that we didn't leak the original _contentView.
This is a correct conservative view of the world, but not a useful one. Until we
have a heuristic that allows us to not consider this a leak, not emitting a
diagnostic is our best bet.

This commit disables all of the ivar-related retain count tests, but does not
remove them to ensure that we don't crash trying to evaluate either valid or
erroneous code. The next commit will add a new test for the example above so
that this commit (and the previous one) can be reverted wholesale when a better
solution is implemented.

Rest of rdar://problem/20335433

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233592 91177308-0d34-0410-b5e6-96231b3b80d8