]> granicus.if.org Git - clang/log
clang
13 years agoImplement implicit exception specifications of destructors.
Sebastian Redl [Wed, 18 May 2011 05:20:56 +0000 (05:20 +0000)]
Implement implicit exception specifications of destructors.

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

13 years agoImplement an additional fix for infinite recursion of deleted special
Sean Hunt [Wed, 18 May 2011 03:41:58 +0000 (03:41 +0000)]
Implement an additional fix for infinite recursion of deleted special
member functions by making sure that they're on the record before
checking for deletion.

Also make sure source locations are valid to avoid crashes.

Unfortunately, the declare-all-implicit-members approach is still
required in order to ensure that dependency loops do not result in
incorrectly deleting functions (since they are to be deleted at the
declaration point per the standard).

Fixes PR9917

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

13 years agoForce declaration of implicit members in C++0x mode.
Sean Hunt [Wed, 18 May 2011 01:06:45 +0000 (01:06 +0000)]
Force declaration of implicit members in C++0x mode.

I hear at least one person crying out in anguish, but it's unfortunately
necessary to avoid infinite loops with mutually dependent constructors
trying to call each other and determine if they are deleted.

It might be possible to go back to the old behavior if we can implement
part-of-file lookups efficiently, or if a solution is discovered by
which we can safely detect and avoid infinite recusion.

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

13 years agoAdd some support for RHEL5 systems.
Eric Christopher [Tue, 17 May 2011 23:06:53 +0000 (23:06 +0000)]
Add some support for RHEL5 systems.

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

13 years agoConditionalize the use of 4.4 or 4.2 format based on the target.
Bill Wendling [Tue, 17 May 2011 23:06:23 +0000 (23:06 +0000)]
Conditionalize the use of 4.4 or 4.2 format based on the target.
<rdar://problem/8107317>

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

13 years agoCode cleanup of my last patch.
Fariborz Jahanian [Tue, 17 May 2011 22:46:11 +0000 (22:46 +0000)]
Code cleanup of my last patch.

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

13 years agoPatch to fix IR-gen crash generating structure ABI which implements
Fariborz Jahanian [Tue, 17 May 2011 22:21:16 +0000 (22:21 +0000)]
Patch to fix IR-gen crash generating structure ABI which implements
user specified string class via -fconstant-string-class option.
pr9914.

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

13 years agoFix a nasty bug where inside StringLiteralParser:
Argyrios Kyrtzidis [Tue, 17 May 2011 22:09:56 +0000 (22:09 +0000)]
Fix a nasty bug where inside StringLiteralParser:

1. We would assume that the length of the string literal token was at least 2
2. We would allocate a buffer with size length-2

And when the stars aligned (one of which would be an invalid source location due to stale PCH)
The length would be 0 and we would try to allocate a 4GB buffer.

Add checks for this corner case and a bunch of asserts.
(We really really should have had an assert for 1.).

Note that there's no test case since I couldn't get one (it was major PITA to reproduce),
maybe later.

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

13 years agoDo some safety checks.
Argyrios Kyrtzidis [Tue, 17 May 2011 22:09:53 +0000 (22:09 +0000)]
Do some safety checks.

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

13 years agoFor calls returning first-class aggregates, store by element instead of creating...
Eli Friedman [Tue, 17 May 2011 21:08:01 +0000 (21:08 +0000)]
For calls returning first-class aggregates, store by element instead of creating aggregate stores in common cases.  This is more friendly to fast-isel.

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

13 years agoRevert r131434, my commit disabling the complete-object constructor
John McCall [Tue, 17 May 2011 21:05:49 +0000 (21:05 +0000)]
Revert r131434, my commit disabling the complete-object constructor
optimization for abstract classes;  there was a misunderstanding, and
it turns out that there are no kexts which rely on this.

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

13 years agoFix some minor bugs and add a lot more test cases for defaulted
Sean Hunt [Tue, 17 May 2011 20:44:43 +0000 (20:44 +0000)]
Fix some minor bugs and add a lot more test cases for defaulted
constructors, including two more FIXMEs (one of which I don't actually
understand).

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

13 years agoAdd some more tests.
Sean Hunt [Tue, 17 May 2011 20:44:39 +0000 (20:44 +0000)]
Add some more tests.

I have on that's #if 0'ed out, and I don't know why it's failing to
delete the constructor. I'd appreciate if someone familiar with access
control could look into ShouldDeleteDefaultConstructor - thanks.

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

