]> granicus.if.org Git - clang/log
clang
12 years agoUpdate all tests other than Driver/std.cpp to use -std=c++11 rather than
Richard Smith [Thu, 13 Oct 2011 22:29:44 +0000 (22:29 +0000)]
Update all tests other than Driver/std.cpp to use -std=c++11 rather than
-std=c++0x. Patch by Ahmed Charles!

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

12 years agoImplement the first piece of a -Wc++98-compat flag so that people can build in
Jeffrey Yasskin [Thu, 13 Oct 2011 22:18:05 +0000 (22:18 +0000)]
Implement the first piece of a -Wc++98-compat flag so that people can build in
C++11 mode but keep their sources compatible with C++98.  This patch implements
the -Wc++98-compat-variadic-templates sub-flag and -Wc++98-compat to include
it.

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

12 years agoRecommit:
Eric Christopher [Thu, 13 Oct 2011 21:45:18 +0000 (21:45 +0000)]
Recommit:

    Start handling debug line and scope information better:

    Migrate most of the location setting within the larger API in CGDebugInfo and
    update a lot of callers.
    Remove the existing file/scope change machinery in UpdateLineDirectiveRegion
    and replace it with DILexicalBlockFile usage.

    Finishes off the rest of rdar://10246360

after fixing a few bugs that were exposed in gdb testsuite testing.

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

12 years agoAdd test for new -std=c++11 and -std=gnu++11 command-line arguments.
Richard Smith [Thu, 13 Oct 2011 21:32:47 +0000 (21:32 +0000)]
Add test for new -std=c++11 and -std=gnu++11 command-line arguments.

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

12 years agoAdd triple for RHEL 5 to the libpath collecting logic.
Benjamin Kramer [Thu, 13 Oct 2011 20:45:37 +0000 (20:45 +0000)]
Add triple for RHEL 5 to the libpath collecting logic.

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

12 years agoTweak -Wuninitialized's handling of 'int x = x' to report that as the root cause...
Ted Kremenek [Thu, 13 Oct 2011 18:50:06 +0000 (18:50 +0000)]
Tweak -Wuninitialized's handling of 'int x = x' to report that as the root cause of an uninitialized variable IFF there are other uses of that uninitialized variable.  Fixes <rdar://problem/9259237>.

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

12 years agoHasFormOfMemberPointer implies IsAddressOfOperand for an overload set. Simplify
Douglas Gregor [Thu, 13 Oct 2011 18:26:27 +0000 (18:26 +0000)]
HasFormOfMemberPointer implies IsAddressOfOperand for an overload set. Simplify

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

12 years agoAllow calling an overloaded function set by taking the address of the
Douglas Gregor [Thu, 13 Oct 2011 18:10:35 +0000 (18:10 +0000)]
Allow calling an overloaded function set by taking the address of the
functions, e.g., (&f)(0). Fixes <rdar://problem/9803316>.

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

12 years agoTCE target: conversion of OpenCL reqd_work_group_size attr to metadata
Peter Collingbourne [Thu, 13 Oct 2011 16:24:41 +0000 (16:24 +0000)]
TCE target: conversion of OpenCL reqd_work_group_size attr to metadata

Patch by Pekka Jääskeläinen!

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

12 years agoAllow for annotate attributes after access specifiers. When such
Erik Verbruggen [Thu, 13 Oct 2011 09:41:32 +0000 (09:41 +0000)]
Allow for annotate attributes after access specifiers. When such
attributes are found, propagate them to subsequent declarations.

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

12 years agoFix crash-on-invalid, improve error recovery, and test coverage for missing colon...
David Blaikie [Thu, 13 Oct 2011 06:08:43 +0000 (06:08 +0000)]
Fix crash-on-invalid, improve error recovery, and test coverage for missing colon after access specifiers in C++

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

12 years agoFix MSVC build.
Rafael Espindola [Wed, 12 Oct 2011 23:56:54 +0000 (23:56 +0000)]
Fix MSVC build.

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

