]> granicus.if.org Git - clang/log
clang
12 years agoKill the last vestiges of clangIndex
Douglas Gregor [Fri, 13 Apr 2012 17:26:32 +0000 (17:26 +0000)]
Kill the last vestiges of clangIndex

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

12 years agoRemove clangIndex reference from clang-interpreter CMake build
Douglas Gregor [Fri, 13 Apr 2012 17:22:46 +0000 (17:22 +0000)]
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

12 years agoRemove the unused, unmaintained, incomplete 'Index' library.
Douglas Gregor [Fri, 13 Apr 2012 16:31:46 +0000 (16:31 +0000)]
Remove the unused, unmaintained, incomplete 'Index' library.

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

12 years agomodern objective-c translator: When translating
Fariborz Jahanian [Fri, 13 Apr 2012 16:20:05 +0000 (16:20 +0000)]
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

12 years agoMake control flow more explicit for rebuilding property reference expressions without...
Douglas Gregor [Fri, 13 Apr 2012 16:05:42 +0000 (16:05 +0000)]
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

12 years agoRemove the -cc1-level option "-pubnames-dump". Such things should stay
Douglas Gregor [Fri, 13 Apr 2012 16:03:00 +0000 (16:03 +0000)]
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

12 years agosuper and class property reference expressions don't need to be
Douglas Gregor [Fri, 13 Apr 2012 15:53:08 +0000 (15:53 +0000)]
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

12 years agoFirst set of tests for ARM homogenous aggregates. C only. C++ will follow.
Anton Korobeynikov [Fri, 13 Apr 2012 11:23:39 +0000 (11:23 +0000)]
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

12 years agoStep forward with supporting of ARM homogenous aggregates:
Anton Korobeynikov [Fri, 13 Apr 2012 11:22:00 +0000 (11:22 +0000)]
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

12 years agoImplement __atomic_fetch_nand and __atomic_nand_fetch to complete our set of
Richard Smith [Fri, 13 Apr 2012 06:31:38 +0000 (06:31 +0000)]
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

12 years agoPR12500: Improve the wording of the diagnostic for a redefinition of a name
Richard Smith [Fri, 13 Apr 2012 04:07:40 +0000 (04:07 +0000)]
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

12 years agoSupport -Wc++98-compat-pedantic as requested:
Seth Cantrell [Fri, 13 Apr 2012 03:43:23 +0000 (03:43 +0000)]
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

12 years agoall-std-headers.cpp: Include the C++11 headers when building with clang
Richard Smith [Fri, 13 Apr 2012 03:39:16 +0000 (03:39 +0000)]
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

12 years agoFix a trivial oversight with apple-kext static local destructors
John McCall [Fri, 13 Apr 2012 02:53:27 +0000 (02:53 +0000)]
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

12 years agoMention atomics support in the release notes.
Richard Smith [Fri, 13 Apr 2012 01:24:35 +0000 (01:24 +0000)]
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

12 years agoWhen we're flagging a protected scope to prevent jumps into the
John McCall [Fri, 13 Apr 2012 01:08:17 +0000 (01:08 +0000)]
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

12 years agoNow that we provide sufficient support for three C11/C++11 atomics
Richard Smith [Fri, 13 Apr 2012 01:02:19 +0000 (01:02 +0000)]
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

12 years agoC++11 no longer requires files to end with a newline
Seth Cantrell [Fri, 13 Apr 2012 01:00:34 +0000 (01:00 +0000)]
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

12 years agoImplement the missing pieces needed to support libstdc++4.7's <atomic>:
Richard Smith [Fri, 13 Apr 2012 00:45:38 +0000 (00:45 +0000)]
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

12 years agoobjective-c modern translator: beautify rewrite of
Fariborz Jahanian [Thu, 12 Apr 2012 23:52:52 +0000 (23:52 +0000)]
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

12 years agoConfig.h: Add another definition which the Darwin build (sometimes) uses.
Daniel Dunbar [Thu, 12 Apr 2012 23:19:46 +0000 (23:19 +0000)]
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