13 years agoFix comment.
Rafael Espindola [Tue, 17 May 2011 19:06:58 +0000 (19:06 +0000)]
Fix comment.

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

13 years agoThe logic about -static is darwin only. For now assume that all non
Rafael Espindola [Tue, 17 May 2011 16:26:17 +0000 (16:26 +0000)]
The logic about -static is darwin only. For now assume that all non
darwin assembler can handle cfi. Add a test.

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

13 years agoRevert r131447, see if it fixes the buildbot.
Argyrios Kyrtzidis [Tue, 17 May 2011 02:17:52 +0000 (02:17 +0000)]
Revert r131447, see if it fixes the buildbot.

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

13 years agoInside isEmptyRecord function, for CXXRecordDecl just check the isEmpty bit.
Argyrios Kyrtzidis [Tue, 17 May 2011 00:46:40 +0000 (00:46 +0000)]
Inside isEmptyRecord function, for CXXRecordDecl just check the isEmpty bit.

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

13 years agoReapply the commits that r131401 reverted and add a fix for PR9927.
Argyrios Kyrtzidis [Tue, 17 May 2011 00:46:38 +0000 (00:46 +0000)]
Reapply the commits that r131401 reverted and add a fix for PR9927.

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

13 years agoSet up appropriate context for member function.
Devang Patel [Tue, 17 May 2011 00:20:09 +0000 (00:20 +0000)]
Set up appropriate context for member function.
Radar 9440721

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

13 years agoImplement some tests for defaulted constructors. To do this I had to
Sean Hunt [Tue, 17 May 2011 00:19:05 +0000 (00:19 +0000)]
Implement some tests for defaulted constructors. To do this I had to
suppress an error we were previously emitting on valid union code.

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

13 years agoFix crash on C++ code when compiling with -finstrument-functions.
Ted Kremenek [Mon, 16 May 2011 23:49:20 +0000 (23:49 +0000)]
Fix crash on C++ code when compiling with -finstrument-functions.

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

13 years agoEmit complete-object constructors for abstract classes in kext mode for
John McCall [Mon, 16 May 2011 23:34:46 +0000 (23:34 +0000)]
Emit complete-object constructors for abstract classes in kext mode for
reasons that honestly really, really need to be looked into.

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

13 years agoImplement the new C++0x rules for non-trivial things in unions so that
Sean Hunt [Mon, 16 May 2011 22:41:40 +0000 (22:41 +0000)]
Implement the new C++0x rules for non-trivial things in unions so that
my defaulted constructor tests stop yelling at me about them.

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

13 years agoPulls the common part of the clang-check example into Tooling, to allow new tools...
Manuel Klimek [Mon, 16 May 2011 21:33:46 +0000 (21:33 +0000)]
Pulls the common part of the clang-check example into Tooling, to allow new tools to be implemented without duplicating the boilerplate.

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

13 years agoMake the triple an explicit argument of FindTargetProgramPath.
Joerg Sonnenberger [Mon, 16 May 2011 13:35:02 +0000 (13:35 +0000)]
Make the triple an explicit argument of FindTargetProgramPath.
Preserve the original triple in the NetBSD toolchain when using -m32 or
-m64 and the resulting effective target is different from the triple it
started with. This allows -m32 to use the same assembler/linking in
cross-compiling mode and avoids confusion about passing down target
specific flags in that case like --32.

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

13 years agoAdd test for PR9927.
Rafael Espindola [Mon, 16 May 2011 12:42:39 +0000 (12:42 +0000)]
Add test for PR9927.

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

13 years agoRevert 131377, 131369 and 131365.
Rafael Espindola [Mon, 16 May 2011 12:30:54 +0000 (12:30 +0000)]
Revert 131377, 131369 and 131365.
131365 caused PR9927.

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

13 years agoFix another regression from the "skip vtable pointer initialization"
Anders Carlsson [Mon, 16 May 2011 04:08:36 +0000 (04:08 +0000)]
Fix another regression from the "skip vtable pointer initialization"
optimization. Make sure to require a vtable when trying to get the address
of a VTT, otherwise we would never end up emitting the VTT.

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

13 years agoStop leaving a.out files around.
John McCall [Mon, 16 May 2011 02:23:45 +0000 (02:23 +0000)]
Stop leaving a.out files around.

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

