]> granicus.if.org Git - clang/log
clang
13 years agoPreviously, the printf warnings would say your arguments type was 'int' when it was...
Ted Kremenek [Thu, 21 Oct 2010 04:00:58 +0000 (04:00 +0000)]
Previously, the printf warnings would say your arguments type was 'int' when it was really a 'char'
or a 'short'. This fixes that and allows the hints to suggest 'h' modifiers for small ints.

Patch by Justin Bogner!

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

13 years agoRemove unused variable.
Ted Kremenek [Thu, 21 Oct 2010 04:00:51 +0000 (04:00 +0000)]
Remove unused variable.

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

13 years agoputback r116782, it's a safe fix and should not break windows
Andrew Trick [Thu, 21 Oct 2010 03:59:06 +0000 (03:59 +0000)]
putback r116782, it's a safe fix and should not break windows

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

13 years agoFix Whitespace.
Michael J. Spencer [Thu, 21 Oct 2010 03:16:25 +0000 (03:16 +0000)]
Fix Whitespace.

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

13 years agoRevert "Cleanup and fix predefined macros for windows."
Michael J. Spencer [Thu, 21 Oct 2010 03:14:35 +0000 (03:14 +0000)]
Revert "Cleanup and fix predefined macros for windows."

Didn't realize this was on my branch ;/.

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

13 years agoCleanup and fix predefined macros for windows.
Michael J. Spencer [Thu, 21 Oct 2010 03:13:04 +0000 (03:13 +0000)]
Cleanup and fix predefined macros for windows.

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

13 years agoPass TInfo to CXXDestructorDecl::Create(), just like we do for other
Craig Silverstein [Thu, 21 Oct 2010 00:44:50 +0000 (00:44 +0000)]
Pass TInfo to CXXDestructorDecl::Create(), just like we do for other
function decls.

Reviewed by rjmccall and nlewycky.

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

13 years agorevert r116782 & r116793 to fix msvc9 buildbots
Andrew Trick [Wed, 20 Oct 2010 23:52:37 +0000 (23:52 +0000)]
revert r116782 & r116793 to fix msvc9 buildbots

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

13 years agoWhen implicit members are added to a C++ record, notify the serializer so that a...
Argyrios Kyrtzidis [Wed, 20 Oct 2010 23:48:42 +0000 (23:48 +0000)]
When implicit members are added to a C++ record, notify the serializer so that a chained PCH writes the definition again.
Thanks to Doug for the hint!

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

13 years agoModify the assumptions of an assert; the updated latest redeclaration can have the...
Argyrios Kyrtzidis [Wed, 20 Oct 2010 23:48:40 +0000 (23:48 +0000)]
Modify the assumptions of an assert; the updated latest redeclaration can have the same location
if it's a template specialization pointing at the template.

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

13 years agoRemove obsolete GRAuditor and GRSimpleAPICheck, which have been completely subsumed...
Ted Kremenek [Wed, 20 Oct 2010 23:48:34 +0000 (23:48 +0000)]
Remove obsolete GRAuditor and GRSimpleAPICheck, which have been completely subsumed by the Checker interface.

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

13 years agoConvert GRSimpleAPIChecks in BasicObjCFoundationChecks to be Checkers.
Ted Kremenek [Wed, 20 Oct 2010 23:38:56 +0000 (23:38 +0000)]
Convert GRSimpleAPIChecks in BasicObjCFoundationChecks to be Checkers.

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

13 years agoExtend the preprocessing record and libclang with support for
Douglas Gregor [Wed, 20 Oct 2010 22:00:55 +0000 (22:00 +0000)]
Extend the preprocessing record and libclang with support for
inclusion directives, keeping track of every #include, #import,
etc. in the translation unit. We keep track of the source location and
kind of the inclusion, how the file name was spelled, and the
underlying file to which the inclusion resolved.

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

13 years agoCall clang_disposeTokens() when we are done with the set of tokens.
Ted Kremenek [Wed, 20 Oct 2010 21:22:15 +0000 (21:22 +0000)]
Call clang_disposeTokens() when we are done with the set of tokens.

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

