Chandler Carruth [Sat, 23 Oct 2010 08:21:37 +0000 (08:21 +0000)]
Update to use 'LLVM_*' macro names for attributes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117201
91177308-0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Fri, 22 Oct 2010 23:37:08 +0000 (23:37 +0000)]
Warn if a variable marked with the "unused" attribute is used. Patch by Darin Adler!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117184
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Fri, 22 Oct 2010 23:36:17 +0000 (23:36 +0000)]
Parse attributes on enumerators and instantiate attributes on enum decls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117182
91177308-0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Fri, 22 Oct 2010 23:35:40 +0000 (23:35 +0000)]
Minor tweak so that fixit-errors.c is never compiled; it crashes and pops up a crash dialog on my system.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117181
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 22 Oct 2010 22:35:51 +0000 (22:35 +0000)]
Update compatibility page for objective-c.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117168
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 22 Oct 2010 22:24:08 +0000 (22:24 +0000)]
Teach clang_getCursorReferenced() and friends about BlockDeclRefExprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117167
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 22 Oct 2010 22:08:47 +0000 (22:08 +0000)]
In the presence of using declarations, we can find the same class
members in class subobjects of different types. So long as the
underlying declaration sets are the same, and the declaration sets
involve non-instance members, this is not an ambiguity.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117163
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 22 Oct 2010 22:08:32 +0000 (22:08 +0000)]
Fix a horrible bug in all dataflow analyses that use CFGRecStmtVisitor (including live variables analysis).
We shouldn't recurse into CompoundStmts since they are already inlined in the CFG. This could result in
bogus dead stores warnings (among other things).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117162
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 22 Oct 2010 22:08:29 +0000 (22:08 +0000)]
Fix '-analyzer-display-progress' for Objective-C methods. Also remove obsolete code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117161
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 22 Oct 2010 22:05:40 +0000 (22:05 +0000)]
Test emoved.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117160
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 22 Oct 2010 22:05:03 +0000 (22:05 +0000)]
After discussion with Doug and John, I am reverting
the patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117159
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Fri, 22 Oct 2010 21:07:10 +0000 (21:07 +0000)]
Change handling of inline asm 'p' constraint to match llvm-gcc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117149
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Fri, 22 Oct 2010 21:05:15 +0000 (21:05 +0000)]
Substantially revise how clang computes the visibility of a declaration to
more closely parallel the computation of linkage. This gets us to a state
much closer to what gcc emits, modulo bugs, which will undoubtedly arise in
abundance.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117147
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 22 Oct 2010 21:01:02 +0000 (21:01 +0000)]
Patch fixes miscompile with non-trivial copy constructors and
statement expressions, //rdar: //
8540501
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117146
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Fri, 22 Oct 2010 18:56:27 +0000 (18:56 +0000)]
Delay record type's debug info emission, in -flimit-debug-info mode, if member expression's base is call expr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117127
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Fri, 22 Oct 2010 18:31:12 +0000 (18:31 +0000)]
Revert unintentional check-in.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117120
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 22 Oct 2010 17:36:51 +0000 (17:36 +0000)]
When we perform name lookup for a template, we may end up finding an
ambiguous name where none of the declarations found are actually
templates. In this case, make sure we clear out the ambiguous-path
data when recomputing the lookup result kind. Fixes PR8439.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117112
91177308-0d34-0410-b5e6-
96231b3b80d8
Oscar Fuentes [Fri, 22 Oct 2010 17:16:39 +0000 (17:16 +0000)]
Don't try to guess svn version when current path is a symlink.
See PR 8473.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117110
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Fri, 22 Oct 2010 17:11:50 +0000 (17:11 +0000)]
Tidy up MIPS_linkage name. Provide it only if it does not match regular name, otherwise it confuses debugger.
This is tested by local.C in llvmgcc testsuite.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117107
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 22 Oct 2010 16:48:22 +0000 (16:48 +0000)]
More class anonymization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117106
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 22 Oct 2010 16:33:16 +0000 (16:33 +0000)]
Move classes into anonymous namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117104
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 22 Oct 2010 15:24:46 +0000 (15:24 +0000)]
When performing name lookup for a namespace definition, only look into
the current context's redeclaration context, ignoring using
directives. Fixes PR8430.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117097
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 21 Oct 2010 23:17:00 +0000 (23:17 +0000)]
Teach the C++ simple-type-specifier parser and tentative parses about
protocol-qualified types such as id<Protocol>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117081
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 21 Oct 2010 20:55:34 +0000 (20:55 +0000)]
Update clang_getCursor() test to check searches on include directives
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117063
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Thu, 21 Oct 2010 18:50:04 +0000 (18:50 +0000)]
Rename clang's TBAA tree root from "experimental" to "simple".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117046
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 21 Oct 2010 18:49:42 +0000 (18:49 +0000)]
Tweak diagnostics for redeclaration of a @property in a class extension where the redelcaration and original
declaration have the 'readwrite' attribute. This is a common case, and we can issue a more lucid diagnostic.
Fixes <rdar://problem/
7629420>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117045
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 21 Oct 2010 18:49:36 +0000 (18:49 +0000)]
Tidy up comment (remove extraneous text).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117044
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Thu, 21 Oct 2010 18:49:12 +0000 (18:49 +0000)]
Add some more comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117043
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 21 Oct 2010 18:04:08 +0000 (18:04 +0000)]
Implement the integral promotion rules for the C++0x char16_t and
char32_t character types and enable built-in overloaded operator
candidates for these types. Fixes PR8432.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117038
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 21 Oct 2010 17:26:49 +0000 (17:26 +0000)]
Diagnose the declaration of template template parameters that
themselves have no template parameters. This is actually a restriction
due to the grammar of template template parameters, but we choose to
diagnose it in Sema to provide better recovery.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117032
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 21 Oct 2010 16:57:46 +0000 (16:57 +0000)]
Always treat 'main' as an extern "C" function, so that we detect
redeclarations of main appropriately rather than allowing it to be
overloaded. Also, disallowing declaring main as a template.
Fixes GCC DejaGNU g++.old-deja/g++.other/main1.C.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117029
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 21 Oct 2010 16:21:08 +0000 (16:21 +0000)]
When checking whether a return statement returns a stack-local
variable, handle conditional operators involving a
throw-expression. Fixes GCC DejaGNU's g++.dg/template/cond4.C.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117027
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Thu, 21 Oct 2010 16:14:56 +0000 (16:14 +0000)]
Revert r117005, WIN32 is not predefined after all.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117026
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 21 Oct 2010 15:38:55 +0000 (15:38 +0000)]
Tweak the ObjCAtSyncChecker to assume that a mutex is non-nil after checking that it is
nil. Otherwise we can get false paths where a second @synchronized using the mutex
can have a bogus warning. Fixes <rdar://problem/
8578650>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117016
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Thu, 21 Oct 2010 09:39:28 +0000 (09:39 +0000)]
MSVC defines WIN32 as a predefined macro.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117005
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Thu, 21 Oct 2010 08:22:51 +0000 (08:22 +0000)]
Targets: Fix MinGW and VisualStudio predefined macros.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117003
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 21 Oct 2010 06:10:04 +0000 (06:10 +0000)]
Improve the implementation of libclang's token-annotation logic for
entities in the preprocessing record. Previously, we would only end up
getting the first token of a preprocessing record annotated
correctly. For example, given
#include "foo.h"
we would only get the '#' annotated as an inclusion directive; the
'include' and '"foo.h"' tokens would be given the general 'processing
directive' annotation.
Now, we get proper annotations for entities in the preprocessing
record.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117001
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Thu, 21 Oct 2010 05:23:48 +0000 (05:23 +0000)]
Add test for Windows predefined macros.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117000
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Thu, 21 Oct 2010 05:21:48 +0000 (05:21 +0000)]
Reorganize predefined macros for all Windows targets.
This adds an option to set the _MSC_VER macro without
recompiling. This is very useful when testing compatibility
with the Windows SDK and c++stdlib headers.
-fmsc-version=<version> (defaults to VS2003 (1300))
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116999
91177308-0d34-0410-b5e6-
96231b3b80d8
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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