13 years agoDon't actually emit calls to the reserved global placement new and delete
John McCall [Mon, 16 May 2011 01:05:12 +0000 (01:05 +0000)]
Don't actually emit calls to the reserved global placement new and delete
operators;  their semantics are guaranteed by the language.

If someone wants to argue that freestanding compiles shouldn't recognize
this, I might be convinceable.

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

13 years agomain() exists in hosted, not freestanding implementations. Fixes the
Sean Hunt [Sun, 15 May 2011 20:59:31 +0000 (20:59 +0000)]
main() exists in hosted, not freestanding implementations. Fixes the
build.

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

13 years agoAdd a method for checking whether a function is one of the reserved global
John McCall [Sun, 15 May 2011 17:49:20 +0000 (17:49 +0000)]
Add a method for checking whether a function is one of the reserved global
placement allocation or deallocation functions.  These functions cannot be
replaced by the user and are exempt from the normal requirements on
allocation functions (e.g. that they must return unaliased memory).

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

13 years agoRe-enable the fix for PR9181 now that all the edge cases are handled.
Anders Carlsson [Sun, 15 May 2011 17:36:21 +0000 (17:36 +0000)]
Re-enable the fix for PR9181 now that all the edge cases are handled.

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

13 years agoWhen checking a set of template parameter lists against a
Douglas Gregor [Sun, 15 May 2011 17:27:27 +0000 (17:27 +0000)]
When checking a set of template parameter lists against a
nested-name-specifier, re-evaluate the nested-name-specifier as if we
were entering that context (which we did!), so that we'll resolve a
template-id to a particular class template partial
specialization. Fixes PR9913.

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

13 years agoThe array-size operand to a new-expression is not necessarily a size_t.
John McCall [Sun, 15 May 2011 07:14:44 +0000 (07:14 +0000)]
The array-size operand to a new-expression is not necessarily a size_t.
It can be larger, it can be smaller, it can be signed, whatever.  Handle
all the crazy cases with grace and spirit.

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

13 years agoFix MSVC build.
Argyrios Kyrtzidis [Sun, 15 May 2011 05:10:24 +0000 (05:10 +0000)]
Fix MSVC build.

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

13 years agoMake CGF.getContext() inlinable, because it's trivial, and optimize
John McCall [Sun, 15 May 2011 02:34:36 +0000 (02:34 +0000)]
Make CGF.getContext() inlinable, because it's trivial, and optimize
hasAggregateLLVMType.

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

13 years agoMore killing of std::vector.
John McCall [Sun, 15 May 2011 02:19:42 +0000 (02:19 +0000)]
More killing of std::vector.

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

13 years agoUse arrays and SmallVectors instead of std::vectors when building function
John McCall [Sun, 15 May 2011 01:53:33 +0000 (01:53 +0000)]
Use arrays and SmallVectors instead of std::vectors when building function
types.  Also, cache a translation of 'void' in CGM and provide a ptrdiff_t
alias.  No functionality change.

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

13 years agoDisable the optimization until the bug noticed by Sean Hunt has been fixed.
Anders Carlsson [Sun, 15 May 2011 01:50:14 +0000 (01:50 +0000)]
Disable the optimization until the bug noticed by Sean Hunt has been fixed.

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

13 years agoFix generation of obj-c @encoding for members with zero size.
Argyrios Kyrtzidis [Sun, 15 May 2011 00:11:35 +0000 (00:11 +0000)]
Fix generation of obj-c @encoding for members with zero size.
Also follow gcc in that arrays of elements with zero size are encoded as arrays with zero elements.

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

13 years agoWhen emitting the destructor for a class with a vtable, if we can determine
Anders Carlsson [Sat, 14 May 2011 23:26:09 +0000 (23:26 +0000)]
When emitting the destructor for a class with a vtable, if we can determine
that the destructor body is trivial and that all member variables also have either
trivial destructors or trivial destructor bodies, we don't need to initialize the
vtable pointers since no virtual member functions will be called on the destructor.

Fixes PR9181.

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

13 years agoLet clang-check actually use the Directory entry in the json file.
Nico Weber [Sat, 14 May 2011 21:20:23 +0000 (21:20 +0000)]
Let clang-check actually use the Directory entry in the json file.

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

