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

36124 Коммитов

Автор SHA1 Сообщение Дата
Benjamin Kramer 34f9dc46d3 Directly store TypoResultsMaps in the TypoEditDistanceMap, getting rid of manual deletion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154736 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-14 08:26:28 +00:00
Richard Smith 534986f2b2 Add an AttributedStmt type to represent a statement with C++11 attributes
attached. Since we do not support any attributes which appertain to a statement
(yet), testing of this is necessarily quite minimal.

Patch by Alexander Kornienko!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154723 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-14 00:33:13 +00:00
Benjamin Kramer 9cdd1e3450 Delete the TypoResultsMap when erasing the pointer to it.
This manual deleting is error-prone, but we can't just put an OwningPtr in a
std::map :(

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154707 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 23:09:10 +00:00
John McCall 38baeabb25 Don't enter cleanups for unreachable variables. It's impossible to
jump into these scopes, and the cleanup-entering code sometimes wants
to do some operations first (e.g. a GEP), which can leave us with
unparented IR.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154684 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 18:44:05 +00:00
Fariborz Jahanian 653b7cff0e modern objective-c translator: Fixes translation of
__typeof which is a regression by reverting
r154360. // rdar://11233924


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154679 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 18:00:54 +00:00
Benjamin Kramer c6b468e46d Avoid string thrashing when we can concatenate them in the final buffer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154678 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 18:00:37 +00:00
John McCall b889614670 Serialize and deserialize some missing bits from BlockDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154676 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 17:33:29 +00:00
Douglas Gregor ba8be8c422 Kill the last vestiges of clangIndex
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154675 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 17:26:32 +00:00
Douglas Gregor 30828467c0 Remove clangIndex reference from clang-interpreter CMake build
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154674 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 17:22:46 +00:00
Douglas Gregor 87e154c09b Remove the unused, unmaintained, incomplete 'Index' library.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154672 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 16:31:46 +00:00
Fariborz Jahanian b20c46ea98 modern objective-c translator: When translating
call to 'super' use __rw_objc_super as type of the
'super' meta-data instead of objc_super.
// rdar://11239894


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154670 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 16:20:05 +00:00
Douglas Gregor 88507ddf6f Make control flow more explicit for rebuilding property reference expressions without their OpaqueValueExprs
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154669 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 16:05:42 +00:00
Douglas Gregor 105047124c Remove the -cc1-level option "-pubnames-dump". Such things should stay
out of the tree and use the tooling infrastructure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154668 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 16:03:00 +00:00
Douglas Gregor f53bc3126b super and class property reference expressions don't need to be
rebuilt. Fixes <rdar://problem/11052352>. 



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154667 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 15:53:08 +00:00
Anton Korobeynikov 00000b08ff First set of tests for ARM homogenous aggregates. C only. C++ will follow.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154666 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 11:23:39 +00:00
Anton Korobeynikov eaf856db5d Step forward with supporting of ARM homogenous aggregates:
- Handle unions
  - Handle C++ classes


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154664 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 11:22:00 +00:00
Richard Smith 51b92401c9 Implement __atomic_fetch_nand and __atomic_nand_fetch to complete our set of
GNU __atomic builtins.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154659 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 06:31:38 +00:00
Richard Smith a1c4f7c833 PR12500: Improve the wording of the diagnostic for a redefinition of a name
in the wrong namespace scope. Patch by Jonathan Sauer!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154656 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 04:07:40 +00:00
Seth Cantrell 5e6c3f0397 Support -Wc++98-compat-pedantic as requested:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120409/056126.html

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154655 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 03:43:23 +00:00
Richard Smith b3440f5898 all-std-headers.cpp: Include the C++11 headers when building with clang
in -std=gnu++11 mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154654 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 03:39:16 +00:00
John McCall 7444639f27 Fix a trivial oversight with apple-kext static local destructors
and add a test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154653 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 02:53:27 +00:00
Richard Smith 95e7aaf46a Mention atomics support in the release notes.
Thanks to Nico Weber for the suggestion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154648 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 01:24:35 +00:00
John McCall 97b57a2170 When we're flagging a protected scope to prevent jumps into the
shadow of a block expression with non-trivial destructed cleanups,
we should flag that in the enclosing function, not in the block
that we're about to pop.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154646 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 01:08:17 +00:00
Richard Smith 9d4e87e52c Now that we provide sufficient support for three C11/C++11 atomics
implementations, mark the atomics-related parts of the C++11 status page
as done. I've not marked 'Strong Compare and Exchange' done, since although
we implement supporting builtins, we don't yet produce different code for
the weak and strong forms.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154644 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 01:02:19 +00:00
Seth Cantrell d55522287e C++11 no longer requires files to end with a newline
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154643 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 01:00:34 +00:00
Richard Smith 2c39d71bb7 Implement the missing pieces needed to support libstdc++4.7's <atomic>:
__atomic_test_and_set, __atomic_clear, plus a pile of undocumented __GCC_*
predefined macros.

Implement library fallback for __atomic_is_lock_free and
__c11_atomic_is_lock_free, and implement __atomic_always_lock_free.

Contrary to their documentation, GCC's __atomic_fetch_add family don't
multiply the operand by sizeof(T) when operating on a pointer type.
libstdc++ relies on this quirk. Remove this handling for all but the
__c11_atomic_fetch_add and __c11_atomic_fetch_sub builtins.

Contrary to their documentation, __atomic_test_and_set and __atomic_clear
take a first argument of type 'volatile void *', not 'void *' or 'bool *',
and __atomic_is_lock_free and __atomic_always_lock_free have an argument
of type 'const volatile void *', not 'void *'.

With this change, libstdc++4.7's <atomic> passes libc++'s atomic test suite,
except for a couple of libstdc++ bugs and some cases where libc++'s test
suite tests for properties which implementations have latitude to vary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154640 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13 00:45:38 +00:00
Fariborz Jahanian e2d87bc0be objective-c modern translator: beautify rewrite of
struct __rw_objc_super; no functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154632 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 23:52:52 +00:00
Daniel Dunbar f7728dc1d4 Config.h: Add another definition which the Darwin build (sometimes) uses.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154630 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 23:19:46 +00:00
David Blaikie 37050841d7 Warn on 64-to-32 for source value of x bits where 64 >= x > 32.
The codepath already only works for source bits > target bits, it's just that
it was testing for the source expr bits to be exactly 64. This meant simple
cases (int i = x_long / 2) were missed & ended up under the general
-Wconversion warning, which a user might not have enabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154626 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 22:40:54 +00:00
Anna Zaks 6a86082f3a [analyzer] PCH deserialization optimization.
We should not deserialize unused declarations from the PCH file. Achieve
this by storing the top level declarations during parsing
(HandleTopLevelDecl ASTConsumer callback) and analyzing/building a call
graph only for those.

Tested the patch on a sample ObjC file that uses PCH. With the patch, 
 the analyzes is 17.5% faster and clang consumes 40% less memory.
Got about 10% overall build/analyzes time decrease on a large Objective
C project.

A bit of CallGraph refactoring/cleanup as well..

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154625 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 22:36:48 +00:00
Anna Zaks 273ed9870a [analyzer] Test case for r154451 (redefining system functions).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154624 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 22:36:43 +00:00
Fariborz Jahanian 262acdab8b objective-c literals: Issue warning and ignore
when BOOL is not of an intergal type when
boolean literals are used. // rdar://11231426


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154619 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 21:24:56 +00:00
Douglas Gregor 7d000652cc s/isAtomicConversion/tryAtomicConversion/g, per Jordy's suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154613 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 20:48:09 +00:00
Douglas Gregor 47bfcca2d6 Fix some i1/i8 confusion within _Atomic(bool) in IR generation, both
in general (such an atomic has boolean representation) and
specifically for IR generation of __c11_atomic_init. The latter also
means actually using initialization semantics for this initialization,
rather than just creating a store.

On a related note, make sure we actually put in non-atomic-to-atomic
conversions when performing an implicit conversion sequence. IR
generation is far too kind here, but we still want the ASTs to make
sense.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154612 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 20:42:30 +00:00
Ted Kremenek 83748e2f41 Include lambda capture init expressions in CFG.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154611 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 20:34:52 +00:00
Ted Kremenek c02af35e92 Add -Wuninitialized test for C++11 lambdas.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154608 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 20:03:47 +00:00
Ted Kremenek 55331da321 Fix CFGBuilder to not include the body of a LambdaExpr in the CFG of the enclosing function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154607 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 20:03:44 +00:00
Simon Atanasyan 10e1629dc3 MIPS: Initialize MIPS CPU's name by default value.
Otherwise MipsTargetInfoBase::getDefaultFeatures() might return an invalid
features set with an empty feature name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154606 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 19:59:24 +00:00
Douglas Gregor f7ecc3016e Compute standard conversion sequences for conversions to atomic
types. The second and third conversions in the sequence are based on
the conversion for the underlying type, so that we get sensible
overloading behavior for, e.g., _Atomic(int) vs. _Atomic(float).

As part of this, actually implement the lvalue-to-rvalue conversion
for atomic types. There is probably a pile of code in SemaExpr that
can now be deleted, but I haven't tracked it down yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154596 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 17:51:55 +00:00
Fariborz Jahanian 9985038860 objective-c numeric literal: type of boolean is
that of typedef BOOL if found.
// rdar://11231426


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154595 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 17:49:18 +00:00
Fariborz Jahanian 5ce2827de3 modern objective-c translator. ifdef'out
__weak and __block when rewriting.
// rdar://11236342



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154592 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 16:33:31 +00:00
Chad Rosier 41a7e89183 Fix the signatures for the _mm256_storeu2_* intrinsics.
PR12532


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154591 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 16:29:08 +00:00
Erik Verbruggen 9bc0c290a7 Changed all direct calls to CompletionConsumer.reset(..) to go call
CompilerInstance::setCodeCompletionConsumer instead, in order to change
the SkipFunctionBodies flag accordingly. Also fixed
setCodeCompletionConsumer to take a reset() to null into account.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154585 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 10:31:12 +00:00
Erik Verbruggen 6a91d38561 Added a flag to the parser to skip method bodies.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154584 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 10:11:59 +00:00
Nick Lewycky f33d549b16 There's some code in the PCH reader that looks like it's needlessly complex, but
turns out that it's actually needed for C++ modules support. Since simplifying
it didn't cause any test failures, I'll add a test for it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154582 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 07:56:21 +00:00
Richard Smith ff34d401ff Implement support for 18 of the GNU-compatible __atomic builtins.
This is not quite sufficient for libstdc++'s <atomic>: we still need
__atomic_test_and_set and __atomic_clear, and may need a more complete
__atomic_is_lock_free implementation.

We are also missing an implementation of __atomic_always_lock_free,
__atomic_nand_fetch, and __atomic_fetch_nand, but those aren't needed
for libstdc++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154579 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 05:08:17 +00:00
Eric Christopher b92bd4b327 These functions too have no prototypes. Audited the rest of Sema for
FunctionDecl::Create calls as well.

rdar://11079003

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154578 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 02:16:49 +00:00
Eric Christopher 4f95f6444a Testcase for previous commit.
rdar://11079003

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154571 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 00:36:10 +00:00
Eric Christopher 43443de48b static functions have a need for mangled name debug information too.
The mangler doesn't like non-prototyped functions so only use a mangled
name for prototyped functions.

rdar://11079003

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154570 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 00:35:06 +00:00
Eric Christopher e5bbebb4d1 The copy and destroy helper functions aren't prototyped, don't call them
so.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154569 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-12 00:35:04 +00:00