Граф коммитов

35111 Коммитов

Автор SHA1 Сообщение Дата
NAKAMURA Takumi ee7a1981c6 CMake: install libclang.dll to $CMAKE_INSTALL_PREFIX/bin.
Patch by Joe Groff.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151448 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25 16:46:50 +00:00
Ahmed Charles 13a140caba ArrayRef'ize various functions in the AST/Parser/Sema.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151447 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25 11:00:22 +00:00
Richard Smith 5297d71e8c Accept __has_feature(__feature__) as a synonym for __has_feature(feature) (and
likewise for __has_extension). Patch by Jonathan Sauer!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151445 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25 10:41:10 +00:00
Richard Smith d390de9c63 Fix r151443 to only apply C++11's exception for non-static data member access
in cases where we would otherwise disallow the access, and add a -Wc++98-compat
diagnostic for this C++11 feature.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151444 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25 10:20:59 +00:00
Richard Smith 2c8aee454d PR11956: C++11's special exception for accessing non-static data members from
unevaluated operands applies within member functions, too.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151443 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25 10:04:07 +00:00
Richard Smith 7a9f49296a Fix assertion (too few Diag arguments) when diagnosing a deleted operator delete
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151442 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25 09:42:26 +00:00
Richard Smith dfefb840e3 Teach CXXRecordDecl::hasIrrelevantDestructor to check the base classes and
data members for deleted or user-provided destructors.

Now it's computed in advance, serialize it, and in passing fix all the other
record DefinitionData flags whose serialization was missing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151441 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25 07:33:38 +00:00
Richard Smith f5cd5cc9a7 Fix a regression from r151117: ADL requires that we attempt to complete any
associated classes, since it can find friend functions declared within them,
but overload resolution does not otherwise require argument types to be
complete.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151434 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25 06:24:24 +00:00
Chad Rosier 9875962295 Prevent llvm.lifetime intrinsics from being emitted at -O0.
rdar://10921594



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151430 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25 02:56:13 +00:00
Eli Friedman 64bee65a34 Work-in-progress for lambda conversion-to-block operator. Still need to implement the retain+autorelease outside of ARC, and there's a bug that causes the generated code to crash in ARC (which I think is unrelated to my code, although I'm not completely sure).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151428 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25 02:48:22 +00:00
Argyrios Kyrtzidis e1d4330ada Don't record nested macro expansions in the preprocessing record,
it can only bring pain when dealing with preprocessor abuse (see: boost).

rdar://10898986

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151427 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25 02:41:16 +00:00
Ted Kremenek e571578002 RetainCountChecker: don't adjust the retain count when analyzing a ReturnStmt unless we are in the top-level call frame. We can do more later, but this makes the checker self-consistent (and fixes a crash).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151426 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25 02:09:09 +00:00
Argyrios Kyrtzidis 63787f0343 [arcmt] GC migrator: don't try to remove redundant __strong, it does
more harm than good.

Fixes rdar://10522805&10521433

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151424 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25 01:57:42 +00:00
Eli Friedman a66eccbf1f Improve the diagnostic in ARC mode when a conditional with an Objective-C type and void* is used. <rdar://problem/10486347>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151416 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25 00:23:44 +00:00
Douglas Gregor bcf38f2782 Trying to increase my Ohloh ranking with trivial tweaks
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151414 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25 00:16:17 +00:00
DeLesley Hutchins d08d599da1 Bugfix: bogus warning -- "invalid use of non-static data member",
when a class is forward declared, and the reference to the data
member in question does not occur within a method body.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151413 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25 00:11:55 +00:00
Douglas Gregor 4a59bc26b3 Simplify check per Eli's comment
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151412 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25 00:06:47 +00:00
Douglas Gregor 9b42afdccc Add test for C++ DR899.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151411 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 23:57:42 +00:00
Anna Zaks 3cd89ad193 [analyzer] Malloc: reason about the ObjC messages and C++.
Assume none of the ObjC messages defined in system headers free memory,
except for the ones containing 'freeWhenDone' selector. Currently, just
assume that the region escapes to the messages with 'freeWhenDone'
(ideally, we want to treat it as 'free()').