13 years agoOnly perform the null-initialization of an aggregate result of a message
John McCall [Sat, 14 May 2011 21:12:11 +0000 (21:12 +0000)]
Only perform the null-initialization of an aggregate result of a message
send if the receiver is null.  Normally it's not worthwhile to check this,
but avoiding the null-initialization is nice, and this also avoids nasty
problems where the null-initialization is visible within the call because
we use an aliased result buffer.  rdar://problem/9402992

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

13 years agoCreate proper Objective-C @encoding for C++ classes; fixes rdar://9357400.
Argyrios Kyrtzidis [Sat, 14 May 2011 20:32:43 +0000 (20:32 +0000)]
Create proper Objective-C @encoding for C++ classes; fixes rdar://9357400.

Go through and expand the members of bases into the encoding string (and encode the VTable as well).
Unlike gcc which expands virtual bases as many times as they appear in the
hierarchy, clang will only expand them once at the end, to reflect the actual layout.

Note that there doesn't seem to be a way to indicate in the encoding that
packing/alignment of members is different that normal, in which case
the encoding will be out-of-sync with the real layout.
If the runtime switches to just consider the size of types without
taking into account alignment, we could easily make padding explicit in the
encoding (e.g. using arrays of chars). The encoding strings would be
longer then though.

Also encode a flexible array member as array of 0 size, like gcc, not as a pointer.

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

13 years agoEmit an error when trying to @encode an incomplete type.
Argyrios Kyrtzidis [Sat, 14 May 2011 20:32:39 +0000 (20:32 +0000)]
Emit an error when trying to @encode an incomplete type.

There are APIs, e.g. [NSValue valueWithBytes:objCType:], which use the encoding to find out
the size of an object pointed to by a pointer. Make things safer by making it illegal to @encode
incomplete types.

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

13 years agoRevert 131347. It asserts if the specialization in within a class template:
Francois Pichet [Sat, 14 May 2011 19:17:07 +0000 (19:17 +0000)]
Revert 131347. It asserts if the specialization in within a class template:

template<class U>
struct X1 {
  template<class T> void f(T*);
  template<> void f(int*) { }
};

Won't be so simple. I need to think more about it.

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

13 years agoMake sure we actually generate defaulted copy constructors; caught by
Sean Hunt [Sat, 14 May 2011 18:20:50 +0000 (18:20 +0000)]
Make sure we actually generate defaulted copy constructors; caught by
Howard Hinnant. Thanks!

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

13 years agoIn Microsoft mode, allow template function explicit specialization at class scope.
Francois Pichet [Sat, 14 May 2011 17:46:46 +0000 (17:46 +0000)]
In Microsoft mode, allow template function explicit specialization at class scope.
Necessary to parse MFC and MSVC standard lib code.

Example:
struct X {
  template<class T> void f(T) { }
  template<> void f(int) { }
}

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

13 years agoPR9908: Fix the broken fix for PR9902 to get the template argument lists in the right...
Richard Smith [Sat, 14 May 2011 15:04:18 +0000 (15:04 +0000)]
PR9908: Fix the broken fix for PR9902 to get the template argument lists in the right order.
Also, don't reject alias templates in all ElaboratedTypes: some ElaboratedTypes do not correspond to elaborated-type-specifiers.

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

13 years agoWhat I hope to be an implementation of defaulted copy assignment
Sean Hunt [Sat, 14 May 2011 05:23:28 +0000 (05:23 +0000)]
What I hope to be an implementation of defaulted copy assignment
operators.

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

13 years agoMore progress towards defaulted copy assignment
Sean Hunt [Sat, 14 May 2011 05:23:24 +0000 (05:23 +0000)]
More progress towards defaulted copy assignment

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

13 years agoStart implementing defaulted copy assignment
Sean Hunt [Sat, 14 May 2011 05:23:20 +0000 (05:23 +0000)]
Start implementing defaulted copy assignment

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

13 years agoObjective-C vtables are not taking the world by storm; call them
John McCall [Sat, 14 May 2011 03:10:52 +0000 (03:10 +0000)]
Objective-C vtables are not taking the world by storm;  call them
out as "v-table" message sends and stop calling normal messages "legacy"
message sends.

Also, fix some comments to reveal the true state of affairs.

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

13 years agoReorganize this method to avoid multiple calls for computing CGFunctionInfo
John McCall [Fri, 13 May 2011 23:16:18 +0000 (23:16 +0000)]
Reorganize this method to avoid multiple calls for computing CGFunctionInfo
and to decrease the amount of effort in appending strings.

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