12 years agoWhen we determine that a function template specialization produced as
Douglas Gregor [Wed, 12 Oct 2011 20:35:48 +0000 (20:35 +0000)]
When we determine that a function template specialization produced as
part of template argument deduction is ill-formed, we mark it as
invalid and treat it as a deduction failure. If we happen to find that
specialization again, treat it as a deduction failure rather than
silently building a call to the declaration.

Fixes PR11117, a marvelous bug where deduction failed after creating
an invalid specialization, causing overload resolution to pick a
different candidate. Then we performed a similar overload resolution
later, and happily picked the invalid specialization to
call... resulting in a silent link failure.

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

12 years agoAdd test case for __has_warning.
Ted Kremenek [Wed, 12 Oct 2011 20:06:09 +0000 (20:06 +0000)]
Add test case for __has_warning.

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

12 years agoChange __extension__ to disable only diagnostics controlled by -pedantic.
Bob Wilson [Wed, 12 Oct 2011 19:55:31 +0000 (19:55 +0000)]
Change __extension__ to disable only diagnostics controlled by -pedantic.

This changes clang to match GCC's behavior for __extension__, which temporarily
disables the -pedantic flag.  Warnings that are enabled without -pedantic
are not affected.  Besides the general goodness of matching GCC's precedent,
my motivation for this is that macros in the arm_neon.h header need to use
__extension__ to avoid pedantic complaints about their use of statement
expressions, yet we still want to warn about incompatible pointer arguments
for those macros.

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

12 years agoAdd returns_twice to functions that are known to return twice. This implements
Rafael Espindola [Wed, 12 Oct 2011 19:51:18 +0000 (19:51 +0000)]
Add returns_twice to functions that are known to return twice. This implements
the same behavior of gcc by keeping the attribute out of the function type.

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

12 years agoImplement built-in macro '__has_warning', which allows one to query if a warning...
Ted Kremenek [Wed, 12 Oct 2011 19:46:30 +0000 (19:46 +0000)]
Implement built-in macro '__has_warning', which allows one to query if a warning flag is valid.  Fixes <rdar://problem/10263428>.

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

12 years agoSwitch diagnostic text from "C++0x" over to "C++11".
Douglas Gregor [Wed, 12 Oct 2011 19:26:40 +0000 (19:26 +0000)]
Switch diagnostic text from "C++0x" over to "C++11".

We'd also like for "C++11" or "c++11" to be used for the warning
groups, but without removing the old warning flags. Patches welcome;
I've run out of time to work on this today.

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

12 years agoWe do parse hexfloats in C++11; make it actually work.
Douglas Gregor [Wed, 12 Oct 2011 18:51:02 +0000 (18:51 +0000)]
We do parse hexfloats in C++11; make it actually work.

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

12 years agoRevert file/scope handling patches. gdb testing revealed a couple of bugs.
Eric Christopher [Wed, 12 Oct 2011 18:39:35 +0000 (18:39 +0000)]
Revert file/scope handling patches. gdb testing revealed a couple of bugs.

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

12 years agoThe Objective-C rewriter uses the fragile ABI, always.
Douglas Gregor [Wed, 12 Oct 2011 18:28:53 +0000 (18:28 +0000)]
The Objective-C rewriter uses the fragile ABI, always.

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

12 years agoFix typo in name of diagnostic.
Ted Kremenek [Wed, 12 Oct 2011 18:03:37 +0000 (18:03 +0000)]
Fix typo in name of diagnostic.

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

12 years agoHandle the case where preprocessor entities are not received in order,
Argyrios Kyrtzidis [Wed, 12 Oct 2011 17:36:33 +0000 (17:36 +0000)]
Handle the case where preprocessor entities are not received in order,
fixes http://llvm.org/PR11120

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