For now, always assume that regions escape when passed to C++ methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151410 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 23:56:53 +00:00
Douglas Gregor ed878af791 Implement C++11 [over.match.copy]p1b2, which allows the use of
explicit conversion functions to initialize the argument to a
copy/move constructor that itself is the subject of direct
initialization. Since we don't have that much context in overload
resolution, we end up threading more flags :(.

Fixes <rdar://problem/10903741> / PR10456. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151409 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 23:56:31 +00:00
Eli Friedman 5a13d4d2c1 Fix a stupid mistake in r151133. Reported to me by Joerg Sonnenberger.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151407 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 23:53:49 +00:00
Richard Smith 61dab36ccb Remove FIXME: as Eli points out, the behavior here is now correct.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151405 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 23:21:24 +00:00
Douglas Gregor a98a28534e For the purposes of building LLVM types, a forward-declared
enumeration type with a fixed underlying type is complete. Fixes
<rdar://problem/10916155>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151403 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 22:40:36 +00:00
Richard Smith c7b5543ad3 Back out __decltype warning from r151377: we should either warn on all the GNU
__keywords or none of them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151401 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 22:30:04 +00:00
Benjamin Kramer a08c2fb74e Make helper static.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151400 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 22:19:42 +00:00
Richard Smith 359c89df54 When checking whether a reference to a variable is an ICE, look at the type of
the declaration, not at the type of the DeclRefExpr, since within a lambda the
DeclRefExpr can be more const than the declaration is.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151399 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 22:12:32 +00:00
Fariborz Jahanian f329527bbe Minor modern rewriter bug showed up during testing
against a large project.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151395 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 21:42:38 +00:00
Douglas Gregor 221c27f0d3 C++11 [class.ctor]p5 says that
A defaulted default constructor for a class X is defined as deleted if [...]
    -  X is a union and all of its variant members are of const-qualified type.

A pedantic reading therefore says that

 union X { };

has a deleted default constructor, which is both silly and almost
certainly unintended. Pretend as if this this read

    - X is a union with one or more variant members, and all of its
      variant members are of const-qualified type. 



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151394 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 21:25:53 +00:00
Dmitri Gribenko 62348f041a Fix comment: correct predicate name, reformat comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151389 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 20:03:35 +00:00
Argyrios Kyrtzidis 69015c22e1 Change the text of a FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151387 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 19:45:46 +00:00
Argyrios Kyrtzidis 7c4a6191c2 [libclang] Add a triple to the test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151386 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 19:45:42 +00:00
Richard Smith 1e409d8336 cxx_status: Consistently refer to C++11 as "C++11", not as "C++'11" nor as
"C++0x". Use "C++98" to refer to C++98, not "C++". Add heading for C++98
support section.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151381 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 18:42:08 +00:00
Richard Smith a5ec58d736 cxx_status: extended sizeof has been essentially complete for some time. As
agreed on IRC, any remaining issues are best dealt with as bugs.

We have no __has_feature check for this; please shout if you'd like one. This
feature seems too small to be worth its own release notes bullet (again, please
shout if you disagree).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151380 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 18:37:14 +00:00
Fariborz Jahanian 33eb59a1c9 test for writing modern ivar of struct type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151378 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 18:17:50 +00:00
Richard Smith 39304fad1c __decltype is a GNU extension, not a C++11 extension.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151377 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 18:10:23 +00:00
Fariborz Jahanian ca61bf3b38 more objective-c modern translator ivar tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151376 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 18:03:42 +00:00
Douglas Gregor ec79d877c1 Two minor, related fixes for template instantiation with blocks:
- Make sure that the block expression is instantiation-dependent if the
    block is in a dependent context
  - Make sure that the C++ 'this' expression gets captured even if we
  don't rebuild the AST node during template instantiation. This would
  also have manifested as a bug for lambdas.

Fixes <rdar://problem/10832617>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151372 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 17:41:38 +00:00
Fariborz Jahanian 0d6e22a383 objc modern translator. Fixes writing of block pointer ivar access.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151371 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 17:35:35 +00:00
Anna Zaks ff80afcfb2 [analyzer] Run remove dead bindings before each call.
This ensures that we report the bugs associated with symbols going
out of scope in the correct function context.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151369 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 16:49:46 +00:00
Anna Zaks e55b03a6e4 [analyzer] We were silently stopping exploring the path after
visiting 'return;' statement!

This most likely caused us to skip a bunch of code when analyzing with
inlining.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151368 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 16:49:41 +00:00
Rafael Espindola a0889a8c32 Use -no-integrated-as only on ARM. The X86 and X86-64 integrated as have been
the default for clang for some time now and can handle compiler-rt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151367 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 16:22:39 +00:00
Nick Lewycky 0fd7f4db69 Revert r151357. That unreachable is reachable...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151359 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 09:07:53 +00:00
Nick Lewycky 770dc0342c Silence gcc warnings pointing out that CharByteWidth could be used
uninitialized. While there, restyle this function! No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151357 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 08:58:14 +00:00
Matt Beaumont-Gay 28e4702a1f Sink variable into assert
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151356 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 08:37:56 +00:00
Douglas Gregor f6cfe8ba2b Remove some trivial uses of hasTrivialCopyConstructor() and
hasTrivialMoveConstructor().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151354 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 07:55:51 +00:00
Douglas Gregor 5d86f61b9c Kill a spurious use of hasTrivialDefaultConstructor()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151353 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 07:48:37 +00:00
Douglas Gregor 4ca8ac2e61 Implement a new type trait __is_trivially_constructible(T, Args...)
that provides the behavior of the C++11 library trait
std::is_trivially_constructible<T, Args...>, which can't be
implemented purely as a library.

Since __is_trivially_constructible can have zero or more arguments, I
needed to add Yet Another Type Trait Expression Class, this one
handling arbitrary arguments. The next step will be to migrate
UnaryTypeTrait and BinaryTypeTrait over to this new, more general
TypeTrait class.

Fixes the Clang side of <rdar://problem/10895483> / PR12038.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151352 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 07:38:34 +00:00
Ted Kremenek 59950d3aa5 Make PathDiagnosticBuilder sensitive to varying LocationContexts, thus fixing a bug in the inlining diagnostics where the wrong location could be used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151349 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 07:12:52 +00:00
Ted Kremenek 5b03c17bc9 Remove stray path in test file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151347 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 06:01:01 +00:00
Ted Kremenek 2042fc1f36 Reapply r151317, but when computing the PathDiagnostic profile and size keep into account the nested structure. Also fix a problem with how
inlining impacted Plist diagnostics, and adjust some ranges in the Plist output due to richer information.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151346 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24 06:00:00 +00:00