13 years agoSimplify
Joerg Sonnenberger [Fri, 13 May 2011 22:58:37 +0000 (22:58 +0000)]
Simplify

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

13 years agoBug 8765: Honor assembler labels for builtins. Ensure that the label is
Joerg Sonnenberger [Fri, 13 May 2011 21:12:10 +0000 (21:12 +0000)]
Bug 8765: Honor assembler labels for builtins. Ensure that the label is
mangled to avoid doing it twice for platforms that use prefixes like
Darwin.

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

13 years agoInclude assembler label for functions in the XML dump
Joerg Sonnenberger [Fri, 13 May 2011 21:10:39 +0000 (21:10 +0000)]
Include assembler label for functions in the XML dump

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

13 years agoFix copy constructor deletion detection with array types.
Sean Hunt [Fri, 13 May 2011 21:10:11 +0000 (21:10 +0000)]
Fix copy constructor deletion detection with array types.

This fixes PR9910

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

13 years agoIntroduce __has_extension macro
Peter Collingbourne [Fri, 13 May 2011 20:54:45 +0000 (20:54 +0000)]
Introduce __has_extension macro

__has_extension is a function-like macro which takes the same set
of feature identifiers as __has_feature.  It evaluates to 1 if the
feature is supported by Clang in the current language (either as a
language extension or a standard language feature) or 0 if not.

At the same time, add support for the C1X feature identifiers
c_generic_selections (renamed from generic_selections) and
c_static_assert, and document them.

Patch by myself and Jean-Daniel Dupas.

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

13 years agoDefine __ARM_NEON__ in both ARM and Thumb modes. Radar 9431992.
Bob Wilson [Fri, 13 May 2011 18:56:03 +0000 (18:56 +0000)]
Define __ARM_NEON__ in both ARM and Thumb modes.  Radar 9431992.

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

13 years agoRemove the 'unaligned load' builtins now that they're no longer used in the *mmintrin...
Bill Wendling [Fri, 13 May 2011 18:52:28 +0000 (18:52 +0000)]
Remove the 'unaligned load' builtins now that they're no longer used in the *mmintrin.h files.

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

13 years agoProduce UTF-8 strings with -fconstant-string-class
Fariborz Jahanian [Fri, 13 May 2011 18:13:10 +0000 (18:13 +0000)]
Produce UTF-8 strings with -fconstant-string-class
-fno-constant-cfstrings. Patch by Jonathan Schleifer.

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

13 years agorefactor CheckForwardProtocolDeclarationForCircularDependency returns
Fariborz Jahanian [Fri, 13 May 2011 18:02:08 +0000 (18:02 +0000)]
refactor CheckForwardProtocolDeclarationForCircularDependency returns
'true' on detecting protocol cycles. No functionality change.

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

13 years agoAdd c-index-test printing and tests for static and virtual method
Douglas Gregor [Fri, 13 May 2011 15:54:42 +0000 (15:54 +0000)]
Add c-index-test printing and tests for static and virtual method
query functions, from Erik Verbruggen!

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

13 years agoEliminate old, useless tutorial page
Douglas Gregor [Fri, 13 May 2011 14:43:48 +0000 (14:43 +0000)]
Eliminate old, useless tutorial page

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

13 years agoDefaulting copy constructors now works reasonably well.
Sean Hunt [Fri, 13 May 2011 06:10:58 +0000 (06:10 +0000)]
Defaulting copy constructors now works reasonably well.

One more special member to go

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

13 years agosome updates.
Chris Lattner [Fri, 13 May 2011 05:29:16 +0000 (05:29 +0000)]
some updates.

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

13 years agothis never happened.
Chris Lattner [Fri, 13 May 2011 05:22:41 +0000 (05:22 +0000)]
this never happened.

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

13 years agoremove some old redirect pages. We're into our 3rd year of redirecting, the world...
Chris Lattner [Fri, 13 May 2011 05:21:33 +0000 (05:21 +0000)]
remove some old redirect pages.  We're into our 3rd year of redirecting, the world should have adjusted by now :)

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

13 years agoDelete doxygen.cfg, and use cwd-relative paths in doxygen.cfg.in.
Peter Collingbourne [Fri, 13 May 2011 03:29:06 +0000 (03:29 +0000)]
Delete doxygen.cfg, and use cwd-relative paths in doxygen.cfg.in.
Now "make doxygen" works for clang.

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