13 years agoGet FunctionDecl to recurse on FunctionTypeLoc rather than
Craig Silverstein [Wed, 20 Oct 2010 21:13:35 +0000 (21:13 +0000)]
Get FunctionDecl to recurse on FunctionTypeLoc rather than
FunctionType!  I didn't realize it was available, until rjmccall
pointed out that DeclaratorDecl made the typeloc available.  This
makes FunctionDecl recursion *much* easier, because the typeloc can
take care of default parameters, so we no longer have to do that
separately, which means we can just do a normal type traversal instead
of this special-case WalkUp stuff we did before.

The only downside -- and it's minor -- is that because the TypeLoc
handles both the return type and the argument types, we can't recurse
on the explicit template args in the right place (which would be
between them).  I do it beforehand instead.  So for
   int MyFunc<float>(char x);
we get callbacks in the order: float, int, char.

Reviewed by chandlerc

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

13 years agoFix chained PCH issue; make sure all visible decls that will be put into a UPDATE_VIS...
Argyrios Kyrtzidis [Wed, 20 Oct 2010 16:22:56 +0000 (16:22 +0000)]
Fix chained PCH issue; make sure all visible decls that will be put into a UPDATE_VISIBLE block were recorded beforehand.

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

13 years agoMinor optimization; Try to iterator over redeclarations only when necessary.
Argyrios Kyrtzidis [Wed, 20 Oct 2010 16:22:49 +0000 (16:22 +0000)]
Minor optimization; Try to iterator over redeclarations only when necessary.

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

13 years agoFixes a potential crash in rewriter when sending message
Fariborz Jahanian [Wed, 20 Oct 2010 16:07:20 +0000 (16:07 +0000)]
Fixes a potential crash in rewriter when sending message
to 'super'.

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

13 years agoTry again to pacify the build bots. =/ I'm getting a Darwin machine to test on.
Chandler Carruth [Wed, 20 Oct 2010 08:24:03 +0000 (08:24 +0000)]
Try again to pacify the build bots. =/ I'm getting a Darwin machine to test on.

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

13 years agoGCC 4.4 warns that Receiver may be used uninitialized in this function.
Duncan Sands [Wed, 20 Oct 2010 08:21:16 +0000 (08:21 +0000)]
GCC 4.4 warns that Receiver may be used uninitialized in this function.
As far as I can see, gcc is right to think this!  The following change
will cause a nice segfault rather than undefined behaviour if this case
occurs.  Someone who understands what this code is supposed to do should
probably take a proper look.

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

13 years agoAccess control polish: drop the note on the original declaration and
John McCall [Wed, 20 Oct 2010 08:15:06 +0000 (08:15 +0000)]
Access control polish:  drop the note on the original declaration and
say 'implicitly' when it was implicit.  Resolves PR 7930 and my peace of mind.

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

13 years agoRemove a modern bash-ism and use simpler shell redirects. Hopefully will fix
Chandler Carruth [Wed, 20 Oct 2010 07:16:18 +0000 (07:16 +0000)]
Remove a modern bash-ism and use simpler shell redirects. Hopefully will fix
build bots.

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

13 years agoAdd support for the '--sysroot' flag, and an accompanying test of its
Chandler Carruth [Wed, 20 Oct 2010 07:00:47 +0000 (07:00 +0000)]
Add support for the '--sysroot' flag, and an accompanying test of its
interactions with -isysroot and other driver commands.

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

13 years agoWhen matching template parameter lists to template-ids in a scope specifier
John McCall [Wed, 20 Oct 2010 05:44:58 +0000 (05:44 +0000)]
When matching template parameter lists to template-ids in a scope specifier
on a friend declaration, skip template-ids which do not depend on the
current parameter list.

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

