Commit Graph

57621 Commits

Author SHA1 Message Date
Fariborz Jahanian d436b2a4ce [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

llvm-svn: 234328
2015-04-07 16:56:27 +00:00
Duncan P. N. Exon Smith ebad0aa3ba 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.

llvm-svn: 234327
2015-04-07 16:50:49 +00:00
Daniel Jasper 53395406da clang-format: Fix regression formatting QT's "signals:" from r234318.
llvm-svn: 234320
2015-04-07 15:04:40 +00:00
Daniel Jasper 676e516354 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;
  };

llvm-svn: 234318
2015-04-07 14:36:33 +00:00
Timur Iskhodzhanov 90639edd3d 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)'

llvm-svn: 234308
2015-04-07 11:26:00 +00:00
Daniel Jasper 303c3ac925 Revert "[SEH] Implement filter capturing in CodeGen"
Test fails:
http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/3182/

llvm-svn: 234306
2015-04-07 10:07:47 +00:00
Daniel Jasper acf67e3ecd 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);

llvm-svn: 234304
2015-04-07 08:20:35 +00:00
Daniel Jasper 9dedc775d7 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.

llvm-svn: 234300
2015-04-07 06:41:24 +00:00
David Majnemer 06864814e5 [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.

llvm-svn: 234297
2015-04-07 06:01:53 +00:00
Duncan P. N. Exon Smith a98fac64ea DebugInfo: Update for LLVM change in r234290
The API for `DIArray` changed; use the new one.

llvm-svn: 234291
2015-04-07 04:14:45 +00:00
David Majnemer 26a1e0ef76 [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

llvm-svn: 234280
2015-04-07 02:37:09 +00:00
Bob Wilson 433cb315d3 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

llvm-svn: 234270
2015-04-07 01:03:35 +00:00
Reid Kleckner 67cf035a99 [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.

llvm-svn: 234264
2015-04-07 00:09:59 +00:00
Reid Kleckner 0ada50f17f [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

llvm-svn: 234261
2015-04-06 23:51:44 +00:00
Duncan P. N. Exon Smith c755128673 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.

llvm-svn: 234256
2015-04-06 23:21:33 +00:00
Duncan P. N. Exon Smith ee55fac1d4 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.

llvm-svn: 234245
2015-04-06 22:04:18 +00:00
James Dennett fa24549492 Fix a call to std::unique to actually discard the trailing (junk) elements.
Found by inspection.  (No other instances of this problem were found.)

llvm-svn: 234221
2015-04-06 21:09:24 +00:00
Benjamin Kramer 040725723e 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.

llvm-svn: 234202
2015-04-06 20:01:49 +00:00
Benjamin Kramer c7dd599e9d Prefer uninitialized memory for scratch space.
No functional change intended.

llvm-svn: 234184
2015-04-06 17:45:11 +00:00
Fariborz Jahanian 220d08d942 [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

llvm-svn: 234176
2015-04-06 16:56:39 +00:00
David Blaikie 981d2a04b7 Fix this test so it doesn't try to open a file to write to the source tree
llvm-svn: 234173
2015-04-06 16:33:18 +00:00
Aaron Ballman 82a2202ae6 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.
llvm-svn: 234170
2015-04-06 16:10:32 +00:00
Michael Kuperstein aed5ccdeed HasSideEffects() should return false for calls to pure and const functions.
Differential Revision: http://reviews.llvm.org/D8548

llvm-svn: 234152
2015-04-06 13:22:01 +00:00
Benjamin Kramer 1a8fa8b431 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.

llvm-svn: 234149
2015-04-06 12:30:43 +00:00
NAKAMURA Takumi a01846de2a clang/test/Profile/profile-does-not-exist.c: Avoid checking a message line in the message catalog.
llvm-svn: 234146
2015-04-06 08:16:36 +00:00
Rafael Espindola 298059a4ac 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.

llvm-svn: 234143
2015-04-06 04:36:45 +00:00
Nico Weber 176efac95b Don't crash when passing a non-existent file to -fprofile-instr-use=.
Fixes a regression from r229434.

llvm-svn: 234141
2015-04-06 04:16:48 +00:00
David Blaikie 2e80428dc5 clang-format my last commit
(sorry, keep forgetting that)

llvm-svn: 234129
2015-04-05 22:47:07 +00:00
David Blaikie 1ed728c499 [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.

llvm-svn: 234128
2015-04-05 22:45:47 +00:00
Benjamin Kramer 67e6a5499c Replace copy loop with std::copy.
No functional change intended.

llvm-svn: 234123
2015-04-05 18:55:02 +00:00
David Majnemer 9c2ad31abf 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.

llvm-svn: 234111
2015-04-05 05:42:02 +00:00
David Majnemer 314b72f842 [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.

llvm-svn: 234110
2015-04-05 05:32:54 +00:00
David Blaikie 17ea266bac [opaque pointer type] More GEP API migrations
llvm-svn: 234109
2015-04-04 21:07:17 +00:00
Rafael Espindola d7329ef99f 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.

llvm-svn: 234104
2015-04-04 19:32:41 +00:00
Rafael Espindola 321fabfd8e 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.

llvm-svn: 234101
2015-04-04 18:21:14 +00:00
David Blaikie fb901c7abf [opaque pointer type] more GEP API migrations
llvm-svn: 234097
2015-04-04 15:12:29 +00:00
Sanjay Patel a932bb93b0 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

llvm-svn: 234093
2015-04-04 14:54:24 +00:00
Daniel Jasper 739ec534d2 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();
    }
  };

llvm-svn: 234091
2015-04-04 07:56:55 +00:00
David Majnemer f205f5324b [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.

llvm-svn: 234090
2015-04-04 05:37:48 +00:00
Eric Christopher 269c2a29ef Complete comment. Reflow conditional.
llvm-svn: 234083
2015-04-04 03:34:43 +00:00
David Blaikie 5e259a8c6d [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.

llvm-svn: 234063
2015-04-03 22:54:16 +00:00
Daniel Jasper 1662bfe077 clang-format: [Proto] No alternate operator names.
llvm-svn: 234055
2015-04-03 21:15:46 +00:00
Manman Ren 2738278b7f [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

llvm-svn: 234033
2015-04-03 18:10:29 +00:00
David Blaikie 6b2a8306a5 [opaque pointer type] Explicitly specify type to CreateGEP
llvm-svn: 234032
2015-04-03 17:47:16 +00:00
Eric Christopher c168ef4b5f Make this test not rely on a backend being registered.
llvm-svn: 233993
2015-04-03 01:27:02 +00:00
Sean Callanan 72fe0852fd Added support for attributed types to the ASTImporter.
<rdar://problem/20403544>

llvm-svn: 233985
2015-04-02 23:50:08 +00:00
Eric Christopher d05ba3aae3 Add a question mark to the end of an interrogatory warning.
llvm-svn: 233982
2015-04-02 22:30:23 +00:00
Eric Christopher 6e11073b3e Unify warnings/errors from "maybe you meant" to "did you mean".
llvm-svn: 233981
2015-04-02 22:10:06 +00:00
Reid Kleckner 85368fb32d Correct typos in SEH filter expressions
Otherwise we assert due to uncorrected delayed typos.

llvm-svn: 233980
2015-04-02 22:09:32 +00:00
Fariborz Jahanian e1b9843375 [Objective-C SDK modernizer]. Patch to convert setter/getter
methods in protocols to their respective property
declarations. rdar://19372798

llvm-svn: 233977
2015-04-02 21:36:03 +00:00