13 years agoRefactoring of constant expression evaluator
Peter Collingbourne [Fri, 13 May 2011 03:29:01 +0000 (03:29 +0000)]
Refactoring of constant expression evaluator

This introduces a generic base class for the expression evaluator
classes, which handles a few common expression types which were
previously handled separately in each class.  Also, the expression
evaluator now uses ConstStmtVisitor.

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

13 years agoAdd a ConstStmtVisitor class
Peter Collingbourne [Fri, 13 May 2011 03:28:54 +0000 (03:28 +0000)]
Add a ConstStmtVisitor class

ConstStmtVisitor is a constness-preserving variant of StmtVisitor.
ConstStmtVisitor and StmtVisitor share an implementation using a common
base class, StmtVisitorBase, which uses a template template parameter
to build pointer types.

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

13 years agoAdd 'may_alias' attribute. Noticed by Eli.
Bill Wendling [Fri, 13 May 2011 01:24:00 +0000 (01:24 +0000)]
Add 'may_alias' attribute. Noticed by Eli.

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

13 years agoWhen determining whether we can make a declaration into a global
Douglas Gregor [Fri, 13 May 2011 01:05:07 +0000 (01:05 +0000)]
When determining whether we can make a declaration into a global
constant, also consider whether it's a class type that has any mutable
fields. If so, it can't be a global constant.

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

13 years agoImplement a few basic tests for defaulted and deleted functions.
Sean Hunt [Fri, 13 May 2011 01:01:05 +0000 (01:01 +0000)]
Implement a few basic tests for defaulted and deleted functions.

More comprehensive testing once copy {constructors,assignment operators}
can be defaulted.

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

13 years agoTeach the template parameter dependency checker used when matching
Douglas Gregor [Fri, 13 May 2011 00:34:01 +0000 (00:34 +0000)]
Teach the template parameter dependency checker used when matching
template parameter lists to scope specifiers for friend declarations
about injected class name types. Fixes the
g++.dg/template/memfriend5.C regression in the GCC testsuite.

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

13 years agoImplement the __is_trivially_copyable type trait
Sean Hunt [Fri, 13 May 2011 00:31:07 +0000 (00:31 +0000)]
Implement the __is_trivially_copyable type trait

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

13 years agoRepresent the unaligned loads natively. These are converted into a call to the
Bill Wendling [Fri, 13 May 2011 00:11:39 +0000 (00:11 +0000)]
Represent the unaligned loads natively. These are converted into a call to the
correct unaligned load.

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

13 years agoImplement defaulting of destructors.
Sean Hunt [Thu, 12 May 2011 22:46:29 +0000 (22:46 +0000)]
Implement defaulting of destructors.

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

13 years agoHrm
Sean Hunt [Thu, 12 May 2011 22:46:25 +0000 (22:46 +0000)]
Hrm

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

13 years agoAdd a method to query whether or not a class has a default constructor declared.
Nick Lewycky [Thu, 12 May 2011 22:11:21 +0000 (22:11 +0000)]
Add a method to query whether or not a class has a default constructor declared.

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

13 years agoAfter issuing diagnostics on circular protocol list,
Fariborz Jahanian [Thu, 12 May 2011 22:04:39 +0000 (22:04 +0000)]
After issuing diagnostics on circular protocol list,
don't build circular AST in protocol's protocol list
when user code has introduced it. Indexer and other
clients may crash. // rdar://9221614

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

13 years agoDoug convinced me that DW_AT_APPLE_objc_complete_type is more appropriate name.
Devang Patel [Thu, 12 May 2011 21:29:57 +0000 (21:29 +0000)]
Doug convinced me that DW_AT_APPLE_objc_complete_type is more appropriate name.
s/DW_AT_APPLE_objc_class_extension/DW_AT_APPLE_objc_complete_type/g

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

13 years agoDo not add AT_APPLE_objc_class_extension attribute if @implementation is not seen.
Devang Patel [Thu, 12 May 2011 21:14:54 +0000 (21:14 +0000)]
Do not add AT_APPLE_objc_class_extension attribute if @implementation is not seen.

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

13 years agoenable __has_feature(is_standard_layout)
Howard Hinnant [Thu, 12 May 2011 19:52:14 +0000 (19:52 +0000)]
enable __has_feature(is_standard_layout)

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