13 years agoFix handling of property and ivar lookup in typo correction; the two
Douglas Gregor [Wed, 20 Oct 2010 03:06:34 +0000 (03:06 +0000)]
Fix handling of property and ivar lookup in typo correction; the two
kinds of lookup into Objective-C classes were tangled together, a
situation that was compounded by automatically synthesized ivars.

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

13 years agoAdd a __has_attribute macro that works much like __has_feature and __has_builtin.
Anders Carlsson [Wed, 20 Oct 2010 02:31:43 +0000 (02:31 +0000)]
Add a __has_attribute macro that works much like __has_feature and __has_builtin.

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

13 years agoDisable this test while I track down the platform-specific issue
Douglas Gregor [Wed, 20 Oct 2010 01:46:04 +0000 (01:46 +0000)]
Disable this test while I track down the platform-specific issue

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

13 years agoIntroduce a simple cache for unqualified typo corrections, so that we
Douglas Gregor [Wed, 20 Oct 2010 01:32:02 +0000 (01:32 +0000)]
Introduce a simple cache for unqualified typo corrections, so that we
don't repeatedly loop through identifiers, correcting the same typo'd
identifier over and over again.

We still bail out after 20 typo corrections, but this should help
improve performance in the common case where we're typo-correcting
because the user forgot to include a header.

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

13 years agoBah, incompetence
Douglas Gregor [Wed, 20 Oct 2010 01:16:12 +0000 (01:16 +0000)]
Bah, incompetence

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

13 years agoEliminate another ordering dependency in typo correction. Re-enable typo.m, which...
Douglas Gregor [Wed, 20 Oct 2010 01:01:57 +0000 (01:01 +0000)]
Eliminate another ordering dependency in typo correction. Re-enable typo.m, which seems to be working properly.

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

