]> granicus.if.org Git - clang/log
clang
13 years agoFix PR9941 for out-of-line template destructors too.
Sebastian Redl [Fri, 20 May 2011 05:57:18 +0000 (05:57 +0000)]
Fix PR9941 for out-of-line template destructors too.

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

13 years agoUndo enough of r131143 to make private copy ctor diags say "copy constructor" again
Matt Beaumont-Gay [Thu, 19 May 2011 23:44:42 +0000 (23:44 +0000)]
Undo enough of r131143 to make private copy ctor diags say "copy constructor" again

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

13 years agoTeach RegionStore not to symbolic array values whose indices it cannot reason about.
Ted Kremenek [Thu, 19 May 2011 23:37:58 +0000 (23:37 +0000)]
Teach RegionStore not to symbolic array values whose indices it cannot reason about.

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

13 years agoFix location of setter/getter synthesized for a property.
Devang Patel [Thu, 19 May 2011 23:37:41 +0000 (23:37 +0000)]
Fix location of setter/getter synthesized for a property.

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

13 years agoRevert r131672 until __underlying_type is properly implemented in the
Sean Hunt [Thu, 19 May 2011 22:52:25 +0000 (22:52 +0000)]
Revert r131672 until __underlying_type is properly implemented in the
template case.

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

13 years agoFix test on Windows.
Eli Friedman [Thu, 19 May 2011 22:39:47 +0000 (22:39 +0000)]
Fix test on Windows.

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

13 years agoImplement a __has_feature for __underlying_type
Sean Hunt [Thu, 19 May 2011 20:48:13 +0000 (20:48 +0000)]
Implement a __has_feature for __underlying_type

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

13 years agoCorrection for r131662, the GNU as option is --fatal-warnings.
Joerg Sonnenberger [Thu, 19 May 2011 20:46:39 +0000 (20:46 +0000)]
Correction for r131662, the GNU as option is --fatal-warnings.

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

13 years agoAdd a test for __underlying_type
Sean Hunt [Thu, 19 May 2011 20:36:08 +0000 (20:36 +0000)]
Add a test for __underlying_type

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

13 years agoSupport -fatal-warnings for the assembler frontend
Joerg Sonnenberger [Thu, 19 May 2011 18:42:29 +0000 (18:42 +0000)]
Support -fatal-warnings for the assembler frontend

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

13 years agoFix PR9941 again, this time for templates.
Sebastian Redl [Thu, 19 May 2011 16:25:27 +0000 (16:25 +0000)]
Fix PR9941 again, this time for templates.

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

13 years ago- Fixes openSUSE detection for 11.4 and upcoming 12.1
David Chisnall [Thu, 19 May 2011 13:26:33 +0000 (13:26 +0000)]
- Fixes openSUSE detection for 11.4 and upcoming 12.1
- Adds gcc 4.6 to gcc list so that linking will work on openSUSE 12.1

Patch by İsmail Dönmez!

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

13 years agoAdd paths used by openSuSE 12.1
David Chisnall [Thu, 19 May 2011 12:04:49 +0000 (12:04 +0000)]
Add paths used by openSuSE 12.1

Patch by Ismail Dönmez!

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

13 years agoImplement __underlying_type for libc++.
Sean Hunt [Thu, 19 May 2011 05:37:45 +0000 (05:37 +0000)]
Implement __underlying_type for libc++.

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

13 years agoReapply r121528, fixing PR9941 by delaying the exception specification check for...
Sebastian Redl [Thu, 19 May 2011 05:13:44 +0000 (05:13 +0000)]
Reapply r121528, fixing PR9941 by delaying the exception specification check for destructors until the class is complete and destructors have been adjusted.

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

13 years agoTeach static analyzer to analyze Objective-C methods in category implementations.
Ted Kremenek [Thu, 19 May 2011 00:56:53 +0000 (00:56 +0000)]
Teach static analyzer to analyze Objective-C methods in category implementations.

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

13 years agoMake __builtin_shufflevector and -ftrapv work correctly together. PR9945.
Eli Friedman [Thu, 19 May 2011 00:37:32 +0000 (00:37 +0000)]
Make __builtin_shufflevector and -ftrapv work correctly together.  PR9945.

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

13 years agoAfter consultation with doug, revert r131515.
Sean Hunt [Wed, 18 May 2011 20:57:13 +0000 (20:57 +0000)]
After consultation with doug, revert r131515.

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

13 years agoRevert r121528 as it breaks a simple testcase, which leads to, among
Sean Hunt [Wed, 18 May 2011 20:57:11 +0000 (20:57 +0000)]
Revert r121528 as it breaks a simple testcase, which leads to, among
other things, libcxx not building.

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

13 years agoAdd ARMTargetCodeGenInfo::initDwarfEHRegSizeTable() defining 16 32bit regs.
Roman Divacky [Wed, 18 May 2011 19:36:54 +0000 (19:36 +0000)]
Add ARMTargetCodeGenInfo::initDwarfEHRegSizeTable() defining 16 32bit regs.

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

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