13 years agoUse DW_AT_APPLE_objc_class_extension attribute to identify interfaces that represent...
Devang Patel [Thu, 12 May 2011 19:07:41 +0000 (19:07 +0000)]
Use DW_AT_APPLE_objc_class_extension attribute to identify interfaces that represent class extension.
Radar 9423077.

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

13 years agoLLVM doesn't always optimize away the four loads from this:
Bill Wendling [Thu, 12 May 2011 19:02:15 +0000 (19:02 +0000)]
LLVM doesn't always optimize away the four loads from this:

     (__m128){ p[0], p[1], p[2], p[3] }

which produces really bad code. This could be done in instcombine, but it's
probably better to do it in the front-end instead.
<rdar://problem/9424836>

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

13 years agoAdd clang_CXXMethod_isVirtual() to libclang, from Erik Verbruggen!
Douglas Gregor [Thu, 12 May 2011 15:17:24 +0000 (15:17 +0000)]
Add clang_CXXMethod_isVirtual() to libclang, from Erik Verbruggen!

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

13 years agoProperly parse the 'default' and 'delete' keywords.
Sean Hunt [Thu, 12 May 2011 06:15:49 +0000 (06:15 +0000)]
Properly parse the 'default' and 'delete' keywords.

They are actually grammatically considered definitions and parsed
accordingly.

This fixes the outstanding bugs regarding defaulting functions after
their declarations.

We now really nicely diagnose the following construct (try it!)

int foo() = delete, bar;

Still todo: Defaulted functions other than default constructors
            Test cases (including for the above construct)

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

13 years agoMake it so that we actually generate definitions for explicitly
Sean Hunt [Thu, 12 May 2011 03:51:51 +0000 (03:51 +0000)]
Make it so that we actually generate definitions for explicitly
defaulted default constructors.

As it happens, making sure that we handle out-of-line defaulted
functions properly will involved making sure that we actually parse them
correctly, so that's coming after.

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

13 years agoImplement deletion of explicitly defaulted default constructors.
Sean Hunt [Thu, 12 May 2011 03:51:48 +0000 (03:51 +0000)]
Implement deletion of explicitly defaulted default constructors.

We still don't parse out-of-line defaults correctly, which is needed to
get the full effect out of this patch.

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

13 years agoFix crasher spotted in IWYU.
Nick Lewycky [Thu, 12 May 2011 03:51:24 +0000 (03:51 +0000)]
Fix crasher spotted in IWYU.

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

13 years agoPR9899: handle pseudo-destructors correctly in noexcept() expressions.
Eli Friedman [Thu, 12 May 2011 02:11:32 +0000 (02:11 +0000)]
PR9899: handle pseudo-destructors correctly in noexcept() expressions.

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

13 years agoMake this code more resilient against catch variables which need cleanups.
John McCall [Thu, 12 May 2011 01:00:15 +0000 (01:00 +0000)]
Make this code more resilient against catch variables which need cleanups.

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

13 years agoFix typo in comment.
Nick Lewycky [Thu, 12 May 2011 00:12:46 +0000 (00:12 +0000)]
Fix typo in comment.

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

13 years agoFix PR9902: correctly substitute alias templates within the template in which they...
Richard Smith [Thu, 12 May 2011 00:06:17 +0000 (00:06 +0000)]
Fix PR9902: correctly substitute alias templates within the template in which they are defined: provide an empty list of arguments for each containing template context during substitution.

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

13 years agoImplement CWG1170, which makes access-control errors into template
Douglas Gregor [Wed, 11 May 2011 23:45:11 +0000 (23:45 +0000)]
Implement CWG1170, which makes access-control errors into template
argument deduction failures. Only implemented in C++0x, since this is
a significant change in behavior from C++98/03.

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

13 years agoWhen checking for the necessary 'template<>' headers based on the
Douglas Gregor [Wed, 11 May 2011 23:26:17 +0000 (23:26 +0000)]
When checking for the necessary 'template<>' headers based on the
nested of an out-of-line declaration, only require a 'template<>'
header for each enclosing class template that hasn't been previously
specialized; previously, we were requiring 'template<>' for enclosing
class templates and members of class templates that hadn't been
previously specialized. Fixes <rdar://problem/9422013>.

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

13 years agoPlace "conflicting distributed object modifiers..." warnings under a -W flag.
Ted Kremenek [Wed, 11 May 2011 23:06:50 +0000 (23:06 +0000)]
Place "conflicting distributed object modifiers..." warnings under a -W flag.

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