13 years agoHad the wrong type for ArgType. :-( Fixed.
Craig Silverstein [Wed, 20 Oct 2010 00:56:01 +0000 (00:56 +0000)]
Had the wrong type for ArgType. :-(  Fixed.

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

13 years agoThe type-to-delete may not be a pointer if it's a dependent type.
Craig Silverstein [Wed, 20 Oct 2010 00:38:15 +0000 (00:38 +0000)]
The type-to-delete may not be a pointer if it's a dependent type.
Here's example code:
---
template<class T> class MyClass {
  struct S { };
  S* NewS() { return new S; }
  void DeleteS() { delete NewS(); }
};
---
CXXDeleteExpr::getDestroyedType() on the 'delete NewS()' expression
would crash before this change.  Now it returns a dependent type
object.  Solution suggested by dgregor.

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

13 years agoLinux still needs these hacks.
Bill Wendling [Wed, 20 Oct 2010 00:12:59 +0000 (00:12 +0000)]
Linux still needs these hacks.

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

13 years agoFix issue with chained PCH where forward references did not pick up later definition...
Argyrios Kyrtzidis [Wed, 20 Oct 2010 00:11:15 +0000 (00:11 +0000)]
Fix issue with chained PCH where forward references did not pick up later definition in the chained PCH.

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

13 years agoDo not rewrite new accessor if user has defined accessors.
Fariborz Jahanian [Tue, 19 Oct 2010 23:47:54 +0000 (23:47 +0000)]
Do not rewrite new accessor if user has defined accessors.
Fixes //rdar: // 8570020.

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

13 years agoSilence uninitialized value warning.
Ted Kremenek [Tue, 19 Oct 2010 23:10:22 +0000 (23:10 +0000)]
Silence uninitialized value warning.

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

13 years agoReally^2 fix <rdar://problem/8361834>, this time without crashing.
Ted Kremenek [Tue, 19 Oct 2010 22:15:20 +0000 (22:15 +0000)]
Really^2 fix <rdar://problem/8361834>, this time without crashing.

Now MICache is a linked list (per the FIXME), where we tradeoff between MacroInfo objects being in MICache
and MIChainHead.  MacroInfo objects in the MICache chain are already "Destroy()'ed", so they can be reused.  When
inserting into MICache, we need to remove them from the regular linked list so that they aren't destroyed more than
once.

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

13 years agoProvide an upper bound to the edit-distance algorithm when performing
Douglas Gregor [Tue, 19 Oct 2010 22:14:33 +0000 (22:14 +0000)]
Provide an upper bound to the edit-distance algorithm when performing
typo correction, to allow early exits.

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

13 years agoPutting back safe fixes 116836,116837,116838
Andrew Trick [Tue, 19 Oct 2010 21:54:32 +0000 (21:54 +0000)]
Putting back safe fixes 116836,116837,116838

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

13 years agoRevert most of r116862. It isn't quite the right fix for a memory leak in Preprocessor.
Ted Kremenek [Tue, 19 Oct 2010 21:40:34 +0000 (21:40 +0000)]
Revert most of r116862.  It isn't quite the right fix for a memory leak in Preprocessor.

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

13 years agoReally fix: <rdar://problem/8361834> MacroInfo::AddTokenToBody() leaks memory
Ted Kremenek [Tue, 19 Oct 2010 21:30:15 +0000 (21:30 +0000)]
Really fix: <rdar://problem/8361834> MacroInfo::AddTokenToBody() leaks memory

The problem was not the management of MacroInfo objects, but that when we recycle them
via the MICache the memory of the underlying SmallVector (within MacroInfo) was not getting
released.  This is because objects stashed into MICache simply are reused with a placement
new, and never have their destructor called.

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

13 years agoSimplify loop. No functionality change.
Ted Kremenek [Tue, 19 Oct 2010 21:30:11 +0000 (21:30 +0000)]
Simplify loop.  No functionality change.

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

13 years agoReverting 116836,116837,116838 until we resolve the getLangStandardForKind failures.
Andrew Trick [Tue, 19 Oct 2010 21:14:46 +0000 (21:14 +0000)]
Reverting 116836,116837,116838 until we resolve the getLangStandardForKind failures.

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

13 years agoNow that mm_malloc.h was rewritten to *not* include errno.h (see
Bill Wendling [Tue, 19 Oct 2010 20:08:12 +0000 (20:08 +0000)]
Now that mm_malloc.h was rewritten to *not* include errno.h (see
http://llvm.org/viewvc/llvm-project?rev=116771&view=rev) we can get rid of these
hacks.

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

13 years agoImprove the performance of typo correction, by using a simple
Douglas Gregor [Tue, 19 Oct 2010 19:39:10 +0000 (19:39 +0000)]
Improve the performance of typo correction, by using a simple
computation to compute the lower bound of the edit distance, so that
we can avoid computing the edit distance for names that will clearly
be rejected later. Since edit distance is such an expensive algorithm
(M x N), this leads to a 7.5x speedup when correcting NSstring ->
NSString in the presence of a Cocoa PCH.

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

13 years agoFixes a bug in ivar lookup in the new objc's default
Fariborz Jahanian [Tue, 19 Oct 2010 19:08:23 +0000 (19:08 +0000)]
Fixes a bug in ivar lookup in the new objc's default
property synthesis mode, when dealing with legacy code.
Fixes //rdar: //8565343.

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

13 years agoTag references shouldn't ever get template parameter lists.
John McCall [Tue, 19 Oct 2010 18:40:57 +0000 (18:40 +0000)]
Tag references shouldn't ever get template parameter lists.
Fixes rdar://problem/8568507

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

13 years agoSimplify lifetime management of MacroInfo objects in Preprocessor by having the Prepr...
Ted Kremenek [Tue, 19 Oct 2010 18:16:54 +0000 (18:16 +0000)]
Simplify lifetime management of MacroInfo objects in Preprocessor by having the Preprocessor maintain them in a linked
list of allocated MacroInfos.  This requires only 1 extra pointer per MacroInfo object, and allows us to blow them
away in one place.  This fixes an elusive memory leak with MacroInfos (whose exact location I couldn't still figure
out despite substantial digging).

Fixes <rdar://problem/8361834>.

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

13 years agoFix up the comments for creating ParmVarDeclAbbrev to reflect reality.
Argyrios Kyrtzidis [Tue, 19 Oct 2010 18:06:49 +0000 (18:06 +0000)]
Fix up the comments for creating ParmVarDeclAbbrev to reflect reality.

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

13 years agoMinor optimization; if we have a CXXRecordDecl we can get the definition decl directl...
Argyrios Kyrtzidis [Tue, 19 Oct 2010 18:06:47 +0000 (18:06 +0000)]
Minor optimization; if we have a CXXRecordDecl we can get the definition decl directly without iterating over the redeclarations.

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

13 years agoMerge headers into test/PCH/chain-cxx.cpp for convenience.
Argyrios Kyrtzidis [Tue, 19 Oct 2010 18:06:43 +0000 (18:06 +0000)]
Merge headers into test/PCH/chain-cxx.cpp for convenience.

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

13 years agoFix CMake installation of arm_neon.h
Douglas Gregor [Tue, 19 Oct 2010 18:06:10 +0000 (18:06 +0000)]
Fix CMake installation of arm_neon.h

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

13 years agoIn ~Preprocessor(), also cleanup the MacroInfo objects left-over from stray "#pragma...
Ted Kremenek [Tue, 19 Oct 2010 17:40:53 +0000 (17:40 +0000)]
In ~Preprocessor(), also cleanup the MacroInfo objects left-over from stray "#pragma push_macro" uses.  This
fixes a potential memory leak.

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

13 years agoFix typo in comment.
Ted Kremenek [Tue, 19 Oct 2010 17:40:50 +0000 (17:40 +0000)]
Fix typo in comment.

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

13 years agoThis patch implements Next's IRGen for -fconstant-string-class=class-name.
Fariborz Jahanian [Tue, 19 Oct 2010 17:19:29 +0000 (17:19 +0000)]
This patch implements Next's IRGen for -fconstant-string-class=class-name.
PR6056, //rdar: //8564463

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

13 years agoWhen marking declarations referenced within an expression (e.g.,
Douglas Gregor [Tue, 19 Oct 2010 17:17:35 +0000 (17:17 +0000)]
When marking declarations referenced within an expression (e.g.,
within a default argument), recurse into default arguments. Fixes
PR8401, a regression I introduced in r113700 while refactoring our
handling of "used" declarations in default arguments.

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

13 years agoUse CLANG_RESOURCE_DIR define if one is provided, otherwise use the default of
Chandler Carruth [Tue, 19 Oct 2010 08:47:51 +0000 (08:47 +0000)]
Use CLANG_RESOURCE_DIR define if one is provided, otherwise use the default of
'../lib/clang/<version>'. Actually use '..' rather than removing the trailing
component to correctly handle paths containing '.' or symlinks in the presence
of -no-canonical-prefixes, etc. This shouldn't change any existing behavior.

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

13 years agotest: FileCheck'ize and document test.
Michael J. Spencer [Tue, 19 Oct 2010 06:39:49 +0000 (06:39 +0000)]
test: FileCheck'ize and document test.

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

13 years agoFix Whitespace.
Michael J. Spencer [Tue, 19 Oct 2010 06:39:39 +0000 (06:39 +0000)]
Fix Whitespace.

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

13 years agoMSVC space optimization.
John McCall [Tue, 19 Oct 2010 05:43:52 +0000 (05:43 +0000)]
MSVC space optimization.

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

13 years agoPetty space optimizations in ElaboratedType and DependentNameType.
John McCall [Tue, 19 Oct 2010 05:23:37 +0000 (05:23 +0000)]
Petty space optimizations in ElaboratedType and DependentNameType.
Petty time optimization in TemplateTypeParmType.

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

13 years agoWhen instantiating a dependently-scoped friend function declaration,
John McCall [Tue, 19 Oct 2010 05:01:53 +0000 (05:01 +0000)]
When instantiating a dependently-scoped friend function declaration,
we may need to complete the type before looking into it.

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

13 years agolib/Headers/stddef.h: wint_t should be defined whenever <stddef.h> is included with...
NAKAMURA Takumi [Tue, 19 Oct 2010 03:42:41 +0000 (03:42 +0000)]
lib/Headers/stddef.h: wint_t should be defined whenever <stddef.h> is included with __need_wint_t.

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

13 years agotest/Coverage/html-diagnostics.c: Use find(1) to glob wildcards.
NAKAMURA Takumi [Tue, 19 Oct 2010 03:38:22 +0000 (03:38 +0000)]
test/Coverage/html-diagnostics.c: Use find(1) to glob wildcards.

MSYS cat(1) does not expand wildcards.

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

13 years agoInstantiate enclosing template parameter lists when instantiating friends.
John McCall [Tue, 19 Oct 2010 02:26:41 +0000 (02:26 +0000)]
Instantiate enclosing template parameter lists when instantiating friends.

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

13 years agoUncomputable contexts are always records but can exist.
John McCall [Tue, 19 Oct 2010 01:54:45 +0000 (01:54 +0000)]
Uncomputable contexts are always records but can exist.

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

13 years agoRedirect templated friend class decls to a new Sema callback and
John McCall [Tue, 19 Oct 2010 01:40:49 +0000 (01:40 +0000)]
Redirect templated friend class decls to a new Sema callback and
construct an unsupported friend when there's a friend with a templated
scope specifier.  Fixes a consistency crash, rdar://problem/8540527

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

13 years agotest/Sema/return.c: Cygwin does not have _longjmp().
NAKAMURA Takumi [Tue, 19 Oct 2010 01:17:08 +0000 (01:17 +0000)]
test/Sema/return.c: Cygwin does not have _longjmp().

Although Cygwin-1.7 has _longjmp(), it would not be essential for this
to distinguish Cygwin's version with <cygwin/version.h>.

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

13 years agotest/Coverage/html-diagnostics.c: Do not make hit "CHECK: Dereference of null pointer...
NAKAMURA Takumi [Tue, 19 Oct 2010 01:11:16 +0000 (01:11 +0000)]
test/Coverage/html-diagnostics.c: Do not make hit "CHECK: Dereference of null pointer" to the output itself!

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

13 years agoTweak code-completion result priorities, so that exact and similar
Douglas Gregor [Tue, 19 Oct 2010 00:03:23 +0000 (00:03 +0000)]
Tweak code-completion result priorities, so that exact and similar
type matches have a bigger impact. The impetus for this change was
that, when initializing an enumeration value, we want enumerators of
that enumeration type to have a higher priority than, e.g., unrelated
local variables.

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

13 years agoWe shouldn't keep track of MMX registers "needed" separately from the SSE
Bill Wendling [Mon, 18 Oct 2010 23:51:38 +0000 (23:51 +0000)]
We shouldn't keep track of MMX registers "needed" separately from the SSE
registers needed.

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

13 years agoFrom scratch rewrite of mm_malloc.h.
Eric Christopher [Mon, 18 Oct 2010 23:38:51 +0000 (23:38 +0000)]
From scratch rewrite of mm_malloc.h.

Patch by Matthew Beaumont-Gay!

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

13 years agotests: Force triple to avoid limited precision warning on win32.
Daniel Dunbar [Mon, 18 Oct 2010 23:37:08 +0000 (23:37 +0000)]
tests: Force triple to avoid limited precision warning on win32.

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

13 years ago"Fix" bogus idempotent operations warning due to loop unrolling not unrolling enough...
Ted Kremenek [Mon, 18 Oct 2010 23:36:05 +0000 (23:36 +0000)]
"Fix" bogus idempotent operations warning due to loop unrolling not unrolling enough loops to show that an invariant
doesn't hold.  This fix is to increase the loop unrolling count to 4, which experiments show doesn't typically impact
analysis time.  The real fix is to modify the IdempotentOperationsChecker to suppress warnings where an analysis point
could be preceded by a point where we gave up due to loop unrolling.

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

13 years agoDriver: Reject -fasm-blocks except on X86 (where we just ignore it, since
Daniel Dunbar [Mon, 18 Oct 2010 22:49:46 +0000 (22:49 +0000)]
Driver: Reject -fasm-blocks except on X86 (where we just ignore it, since
passing it is very prevalent in some circles).

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

13 years agoDriver/IA: Accept and ignore -force_cpusubtype_ALL, as in 'clang -c
Daniel Dunbar [Mon, 18 Oct 2010 22:36:15 +0000 (22:36 +0000)]
Driver/IA: Accept and ignore -force_cpusubtype_ALL, as in 'clang -c
-Wa,-force_cpusubtype_ALL t.c'.
 - Tweaks -Wa, and -Xassembler handling to only accept an explicit short list of
   arguments and give an obvious unsupported error on others.

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

13 years agoDriver/Darwin: Forward -ObjC when linking, which may be needed when using static
Daniel Dunbar [Mon, 18 Oct 2010 22:08:36 +0000 (22:08 +0000)]
Driver/Darwin: Forward -ObjC when linking, which may be needed when using static
libraries with Objective-C code.

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

13 years agoFix the translation of the PCC_ForInit code-completion context for
Douglas Gregor [Mon, 18 Oct 2010 22:01:46 +0000 (22:01 +0000)]
Fix the translation of the PCC_ForInit code-completion context for
C++/C99/Objective-C, so that we properly include types. This fix
affects global caching of code-completion results; without caching,
the behavior was already correct.

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

13 years agoProvide code completion for types after the '^' that starts a block
Douglas Gregor [Mon, 18 Oct 2010 21:34:55 +0000 (21:34 +0000)]
Provide code completion for types after the '^' that starts a block
literal.

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

13 years agoFix some bugs in local class mangling brought up in PR8355.
John McCall [Mon, 18 Oct 2010 21:28:44 +0000 (21:28 +0000)]
Fix some bugs in local class mangling brought up in PR8355.
Patch by Richard Smith!

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

13 years agoIntroduce code completion results for Objective-C methods, both when
Douglas Gregor [Mon, 18 Oct 2010 21:05:04 +0000 (21:05 +0000)]
Introduce code completion results for Objective-C methods, both when
declaring methods and when sending messages to them, by bringing all
of the selector into TypedCheck chunks in the completion result. This
way, we can improve the sorting of these results to account for the
full selector name rather than just the first chunk.

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

13 years agoRead/write declaration attributes from/to PCH properly. Embed them in the declaration...
Argyrios Kyrtzidis [Mon, 18 Oct 2010 19:20:11 +0000 (19:20 +0000)]
Read/write declaration attributes from/to PCH properly. Embed them in the declaration block instead of trying to create another block.

The new block was messing with the assumption that after decls block comes the stmts block.
Fixes http://llvm.org/PR8406

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

13 years agoMerge header & cpp for test/PCH/attrs.c - more convenient to keep the tests in one...
Argyrios Kyrtzidis [Mon, 18 Oct 2010 19:20:05 +0000 (19:20 +0000)]
Merge header & cpp for test/PCH/attrs.c - more convenient to keep the tests in one source file.

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

13 years agoWhen providing code completions of Objective-C method declarations
Douglas Gregor [Mon, 18 Oct 2010 18:21:28 +0000 (18:21 +0000)]
When providing code completions of Objective-C method declarations
(after - or +), always traverse superclasses and all categories. The
programmer may want to complete a method from *anywhere*.

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

13 years agopatch fixes class names missing from method names in debug information for
Fariborz Jahanian [Mon, 18 Oct 2010 17:51:06 +0000 (17:51 +0000)]
patch fixes class names missing from method names in debug information for
synthesized property. // rdar: //8498026

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

13 years agoImplement the first half of [dcl.attr.override]p6.
Anders Carlsson [Mon, 18 Oct 2010 16:24:27 +0000 (16:24 +0000)]
Implement the first half of [dcl.attr.override]p6.

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

13 years agoMicrosoft enum extensions. 2 things will change on -fms-extensions:
Francois Pichet [Mon, 18 Oct 2010 15:01:13 +0000 (15:01 +0000)]
Microsoft enum extensions. 2 things will change on -fms-extensions:
1. enum underlying type is int by default.
2. Error "enumerator value is not representable in the underlying type"is a ExtWarning

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

13 years agoAdd iteration over the preprocessor conditional stack to PreprocessorLexer
Douglas Gregor [Mon, 18 Oct 2010 14:43:21 +0000 (14:43 +0000)]
Add iteration over the preprocessor conditional stack to PreprocessorLexer

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

13 years agoAdd declarations nested in a linkage specification to the output of
Douglas Gregor [Mon, 18 Oct 2010 14:35:28 +0000 (14:35 +0000)]
Add declarations nested in a linkage specification to the output of
-ast-print-xml, from Martin Vejnar!

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

13 years agoCodeGen: Fix long double on Windows using MSVC runtime.
Michael J. Spencer [Mon, 18 Oct 2010 07:11:10 +0000 (07:11 +0000)]
CodeGen: Fix long double on Windows using MSVC runtime.

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

13 years agoFix Whitespace.
Michael J. Spencer [Mon, 18 Oct 2010 07:10:59 +0000 (07:10 +0000)]
Fix Whitespace.

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

13 years agoReapply r116684 with fixes. The test cases needed to be updated.
Bill Wendling [Mon, 18 Oct 2010 03:41:31 +0000 (03:41 +0000)]
Reapply r116684 with fixes. The test cases needed to be updated.

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

13 years agoDo not use absolute path on the clang++ symlink.
Oscar Fuentes [Mon, 18 Oct 2010 02:25:54 +0000 (02:25 +0000)]
Do not use absolute path on the clang++ symlink.

Based on a patch by Ryuta Suzuki!

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

13 years agoImplement [dcl.attr.override]p2 and add tests for p1 and p2.
Anders Carlsson [Sun, 17 Oct 2010 23:36:12 +0000 (23:36 +0000)]
Implement [dcl.attr.override]p2 and add tests for p1 and p2.

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

13 years agoAdd test for [dcl.attr.final]p4.
Anders Carlsson [Sun, 17 Oct 2010 22:47:44 +0000 (22:47 +0000)]
Add test for [dcl.attr.final]p4.

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

13 years agoUse a script for creating the clang++ executable.
Oscar Fuentes [Sun, 17 Oct 2010 16:10:32 +0000 (16:10 +0000)]
Use a script for creating the clang++ executable.

The previous method used the DESTDIR environment variable at configure
time, but sometimes it is only available at install time. See PR8397.

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

13 years agoTemporarily revert r116684. It was causing failures with
Bill Wendling [Sun, 17 Oct 2010 07:58:46 +0000 (07:58 +0000)]
Temporarily revert r116684. It was causing failures with

    Clang :: CodeGen/x86_32-arguments-darwin.c
    Clang :: CodeGen/x86_32-arguments-linux.c

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

13 years agoThe "gcc.dg/compat/vector-1 -m32" test was broken after the MMX rewrite. The
Bill Wendling [Sun, 17 Oct 2010 07:38:01 +0000 (07:38 +0000)]
The "gcc.dg/compat/vector-1 -m32" test was broken after the MMX rewrite. The
function parameters weren't converted to use the correct type (x86_mmx). Add a
check, similar to the one in llvm-gcc, to see if we need the x86_mmx type for
that function parameter. If so, it coerces the type to be that.

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

13 years agoXcode keeps modifying the project file and I don't know how to ignore the change...
Argyrios Kyrtzidis [Sat, 16 Oct 2010 17:18:07 +0000 (17:18 +0000)]
Xcode keeps modifying the project file and I don't know how to ignore the change; just commit it.

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

13 years agoCoding by inspection has its problems.
John McCall [Sat, 16 Oct 2010 16:34:08 +0000 (16:34 +0000)]
Coding by inspection has its problems.

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