12 years agoWarn on 64-to-32 for source value of x bits where 64 >= x > 32.
David Blaikie [Thu, 12 Apr 2012 22:40:54 +0000 (22:40 +0000)]
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

12 years ago[analyzer] PCH deserialization optimization.
Anna Zaks [Thu, 12 Apr 2012 22:36:48 +0000 (22:36 +0000)]
[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

12 years ago[analyzer] Test case for r154451 (redefining system functions).
Anna Zaks [Thu, 12 Apr 2012 22:36:43 +0000 (22:36 +0000)]
[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

12 years agoobjective-c literals: Issue warning and ignore
Fariborz Jahanian [Thu, 12 Apr 2012 21:24:56 +0000 (21:24 +0000)]
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

12 years agos/isAtomicConversion/tryAtomicConversion/g, per Jordy's suggestion.
Douglas Gregor [Thu, 12 Apr 2012 20:48:09 +0000 (20:48 +0000)]
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

12 years agoFix some i1/i8 confusion within _Atomic(bool) in IR generation, both
Douglas Gregor [Thu, 12 Apr 2012 20:42:30 +0000 (20:42 +0000)]
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

12 years agoInclude lambda capture init expressions in CFG.
Ted Kremenek [Thu, 12 Apr 2012 20:34:52 +0000 (20:34 +0000)]
Include lambda capture init expressions in CFG.

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

12 years agoAdd -Wuninitialized test for C++11 lambdas.
Ted Kremenek [Thu, 12 Apr 2012 20:03:47 +0000 (20:03 +0000)]
Add -Wuninitialized test for C++11 lambdas.

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

12 years agoFix CFGBuilder to not include the body of a LambdaExpr in the CFG of the enclosing...
Ted Kremenek [Thu, 12 Apr 2012 20:03:44 +0000 (20:03 +0000)]
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

12 years agoMIPS: Initialize MIPS CPU's name by default value.
Simon Atanasyan [Thu, 12 Apr 2012 19:59:24 +0000 (19:59 +0000)]
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

12 years agoCompute standard conversion sequences for conversions to atomic
Douglas Gregor [Thu, 12 Apr 2012 17:51:55 +0000 (17:51 +0000)]
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

12 years agoobjective-c numeric literal: type of boolean is
Fariborz Jahanian [Thu, 12 Apr 2012 17:49:18 +0000 (17:49 +0000)]
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

12 years agomodern objective-c translator. ifdef'out
Fariborz Jahanian [Thu, 12 Apr 2012 16:33:31 +0000 (16:33 +0000)]
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

12 years agoFix the signatures for the _mm256_storeu2_* intrinsics.
Chad Rosier [Thu, 12 Apr 2012 16:29:08 +0000 (16:29 +0000)]
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

12 years agoChanged all direct calls to CompletionConsumer.reset(..) to go call
Erik Verbruggen [Thu, 12 Apr 2012 10:31:12 +0000 (10:31 +0000)]
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

12 years agoAdded a flag to the parser to skip method bodies.
Erik Verbruggen [Thu, 12 Apr 2012 10:11:59 +0000 (10:11 +0000)]
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

12 years agoThere's some code in the PCH reader that looks like it's needlessly complex, but
Nick Lewycky [Thu, 12 Apr 2012 07:56:21 +0000 (07:56 +0000)]
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

12 years agoImplement support for 18 of the GNU-compatible __atomic builtins.
Richard Smith [Thu, 12 Apr 2012 05:08:17 +0000 (05:08 +0000)]
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

12 years agoThese functions too have no prototypes. Audited the rest of Sema for
Eric Christopher [Thu, 12 Apr 2012 02:16:49 +0000 (02:16 +0000)]
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

12 years agoTestcase for previous commit.
Eric Christopher [Thu, 12 Apr 2012 00:36:10 +0000 (00:36 +0000)]
Testcase for previous commit.

rdar://11079003

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

12 years agostatic functions have a need for mangled name debug information too.
Eric Christopher [Thu, 12 Apr 2012 00:35:06 +0000 (00:35 +0000)]
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

12 years agoThe copy and destroy helper functions aren't prototyped, don't call them
Eric Christopher [Thu, 12 Apr 2012 00:35:04 +0000 (00:35 +0000)]
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

12 years agoImplement clang_getDiagnosticCategoryText() to provide a way for a client of libclang...
Ted Kremenek [Thu, 12 Apr 2012 00:03:31 +0000 (00:03 +0000)]
Implement clang_getDiagnosticCategoryText() to provide a way for a client of libclang to accurately
get the diagnostic category name from a serialized diagnostic when the version of libclang used
to read the diagnostic file is newer than the clang that emitted the diagnostic file.

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

12 years agomodern objective-c translator. Fixes a mis-translation when
Fariborz Jahanian [Wed, 11 Apr 2012 23:57:12 +0000 (23:57 +0000)]
modern objective-c translator. Fixes a mis-translation when
of a __block struct object. // rdar://11230308

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

12 years agoAdd test for a construct we currently reject, constant-evaluating a load from a const...
Eli Friedman [Wed, 11 Apr 2012 23:32:29 +0000 (23:32 +0000)]
Add test for a construct we currently reject, constant-evaluating a load from a constant string.  Given that gcc doesn't accept this, we should continue to not accept it, even though it was accidentally supported by clang for a brief period.

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

12 years ago[analyzer] Another dynamic_cast false positive/negative.
Anna Zaks [Wed, 11 Apr 2012 22:29:38 +0000 (22:29 +0000)]
[analyzer] Another dynamic_cast false positive/negative.

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

12 years ago[analyzer] dynamic_cast Simplify null value generation.
Anna Zaks [Wed, 11 Apr 2012 22:20:07 +0000 (22:20 +0000)]
[analyzer] dynamic_cast Simplify null value generation.

As per Jordy's review. Creating a symbol here is more flexible; however
I could not come up with an example where it was needed. (What
constrains can be added on of the symbol constrained to 0?)

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

12 years ago[analyzer] Better test cases for explaining where tracking types of
Anna Zaks [Wed, 11 Apr 2012 22:20:05 +0000 (22:20 +0000)]
[analyzer] Better test cases for explaining where tracking types of
symbolic regions would help.

Thanks to Richard Smith.

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

12 years agomodern objective-c translator. Fixes a translation bug when
Fariborz Jahanian [Wed, 11 Apr 2012 21:12:36 +0000 (21:12 +0000)]
modern objective-c translator. Fixes a translation bug when
first ivar in the list is a bitfield.
// rdar://11229770

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

12 years agoPart of PR10101: after a parse error in a declaration, try harder to find the
Richard Smith [Wed, 11 Apr 2012 20:59:20 +0000 (20:59 +0000)]
Part of PR10101: after a parse error in a declaration, try harder to find the
right place to pick up parsing. In C++, this had a tendency to skip everything
declared within headers if the TU starts with garbage.

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

12 years ago[libclang] Apparently it's important to build in C89, sigh..
Argyrios Kyrtzidis [Wed, 11 Apr 2012 19:54:09 +0000 (19:54 +0000)]
[libclang] Apparently it's important to build in C89, sigh..

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

12 years ago[libclang] Introduce a couple of functions to make it convenient
Argyrios Kyrtzidis [Wed, 11 Apr 2012 19:32:19 +0000 (19:32 +0000)]
[libclang] Introduce a couple of functions to make it convenient
to get at the parameters (and their types) of a function or objc method cursor.

int clang_Cursor_getNumArguments(CXCursor C);
CXCursor clang_Cursor_getArgument(CXCursor C, unsigned i);

rdar://11201527

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

12 years ago[libclang] In cxloc::translateSourceRange make sure to handle locations in macro...
Argyrios Kyrtzidis [Wed, 11 Apr 2012 18:15:01 +0000 (18:15 +0000)]
[libclang] In cxloc::translateSourceRange make sure to handle locations in macro arguments
correctly. clang diagnostics can provide fixits inside a macro argument now.

rdar://11014346

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

12 years agoUpdate recently-added test to use new __c11_ form of atomic builtins.
Richard Smith [Wed, 11 Apr 2012 18:00:46 +0000 (18:00 +0000)]
Update recently-added test to use new __c11_ form of atomic builtins.

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

12 years agoProvide, and document, a set of __c11_atomic_* intrinsics to implement C11's
Richard Smith [Wed, 11 Apr 2012 17:55:32 +0000 (17:55 +0000)]
Provide, and document, a set of __c11_atomic_* intrinsics to implement C11's
<stdatomic.h> header.

In passing, fix LanguageExtensions to note that C11 and C++11 are no longer
"upcoming standards" but are now actually standardized.

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

12 years agoMake __atomic_init() (soon to be __c11_atomic_init()) work with non-scalar types.
David Chisnall [Wed, 11 Apr 2012 17:24:05 +0000 (17:24 +0000)]
Make __atomic_init() (soon to be __c11_atomic_init()) work with non-scalar types.

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

12 years agoClean up last commit as per dgregor's comments.
David Chisnall [Wed, 11 Apr 2012 16:08:14 +0000 (16:08 +0000)]
Clean up last commit as per dgregor's comments.

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

12 years agoAllow c++ initialisers to initialise _Atomic fields.
David Chisnall [Wed, 11 Apr 2012 15:29:15 +0000 (15:29 +0000)]
Allow c++ initialisers to initialise _Atomic fields.

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

12 years agoAdd a triple to this test.
Eric Christopher [Wed, 11 Apr 2012 07:08:37 +0000 (07:08 +0000)]
Add a triple to this test.

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

12 years agoTry to fix the windows buildbots by making this test a little less
Eric Christopher [Wed, 11 Apr 2012 06:09:33 +0000 (06:09 +0000)]
Try to fix the windows buildbots by making this test a little less
dependent upon metadata ordering.

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

12 years agoEnable debug info for objective c implementations that may not have
Eric Christopher [Wed, 11 Apr 2012 05:56:05 +0000 (05:56 +0000)]
Enable debug info for objective c implementations that may not have
an explicit instance variable.

rdar://10590352

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

12 years agoSupport C++11 attributes at the start of a parameter-declaration.
Richard Smith [Wed, 11 Apr 2012 04:01:28 +0000 (04:01 +0000)]
Support C++11 attributes at the start of a parameter-declaration.

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

12 years ago[libclang] Fix "error: conflicts with new declaration with ā€˜Cā€™ linkage" that gcc
Argyrios Kyrtzidis [Wed, 11 Apr 2012 03:52:18 +0000 (03:52 +0000)]
[libclang] Fix "error: conflicts with new declaration with ā€˜Cā€™ linkage" that gcc
emits but not clang.

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

12 years ago[libclang] If displayDiagnostics is set (when calling clang_createIndex), make sure to
Argyrios Kyrtzidis [Wed, 11 Apr 2012 02:11:16 +0000 (02:11 +0000)]
[libclang] If displayDiagnostics is set (when calling clang_createIndex), make sure to
output the errors that occurred even if we did not get an AST (e.g. because the
PCH failed to load).

Also honor displayDiagnostics in clang_indexSourceFile().

rdar://11203489

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

12 years ago[analyzer] Don't crash even when the system functions are redefined.
Anna Zaks [Tue, 10 Apr 2012 23:41:11 +0000 (23:41 +0000)]
[analyzer] Don't crash even when the system functions are redefined.
(Applied changes to CStringAPI, Malloc, and Taint.)

This might almost never happen, but we should not crash even if it does.
This fixes a crash on the internal analyzer buildbot, where postgresql's
configure was redefining memmove (radar://11219852).

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

12 years agoAtomicExpr: make ASTStmtReader a friend and remove setters. Also fix saving
Richard Smith [Tue, 10 Apr 2012 22:49:28 +0000 (22:49 +0000)]
AtomicExpr: make ASTStmtReader a friend and remove setters. Also fix saving
of an uninitialized Stmt* in serialization of __atomic_init and add a test of
atomics serialization.

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

12 years agoFix quoting to allow shell expansion to occur for shell variables
Kaelyn Uhrain [Tue, 10 Apr 2012 22:27:27 +0000 (22:27 +0000)]
Fix quoting to allow shell expansion to occur for shell variables
introduced by the test harness' expansion of %t.

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

12 years agomodern objective-c translation: writing container
Fariborz Jahanian [Tue, 10 Apr 2012 22:06:54 +0000 (22:06 +0000)]
modern objective-c translation: writing container
subscripting. // rdar://11203853

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

12 years ago[analyzer] dynamic_cast: Better model cast from a reference.
Anna Zaks [Tue, 10 Apr 2012 21:29:03 +0000 (21:29 +0000)]
[analyzer] dynamic_cast: Better model cast from a reference.

Generate a sink when the dynamic_cast from a reference fails to
represent a thrown exception.

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

12 years ago[libclang] For clang_getOverriddenCursors make sure to report overridden objc methods
Argyrios Kyrtzidis [Tue, 10 Apr 2012 21:01:03 +0000 (21:01 +0000)]
[libclang] For clang_getOverriddenCursors make sure to report overridden objc methods
for methods in categories of super classes. rdar://11220358

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

12 years ago[analyzer] Add support for C++ dynamic_cast.
Anna Zaks [Tue, 10 Apr 2012 20:59:00 +0000 (20:59 +0000)]
[analyzer] Add support for C++ dynamic_cast.

Simulate the C++ dynamic_cast in the analyzer.

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

12 years ago[analyzer] + comments
Anna Zaks [Tue, 10 Apr 2012 20:58:55 +0000 (20:58 +0000)]
[analyzer] + comments

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

12 years agoWhen we determine that an initialization sequence failed due to an
Douglas Gregor [Tue, 10 Apr 2012 20:43:46 +0000 (20:43 +0000)]
When we determine that an initialization sequence failed due to an
incomplete type, keep track of the actual type that was
incomplete. Otherwise, we might fail to produce a diagnostic. Fixes
PR12498.

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

12 years agoImprove the printing of __PRETTY_FUNCTION__ more provide more
Douglas Gregor [Tue, 10 Apr 2012 20:14:15 +0000 (20:14 +0000)]
Improve the printing of __PRETTY_FUNCTION__ more provide more
information and more closely match GCC's, from Nikola Smiljanic!

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

12 years agoAdd a query macro for C++11 N3276, decltype does not require complete
Douglas Gregor [Tue, 10 Apr 2012 20:00:33 +0000 (20:00 +0000)]
Add a query macro for C++11 N3276, decltype does not require complete
return types, from Michel Morin!

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

12 years agoImprove diagnostics in C++11 when a non-type template argument for a
Douglas Gregor [Tue, 10 Apr 2012 19:03:30 +0000 (19:03 +0000)]
Improve diagnostics in C++11 when a non-type template argument for a
non-type template parameter of pointer type is not a constant expression.

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

12 years agoThis test actually needs label names.
Eric Christopher [Tue, 10 Apr 2012 18:36:52 +0000 (18:36 +0000)]
This test actually needs label names.

PR9796

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

12 years agoInclude the Objective-C parameter- and return-passing qualifiers when
Douglas Gregor [Tue, 10 Apr 2012 18:35:07 +0000 (18:35 +0000)]
Include the Objective-C parameter- and return-passing qualifiers when
providing code completions for Objective-C method declarations. Fixes
<rdar://problem/11164498>.

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

12 years agoFor debug and coverage analysis if we're not optimizing go ahead
Eric Christopher [Tue, 10 Apr 2012 18:20:19 +0000 (18:20 +0000)]
For debug and coverage analysis if we're not optimizing go ahead
and emit a relatively empty block for a plain break statement. This
enables us to track where we went through a switch.

PR9796 & rdar://11215207

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

12 years agoDon't include the ':' following code-completion suggestions for
Douglas Gregor [Tue, 10 Apr 2012 17:56:28 +0000 (17:56 +0000)]
Don't include the ':' following code-completion suggestions for
'public', 'private', or 'protected', unless code completion patterns
are enabled. Fixes <rdar://problem/11189132>.

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

12 years agoobjective-c: remove IsConstProperty as it does not
Fariborz Jahanian [Tue, 10 Apr 2012 17:30:10 +0000 (17:30 +0000)]
objective-c: remove IsConstProperty as it does not
seem to get called any more. Also add an assert in
isModifiableLvalue.

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

12 years agoAdd a target triple to test/Index/complete-synthesized.m.
Argyrios Kyrtzidis [Tue, 10 Apr 2012 17:23:51 +0000 (17:23 +0000)]
Add a target triple to test/Index/complete-synthesized.m.

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

12 years ago[code-complete] Introduce CodeCompletionTUInfo which will be used for caching
Argyrios Kyrtzidis [Tue, 10 Apr 2012 17:23:48 +0000 (17:23 +0000)]
[code-complete] Introduce CodeCompletionTUInfo which will be used for caching
code-completion related strings specific to a translation unit (ASTContext and related data)

CodeCompletionAllocator does such limited caching, by caching the name assigned
to a DeclContext*, but that is not the appropriate place since that object has
a lifetime that can extend beyond that of an ASTContext.

Introduce CodeCompletionTUInfo which will be always tied to a translation unit
to do this kind of caching and move the caching of CodeCompletionAllocator into this
object, and propagate it to all the places where it will be needed.

The plan is to extend the caching where appropriate, using CodeCompletionTUInfo,
to avoid re-calculating code-completion strings.

Part of rdar://10796159.

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

12 years agoRework implementation of null non-type template arguments based on
Douglas Gregor [Tue, 10 Apr 2012 17:08:25 +0000 (17:08 +0000)]
Rework implementation of null non-type template arguments based on
Richard's feedback, to properly catch non-constant expressions and
type mismatches. Finishes <rdar://problem/11193097>.

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

12 years agoobjective-c: add an assertion for property
Fariborz Jahanian [Tue, 10 Apr 2012 16:44:52 +0000 (16:44 +0000)]
objective-c: add an assertion for property
expression enterring IsConstProperty function.

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

12 years agoFix GCC's pedantic return-type warning -- this enum is fully covered.
Chandler Carruth [Tue, 10 Apr 2012 16:03:08 +0000 (16:03 +0000)]
Fix GCC's pedantic return-type warning -- this enum is fully covered.

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

12 years agoFix tautological FileCheck by moving the CHECK to an extra line.
Manuel Klimek [Tue, 10 Apr 2012 12:12:33 +0000 (12:12 +0000)]
Fix tautological FileCheck by moving the CHECK to an extra line.

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

12 years agoDon't link lib[std]c++ when -nostdlib is specified (Solaris driver).
David Chisnall [Tue, 10 Apr 2012 11:49:50 +0000 (11:49 +0000)]
Don't link lib[std]c++ when -nostdlib is specified (Solaris driver).

Patch by Dmitri Shubin!

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

12 years agoPass -march, -mcpu, -mfpu to linuxtools assembler.
Evgeniy Stepanov [Tue, 10 Apr 2012 09:05:40 +0000 (09:05 +0000)]
Pass -march, -mcpu, -mfpu to linuxtools assembler.

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

12 years agoExpress the number of ULPs in fpaccuracy metadata as a real rather than a
Duncan Sands [Tue, 10 Apr 2012 08:23:07 +0000 (08:23 +0000)]
Express the number of ULPs in fpaccuracy metadata as a real rather than a
rational number, eg as 2.5 rather than 5, 2.  OK'd by Peter Collingbourne.

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

12 years agoEmitStopPoint already checks if we have debug info.
Eric Christopher [Tue, 10 Apr 2012 05:04:07 +0000 (05:04 +0000)]
EmitStopPoint already checks if we have debug info.

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

12 years agoTidy.
Eric Christopher [Tue, 10 Apr 2012 05:04:04 +0000 (05:04 +0000)]
Tidy.

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

12 years agoParsing of C++11 attributes:
Richard Smith [Tue, 10 Apr 2012 03:25:07 +0000 (03:25 +0000)]
Parsing of C++11 attributes:
 * Alternative tokens (such as 'compl') are treated as identifiers in
   attribute names.
 * An attribute-list can start with a comma.
 * An ellipsis may not be used with either of our currently-supported
   C++11 attributes.

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

12 years agoDisambiguation of '[[':
Richard Smith [Tue, 10 Apr 2012 01:32:12 +0000 (01:32 +0000)]
Disambiguation of '[[':
 * In C++11, '[[' is ill-formed unless it starts an attribute-specifier. Reject
   array sizes and array indexes which begin with a lambda-expression. Recover by
   parsing the lambda as a lambda.
 * In Objective-C++11, either '[' could be the start of a message-send.
   Fully disambiguate this case: it turns out that the grammars of message-sends,
   lambdas and attributes do not actually overlap. Accept any occurrence of '[['
   where either '[' starts a message send, but reject a lambda in an array index
   just like in C++11 mode.

Implement a couple of changes to the attribute wording which occurred after our
attributes implementation landed:
 * In a function-declaration, the attributes go after the exception specification,
   not after the right paren.
 * A reference type can have attributes applied.
 * An 'identifier' in an attribute can also be a keyword. Support for alternative
   tokens (iso646 keywords) in attributes to follow.

And some bug fixes:
 * Parse attributes after declarator-ids, even if they are not simple identifiers.
 * Do not accept attributes after a parenthesized declarator.
 * Accept attributes after an array size in a new-type-id.
 * Partially disamiguate 'delete' followed by a lambda. More work is required
   here for the case where the lambda-introducer is '[]'.

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

12 years agoFix the testcase :-(
Rafael Espindola [Tue, 10 Apr 2012 00:13:42 +0000 (00:13 +0000)]
Fix the testcase :-(

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

12 years agoobjective-c modern translator: rewriting specific
Fariborz Jahanian [Tue, 10 Apr 2012 00:08:18 +0000 (00:08 +0000)]
objective-c modern translator: rewriting specific
implicit casts which is needed to produce good c++
code. // rdar://11202764

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

12 years agoFix an annoying little bug I found while debugging another LTO issue. Gold
Rafael Espindola [Mon, 9 Apr 2012 23:53:34 +0000 (23:53 +0000)]
Fix an annoying little bug I found while debugging another LTO issue. Gold
requires the -plugin to come before any -plugin-opt options, we were passing
them the other way around. With this one can run (for example):

clang -o foo foo.c -O4 -Wl,-plugin-opt=generate-api-file

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

12 years agoRemove -fobjc-default-synthesize-properties as the option
Fariborz Jahanian [Mon, 9 Apr 2012 22:17:37 +0000 (22:17 +0000)]
Remove  -fobjc-default-synthesize-properties as the option
to c-index-test.

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

12 years agoMy original patch missed the virtual-base case for destroying
John McCall [Mon, 9 Apr 2012 21:51:56 +0000 (21:51 +0000)]
My original patch missed the virtual-base case for destroying
base-class subojects.

Incidentally, thinking about virtual bases makes it clear to me that
we're not appropriately computing the access to the virtual base's
member because we're not computing the best possible access to the
virtual base at all;  in fact, we're basically assuming it's public.
I'll file a separate PR about that.

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