12 years agoAdd -std=c++11 and -std=gnu++11 language flags, from Ahmed Charles
Douglas Gregor [Wed, 12 Oct 2011 17:32:39 +0000 (17:32 +0000)]
Add -std=c++11 and -std=gnu++11 language flags, from Ahmed Charles

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

12 years agoIntroduce BalancedDelimiterTracker, to better track open/close
Douglas Gregor [Wed, 12 Oct 2011 16:37:45 +0000 (16:37 +0000)]
Introduce BalancedDelimiterTracker, to better track open/close
delimiter pairs and detect when we exceed the implementation limit for
nesting depth, from Aaron Ballman!

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

12 years agoTeach __has_nothrow_assign not to complain about access (GCC and EDG
Douglas Gregor [Wed, 12 Oct 2011 15:40:49 +0000 (15:40 +0000)]
Teach __has_nothrow_assign not to complain about access (GCC and EDG
ignore access entirely for it) and not to crash on assignment operator
templates. Fixes PR11110.

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

12 years agoRemoved extra line in comment.
Jim Goodnow II [Wed, 12 Oct 2011 09:55:01 +0000 (09:55 +0000)]
Removed extra line in comment.

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

12 years agoAdd target info for Linux on PPC & Sparc.
Anton Korobeynikov [Wed, 12 Oct 2011 09:30:58 +0000 (09:30 +0000)]
Add target info for Linux on PPC & Sparc.
Patch by Hal Finkel!

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

12 years agoIntroduce SourceManager::getFileLoc which returns a file location
Argyrios Kyrtzidis [Wed, 12 Oct 2011 07:07:40 +0000 (07:07 +0000)]
Introduce SourceManager::getFileLoc which returns a file location
taking into account macro arguments.

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

12 years ago[libclang] Allow using getDeclCursorUSR function with a Decl* and not a cursor.
Argyrios Kyrtzidis [Wed, 12 Oct 2011 07:07:36 +0000 (07:07 +0000)]
[libclang] Allow using getDeclCursorUSR function with a Decl* and not a cursor.

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

12 years ago[libclang] Make MakeCXTranslationUnit usable outside CIndex.cpp.
Argyrios Kyrtzidis [Wed, 12 Oct 2011 07:07:33 +0000 (07:07 +0000)]
[libclang] Make MakeCXTranslationUnit usable outside CIndex.cpp.

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

12 years agoconstexpr: don't consider class types with mutable members to be literal types.
Richard Smith [Wed, 12 Oct 2011 05:08:15 +0000 (05:08 +0000)]
constexpr: don't consider class types with mutable members to be literal types.

The standard doesn't allow this, but mutable constexpr variables break the
semantics so badly that we can't reasonably accept them.

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

12 years agoRemember to set the location in EmitGlobalVariable to the current decl
Eric Christopher [Wed, 12 Oct 2011 01:11:30 +0000 (01:11 +0000)]
Remember to set the location in EmitGlobalVariable to the current decl
if we're going to delete the setLocation as we did in 141732.

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

12 years agoHandle Perforce-style conflict markers like normal conflict markers. Perforce
Richard Smith [Wed, 12 Oct 2011 00:37:51 +0000 (00:37 +0000)]
Handle Perforce-style conflict markers like normal conflict markers. Perforce
swaps over the <<<< and >>>> markers, and uses shorter markers than traditional
tools.

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

12 years agoobjc: note location of the previously declared
Fariborz Jahanian [Wed, 12 Oct 2011 00:00:57 +0000 (00:00 +0000)]
objc: note location of the previously declared
property in the diagnostic.

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

12 years agoCatch placeholder types in DefaultLvalueConversion
John McCall [Tue, 11 Oct 2011 23:14:30 +0000 (23:14 +0000)]
Catch placeholder types in DefaultLvalueConversion
and DefaultFunctionArrayLvalueConversion.  To prevent
significant regression for should-this-be-a-call fixits,
and to repair some such regression from the introduction of
bound member placeholders, make those placeholder checks
try to build calls appropriately.  Harden the build-a-call
logic while we're at it.

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

12 years agoobjc rewriter: Restore objc_msgSend_stret/objc_msgSendSuper_stret declaration
Fariborz Jahanian [Tue, 11 Oct 2011 23:02:37 +0000 (23:02 +0000)]
objc rewriter: Restore objc_msgSend_stret/objc_msgSendSuper_stret declaration
to their fragile-abi representation.

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

12 years agoStart handling debug line and scope information better:
Eric Christopher [Tue, 11 Oct 2011 23:00:55 +0000 (23:00 +0000)]
Start handling debug line and scope information better:

Migrate most of the location setting within the larger API in CGDebugInfo and
update a lot of callers.
Remove the existing file/scope change machinery in UpdateLineDirectiveRegion
and replace it with DILexicalBlockFile usage.

Finishes off the rest of rdar://10246360

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

12 years ago80-column and tab cleanup.
Eric Christopher [Tue, 11 Oct 2011 23:00:51 +0000 (23:00 +0000)]
80-column and tab cleanup.

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

12 years agoReorder this to make it easier to add more changes for a location set.
Eric Christopher [Tue, 11 Oct 2011 23:00:45 +0000 (23:00 +0000)]
Reorder this to make it easier to add more changes for a location set.

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

12 years agoPR11062: Make C99 inlining work properly for names with associated builtin libcalls.
Eli Friedman [Tue, 11 Oct 2011 22:09:24 +0000 (22:09 +0000)]
PR11062: Make C99 inlining work properly for names with associated builtin libcalls.

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

12 years agoFix test: don't use __thread without a target triple.
Richard Smith [Tue, 11 Oct 2011 21:51:31 +0000 (21:51 +0000)]
Fix test: don't use __thread without a target triple.

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

12 years agoConstant expression evaluation: refactor value initialization and scalar list initial...
Richard Smith [Tue, 11 Oct 2011 21:43:33 +0000 (21:43 +0000)]
Constant expression evaluation: refactor value initialization and scalar list initialization into base class.

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

12 years agoSilence some -Wuninitialized false positives with gcc.
Eli Friedman [Tue, 11 Oct 2011 20:00:47 +0000 (20:00 +0000)]
Silence some -Wuninitialized false positives with gcc.

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

12 years agoAdd a -Wc++0x-compat warning for C++11 keywords used as identifiers when in
Richard Smith [Tue, 11 Oct 2011 19:57:52 +0000 (19:57 +0000)]
Add a -Wc++0x-compat warning for C++11 keywords used as identifiers when in
C++98 mode. Only the first occurrence of each keyword will produce a warning.

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

12 years agoAdd support for viewing the module graph via Graphviz, for debugging
Douglas Gregor [Tue, 11 Oct 2011 19:27:55 +0000 (19:27 +0000)]
Add support for viewing the module graph via Graphviz, for debugging
purposes.

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

12 years agoDriver: Add support for a new -nostdlibinc option.
Daniel Dunbar [Tue, 11 Oct 2011 18:20:16 +0000 (18:20 +0000)]
Driver: Add support for a new -nostdlibinc option.
 - This disables the system include directories, but not the compiler builtin
   directories. Useful for projects that want to use things like the intrinsic
   headers, but are otherwise freestanding.

 - I'm willing to reconsider the option naming, I also considered providing an
   explicit -builtinc (which would match -nobuiltininc), but this is more
   consistent with existing options.

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

12 years agoFrontend: Replace -nostdinc by -nostdsysteminc (which is just system include
Daniel Dunbar [Tue, 11 Oct 2011 18:20:10 +0000 (18:20 +0000)]
Frontend: Replace -nostdinc by -nostdsysteminc (which is just system include
paths). The -nostdinc behavior is now -nostdsysteminc + -nobuiltininc.

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

12 years ago[analyzer] Remove an unused member variable.
Anna Zaks [Tue, 11 Oct 2011 18:19:20 +0000 (18:19 +0000)]
[analyzer] Remove an unused member variable.

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

12 years agoRename SemaCXXCast.cpp to SemaCast.cpp.
John McCall [Tue, 11 Oct 2011 17:38:55 +0000 (17:38 +0000)]
Rename SemaCXXCast.cpp to SemaCast.cpp.

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

12 years agoAdd more testing for -Wc++0x-compat warnings.
Richard Smith [Tue, 11 Oct 2011 17:38:48 +0000 (17:38 +0000)]
Add more testing for -Wc++0x-compat warnings.

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

12 years ago[analyzer] CheckerContext updates checkDst in it's destructor, so make sure the objec...
Anna Zaks [Tue, 11 Oct 2011 17:29:59 +0000 (17:29 +0000)]
[analyzer] CheckerContext updates checkDst in it's destructor, so make sure the object is destructed before checkDst is used.

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

12 years agoFor the FileChanged Preprocessor callback, when exiting a file, pass its FileID.
Argyrios Kyrtzidis [Tue, 11 Oct 2011 17:29:44 +0000 (17:29 +0000)]
For the FileChanged Preprocessor callback, when exiting a file, pass its FileID.

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

12 years agoAdd an explanatory comment to test/SemaCXX/typo-correction.cpp
Kaelyn Uhrain [Tue, 11 Oct 2011 17:17:40 +0000 (17:17 +0000)]
Add an explanatory comment to test/SemaCXX/typo-correction.cpp

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

12 years ago[analyzer] Fix a typo.
Anna Zaks [Tue, 11 Oct 2011 16:49:54 +0000 (16:49 +0000)]
[analyzer] Fix a typo.

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

12 years agoGet rid of ShouldDeleteMoveConstructor.
Sean Hunt [Tue, 11 Oct 2011 06:43:29 +0000 (06:43 +0000)]
Get rid of ShouldDeleteMoveConstructor.

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

12 years agoConsolidate copy constructor deletion into ShouldDeleteSpecialMember.
Sean Hunt [Tue, 11 Oct 2011 04:55:36 +0000 (04:55 +0000)]
Consolidate copy constructor deletion into ShouldDeleteSpecialMember.

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

12 years ago[analyzer] Warn about the use of insecure, deprecated vfork() function PR11053 (http...
Anna Zaks [Tue, 11 Oct 2011 04:34:54 +0000 (04:34 +0000)]
[analyzer] Warn about the use of insecure, deprecated vfork() function PR11053 (http://llvm.org/bugs/show_bug.cgi?id=11053).

A patch by Graham Lee!

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

12 years agoAllow regparm attribute for PNaCl target
David Meyer [Tue, 11 Oct 2011 03:12:01 +0000 (03:12 +0000)]
Allow regparm attribute for PNaCl target

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

12 years agoInitial implementation of __atomic_* (everything except __atomic_is_lock_free).
Eli Friedman [Tue, 11 Oct 2011 02:20:01 +0000 (02:20 +0000)]
Initial implementation of __atomic_* (everything except __atomic_is_lock_free).

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

12 years ago[Microsoft] If -fms-compatibility, then downgrade missing typename error to warning...
Francois Pichet [Tue, 11 Oct 2011 01:50:09 +0000 (01:50 +0000)]
[Microsoft] If -fms-compatibility, then downgrade missing typename error to warning at function prototype scope.

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

12 years agoAdded natural stack alignment to target-data.c test case.
Lang Hames [Tue, 11 Oct 2011 01:06:28 +0000 (01:06 +0000)]
Added natural stack alignment to target-data.c test case.

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

12 years agoAdd typo correction for type names.
Kaelyn Uhrain [Tue, 11 Oct 2011 01:02:41 +0000 (01:02 +0000)]
Add typo correction for type names.

The main motivation was to do typo correction in C++ "new" statements,
though picking it up in other places where type names are expected was
pretty much a freebie.

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

12 years agoPlace diagnostic group ext_typecheck_decl_incomplete_type under a -W flag.
Ted Kremenek [Tue, 11 Oct 2011 01:02:24 +0000 (01:02 +0000)]
Place diagnostic group ext_typecheck_decl_incomplete_type under a -W flag.

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

12 years agoFixed natural stack alignment for Linux x86-32. Thanks Eli.
Lang Hames [Tue, 11 Oct 2011 00:52:51 +0000 (00:52 +0000)]
Fixed natural stack alignment for Linux x86-32. Thanks Eli.

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

12 years agoClean up DiagnoseInvalidRedeclaration a bit
Kaelyn Uhrain [Tue, 11 Oct 2011 00:28:52 +0000 (00:28 +0000)]
Clean up DiagnoseInvalidRedeclaration a bit

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

12 years agoMove a couple chunks of ActOnFunctionDeclarator to separate functions
Kaelyn Uhrain [Tue, 11 Oct 2011 00:28:49 +0000 (00:28 +0000)]
Move a couple chunks of ActOnFunctionDeclarator to separate functions

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

12 years agoMove some bool flags out of function parameter lists.
Kaelyn Uhrain [Tue, 11 Oct 2011 00:28:45 +0000 (00:28 +0000)]
Move some bool flags out of function parameter lists.

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

12 years agoOnly accept a typo correction if it doesn't trigger additional errors
Kaelyn Uhrain [Tue, 11 Oct 2011 00:28:39 +0000 (00:28 +0000)]
Only accept a typo correction if it doesn't trigger additional errors

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

12 years agoExtend lvalue evaluation in ExprConstant.cpp to handle CK_LValueBitCast (which is...
Eli Friedman [Tue, 11 Oct 2011 00:13:24 +0000 (00:13 +0000)]
Extend lvalue evaluation in ExprConstant.cpp to handle CK_LValueBitCast (which is completely trivial).  PR8836.

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

12 years agoUpdate target data strings for ARM and X86 to include the natural stack
Lang Hames [Mon, 10 Oct 2011 23:44:43 +0000 (23:44 +0000)]
Update target data strings for ARM and X86 to include the natural stack
alignment parameter "S<size>" that was introduced in r141599.

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

12 years agoDon't crash in Sema::IsSimplyAccessible if the declaration is not a C++ class member...
Douglas Gregor [Mon, 10 Oct 2011 23:44:35 +0000 (23:44 +0000)]
Don't crash in Sema::IsSimplyAccessible if the declaration is not a C++ class member. Fixes PR11108.

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

12 years agoMake sure we initialize the "extra" data within the libclang code
Douglas Gregor [Mon, 10 Oct 2011 23:37:54 +0000 (23:37 +0000)]
Make sure we initialize the "extra" data within the libclang code
completion context, in case we end up having no code-completion
callback. Individual instances of this problem are always bugs that
need to be fixed, but it's better to make sure we have initialized
data here.

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

12 years agoA couple random preprocessor changes that got ported from C99 to C++11.
Eli Friedman [Mon, 10 Oct 2011 23:35:28 +0000 (23:35 +0000)]
A couple random preprocessor changes that got ported from C99 to C++11.

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

12 years agoWhen performing a user-defined conversion via a constructor, be sure
Douglas Gregor [Mon, 10 Oct 2011 22:41:00 +0000 (22:41 +0000)]
When performing a user-defined conversion via a constructor, be sure
to check whether the constructor is accessible. Fixes
<rdar://problem/10202900>.

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

12 years ago[analyzer] Teach the static analyzer about CXXForRangeStmt. Patch by Jim Goodnow II!
Ted Kremenek [Mon, 10 Oct 2011 22:36:31 +0000 (22:36 +0000)]
[analyzer] Teach the static analyzer about CXXForRangeStmt.  Patch by Jim Goodnow II!

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

12 years agoRework construction of CXXForRangeStmt not to recycle the same DeclRefExpr in multipl...
Ted Kremenek [Mon, 10 Oct 2011 22:36:28 +0000 (22:36 +0000)]
Rework construction of CXXForRangeStmt not to recycle the same DeclRefExpr in multiple subexpressions.  This breaks the tree structure
of the AST and completely breaks the CFG invariants.

Patch by Jim Goodnow II and reviewed by Richard Smith!

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

12 years ago[libclang] Do ConcurrencyCheck for clang_getLocation as well.
Argyrios Kyrtzidis [Mon, 10 Oct 2011 21:57:15 +0000 (21:57 +0000)]
[libclang] Do ConcurrencyCheck for clang_getLocation as well.

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

12 years ago[libclang] Implement ConcurrencyCheck using a recursive mutex to allow re-entrancy...
Argyrios Kyrtzidis [Mon, 10 Oct 2011 21:57:12 +0000 (21:57 +0000)]
[libclang] Implement ConcurrencyCheck using a recursive mutex to allow re-entrancy in the same thread.
The checks are performed only in DEBUG, it becomes no-op in release mode.

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

12 years agoobjc: err on a property designated both atomic and
Fariborz Jahanian [Mon, 10 Oct 2011 21:53:24 +0000 (21:53 +0000)]
objc: err on a property designated both atomic and
nonatomic. // rdar://10260017

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

12 years agoRevert r140009, about disabling clang's builtin in -fms-compatibility mode.
Francois Pichet [Mon, 10 Oct 2011 20:34:10 +0000 (20:34 +0000)]
Revert r140009, about disabling clang's builtin in -fms-compatibility mode.

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

12 years agoLink in Scrt1.o instead of crt1.o when -pie is specified.
Roman Divacky [Mon, 10 Oct 2011 19:47:45 +0000 (19:47 +0000)]
Link in Scrt1.o instead of crt1.o when -pie is specified.

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

12 years agoWhen substituting into a sizeof parameter pack expression in a context
Douglas Gregor [Mon, 10 Oct 2011 18:59:29 +0000 (18:59 +0000)]
When substituting into a sizeof parameter pack expression in a context
where we can't expand (i.e., multi-level substitution), be sure to
substitute the pack with its level-reduced pack. Fixes PR10230.

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

12 years agoPartially revert r141374: allow use of libc++ prior to Mac OS X 10.7.
Bob Wilson [Mon, 10 Oct 2011 18:46:10 +0000 (18:46 +0000)]
Partially revert r141374: allow use of libc++ prior to Mac OS X 10.7.

Apple only supports libc++ on OS X 10.7 and later but for the open-source
compiler that restriction doesn't make sense.

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

12 years agoWhen an included non-system directory duplicates a system directory the clang
Chad Rosier [Mon, 10 Oct 2011 18:44:24 +0000 (18:44 +0000)]
When an included non-system directory duplicates a system directory the clang
frontend removes the non-system directory to maintain gcc compatibility.  When
this happens NumAngled needs to be updated.
PR11097

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

12 years agoConstant expression evaluation refactoring:
Richard Smith [Mon, 10 Oct 2011 18:28:20 +0000 (18:28 +0000)]
Constant expression evaluation refactoring:
 - Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions,
   and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert
   behaviour.
 - Factor out evaluation of bitfield bit widths.
 - Fix a few places which would evaluate an expression twice: once to determine
   whether it is a constant expression, then again to get the value.

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

12 years agoDon't suggest 'noreturn' for function template instantiations, because
Douglas Gregor [Mon, 10 Oct 2011 18:15:57 +0000 (18:15 +0000)]
Don't suggest 'noreturn' for function template instantiations, because
it might be wrong for other instantiations of the same function
template. Fixes PR10801.

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

12 years agoNow that we support move generation, mention this in the language extension and C...
Sebastian Redl [Mon, 10 Oct 2011 18:10:00 +0000 (18:10 +0000)]
Now that we support move generation, mention this in the language extension and C++ status pages. Also update the C++ status for default functions, which are complete now that we can generate move functions, and destructor exception specifications, which I did a while ago.

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

12 years agoGive nicer note when a member redeclaration has or lacks 'const'
Kaelyn Uhrain [Mon, 10 Oct 2011 18:01:37 +0000 (18:01 +0000)]
Give nicer note when a member redeclaration has or lacks 'const'

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

12 years agoobjc: Some refactoring of overriding method decl. code
Fariborz Jahanian [Mon, 10 Oct 2011 17:53:29 +0000 (17:53 +0000)]
objc: Some refactoring of overriding method decl. code
for future work.

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

12 years agoDon't analyze comparisons in type- or value-dependent
Douglas Gregor [Mon, 10 Oct 2011 17:38:18 +0000 (17:38 +0000)]
Don't analyze comparisons in type- or value-dependent
subexpressions. Fixes PR10291.

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

12 years agoPer C++ [class.bit]p2, unnamed bit-fields are not members. Fixes PR10289.
Douglas Gregor [Mon, 10 Oct 2011 17:22:13 +0000 (17:22 +0000)]
Per C++ [class.bit]p2, unnamed bit-fields are not members. Fixes PR10289.

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

12 years agoconstexpr: Disable checking of constructor member initializer lists for
Richard Smith [Mon, 10 Oct 2011 16:38:04 +0000 (16:38 +0000)]
constexpr: Disable checking of constructor member initializer lists for
constexpr constructor templates. Such checking is optional, and currently hard
to get right since clang doesn't generate implicit member initializers until
instantiation (even for non-dependent members).

This is needed for clang to accept libstdc++ from g++4.6 in c++0x mode.

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

12 years agoDon't complain about qualified property or ivar access when the
Douglas Gregor [Mon, 10 Oct 2011 16:09:49 +0000 (16:09 +0000)]
Don't complain about qualified property or ivar access when the
qualifier itself is invalid. Crasher noticed by Fariborz.

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

12 years agoWhen adding a direct initializer to a declaration, allow the
Douglas Gregor [Mon, 10 Oct 2011 16:05:18 +0000 (16:05 +0000)]
When adding a direct initializer to a declaration, allow the
initializer to update the type of the declaration. For example, this
allows us to determine the size of an incomplete array from its
initializer. Fixes PR10288.

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

12 years agoParse the initializer for a class member after handling its
Douglas Gregor [Mon, 10 Oct 2011 14:49:18 +0000 (14:49 +0000)]
Parse the initializer for a class member after handling its
declarator, so that the declarator is in scope for the
initializer. Fixes PR9989.

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

12 years agoAlways add the built-in overload candidates for operators &&, ||, and
Douglas Gregor [Mon, 10 Oct 2011 14:05:31 +0000 (14:05 +0000)]
Always add the built-in overload candidates for operators &&, ||, and
!. Fixes PR9865.

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

12 years agoRemove the TODO file; it's not interesting any more
Douglas Gregor [Mon, 10 Oct 2011 13:43:20 +0000 (13:43 +0000)]
Remove the TODO file; it's not interesting any more

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

12 years agoAnother case of HadMultipleCandidates being used uninitialized.
Benjamin Kramer [Mon, 10 Oct 2011 12:54:05 +0000 (12:54 +0000)]
Another case of HadMultipleCandidates being used uninitialized.

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

12 years agoBegin work consolidating ShouldDelete* functions.
Sean Hunt [Mon, 10 Oct 2011 06:18:57 +0000 (06:18 +0000)]
Begin work consolidating ShouldDelete* functions.

Begin with just default constructors. One note is that as a side effect
of this, a conformance test was removed on the basis that this is almost
certainly a defect as with most of union initialization. As it is, clang
does not implement union initialization close to the standard as it's
quite broken as written. I hope to write a paper addressing the issues
eventually.

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