Commit Graph

26404 Commits

Author SHA1 Message Date
Chandler Carruth 4baa6ef5ec Remove a modern bash-ism and use simpler shell redirects. Hopefully will fix
build bots.

llvm-svn: 116914
2010-10-20 07:16:18 +00:00
Chandler Carruth 24e17e175d Add support for the '--sysroot' flag, and an accompanying test of its
interactions with -isysroot and other driver commands.

llvm-svn: 116912
2010-10-20 07:00:47 +00:00
John McCall a020a0159f 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.

llvm-svn: 116911
2010-10-20 05:44:58 +00:00
Douglas Gregor d507d77432 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.

llvm-svn: 116907
2010-10-20 03:06:34 +00:00
Anders Carlsson 274a70ed7f Add a __has_attribute macro that works much like __has_feature and __has_builtin.
llvm-svn: 116906
2010-10-20 02:31:43 +00:00
Douglas Gregor 9b2f537f69 Disable this test while I track down the platform-specific issue
llvm-svn: 116904
2010-10-20 01:46:04 +00:00
Douglas Gregor 87074f19e8 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.

llvm-svn: 116901
2010-10-20 01:32:02 +00:00
Douglas Gregor 30bb275b6b Bah, incompetence
llvm-svn: 116898
2010-10-20 01:16:12 +00:00
Douglas Gregor 1f32ebe892 Eliminate another ordering dependency in typo correction. Re-enable typo.m, which seems to be working properly.
llvm-svn: 116894
2010-10-20 01:01:57 +00:00
Craig Silverstein 3b9936f0b7 Had the wrong type for ArgType. :-( Fixed.
llvm-svn: 116893
2010-10-20 00:56:01 +00:00
Craig Silverstein 20f7ab72b1 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.

llvm-svn: 116891
2010-10-20 00:38:15 +00:00
Bill Wendling 67c5621742 Linux still needs these hacks.
llvm-svn: 116888
2010-10-20 00:12:59 +00:00
Argyrios Kyrtzidis a41f66064f Fix issue with chained PCH where forward references did not pick up later definition in the chained PCH.
llvm-svn: 116887
2010-10-20 00:11:15 +00:00
Fariborz Jahanian 7c299bc6fa Do not rewrite new accessor if user has defined accessors.
Fixes //rdar: // 8570020.

llvm-svn: 116882
2010-10-19 23:47:54 +00:00
Ted Kremenek c81155eef7 Silence uninitialized value warning.
llvm-svn: 116877
2010-10-19 23:10:22 +00:00
Ted Kremenek c8456f8c59 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.

llvm-svn: 116869
2010-10-19 22:15:20 +00:00
Douglas Gregor c1fb15ea8f Provide an upper bound to the edit-distance algorithm when performing
typo correction, to allow early exits.

llvm-svn: 116868
2010-10-19 22:14:33 +00:00
Andrew Trick ba266eec79 Putting back safe fixes 116836,116837,116838
llvm-svn: 116866
2010-10-19 21:54:32 +00:00
Ted Kremenek 60ba93cd62 Revert most of r116862. It isn't quite the right fix for a memory leak in Preprocessor.
llvm-svn: 116864
2010-10-19 21:40:34 +00:00
Ted Kremenek e75b876fb9 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.

llvm-svn: 116862
2010-10-19 21:30:15 +00:00
Ted Kremenek b865f7e025 Simplify loop. No functionality change.
llvm-svn: 116861
2010-10-19 21:30:11 +00:00
Andrew Trick b20ed574ab Reverting 116836,116837,116838 until we resolve the getLangStandardForKind failures.
llvm-svn: 116859
2010-10-19 21:14:46 +00:00
Bill Wendling 2bb7c59356 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.

llvm-svn: 116853
2010-10-19 20:08:12 +00:00
Douglas Gregor 93910a5a59 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.

llvm-svn: 116849
2010-10-19 19:39:10 +00:00
Fariborz Jahanian bfcbc85fea Fixes a bug in ivar lookup in the new objc's default
property synthesis mode, when dealing with legacy code.
Fixes //rdar: //8565343.

llvm-svn: 116846
2010-10-19 19:08:23 +00:00
John McCall 32723e9198 Tag references shouldn't ever get template parameter lists.
Fixes rdar://problem/8568507

llvm-svn: 116843
2010-10-19 18:40:57 +00:00
Ted Kremenek 1f1e4bdbf7 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>.

llvm-svn: 116842
2010-10-19 18:16:54 +00:00
Argyrios Kyrtzidis 48ffd760a7 Fix up the comments for creating ParmVarDeclAbbrev to reflect reality.
llvm-svn: 116838
2010-10-19 18:06:49 +00:00
Argyrios Kyrtzidis 54e6197d5a Minor optimization; if we have a CXXRecordDecl we can get the definition decl directly without iterating over the redeclarations.
llvm-svn: 116837
2010-10-19 18:06:47 +00:00
Argyrios Kyrtzidis 40338af47d Merge headers into test/PCH/chain-cxx.cpp for convenience.
llvm-svn: 116836
2010-10-19 18:06:43 +00:00
Douglas Gregor c4a821860c Fix CMake installation of arm_neon.h
llvm-svn: 116835
2010-10-19 18:06:10 +00:00
Ted Kremenek 2c8028bcf4 In ~Preprocessor(), also cleanup the MacroInfo objects left-over from stray "#pragma push_macro" uses. This
fixes a potential memory leak.

llvm-svn: 116826
2010-10-19 17:40:53 +00:00
Ted Kremenek 6339f1ce2f Fix typo in comment.
llvm-svn: 116825
2010-10-19 17:40:50 +00:00
Fariborz Jahanian 50c925fe96 This patch implements Next's IRGen for -fconstant-string-class=class-name.
PR6056, //rdar: //8564463

llvm-svn: 116819
2010-10-19 17:19:29 +00:00
Douglas Gregor f0873f4c85 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.

llvm-svn: 116817
2010-10-19 17:17:35 +00:00
Chandler Carruth 06067c556a 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.

llvm-svn: 116803
2010-10-19 08:47:51 +00:00
Michael J. Spencer 8d3f5db7e5 test: FileCheck'ize and document test.
llvm-svn: 116799
2010-10-19 06:39:49 +00:00
Michael J. Spencer f5a1fbcdf3 Fix Whitespace.
llvm-svn: 116798
2010-10-19 06:39:39 +00:00
John McCall 46a04f86df MSVC space optimization.
llvm-svn: 116797
2010-10-19 05:43:52 +00:00
John McCall be19d72e6d Petty space optimizations in ElaboratedType and DependentNameType.
Petty time optimization in TemplateTypeParmType.

llvm-svn: 116796
2010-10-19 05:23:37 +00:00
John McCall 1a1b53e9ad When instantiating a dependently-scoped friend function declaration,
we may need to complete the type before looking into it.

llvm-svn: 116795
2010-10-19 05:01:53 +00:00
NAKAMURA Takumi a8792e514a lib/Headers/stddef.h: wint_t should be defined whenever <stddef.h> is included with __need_wint_t.
llvm-svn: 116794
2010-10-19 03:42:41 +00:00
NAKAMURA Takumi 1984479896 test/Coverage/html-diagnostics.c: Use find(1) to glob wildcards.
MSYS cat(1) does not expand wildcards.

llvm-svn: 116793
2010-10-19 03:38:22 +00:00
John McCall d0e23ecdc2 Instantiate enclosing template parameter lists when instantiating friends.
llvm-svn: 116789
2010-10-19 02:26:41 +00:00
John McCall e3df2638ce Uncomputable contexts are always records but can exist.
llvm-svn: 116787
2010-10-19 01:54:45 +00:00
John McCall ace48cd872 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

llvm-svn: 116786
2010-10-19 01:40:49 +00:00
NAKAMURA Takumi 5a391c97b5 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>.

llvm-svn: 116783
2010-10-19 01:17:08 +00:00
NAKAMURA Takumi 3ad833be0e test/Coverage/html-diagnostics.c: Do not make hit "CHECK: Dereference of null pointer" to the output itself!
llvm-svn: 116782
2010-10-19 01:11:16 +00:00
Douglas Gregor 0787b3224d 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.

llvm-svn: 116774
2010-10-19 00:03:23 +00:00
Bill Wendling 9987c0ea42 We shouldn't keep track of MMX registers "needed" separately from the SSE
registers needed.

llvm-svn: 116772
2010-10-18 23:51:38 +00:00
Eric Christopher 8a8673ea39 From scratch rewrite of mm_malloc.h.
Patch by Matthew Beaumont-Gay!

llvm-svn: 116771
2010-10-18 23:38:51 +00:00
Daniel Dunbar cb79c22678 tests: Force triple to avoid limited precision warning on win32.
llvm-svn: 116770
2010-10-18 23:37:08 +00:00
Ted Kremenek da8a79ac8d "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.

llvm-svn: 116769
2010-10-18 23:36:05 +00:00
Daniel Dunbar 473f8a6f88 Driver: Reject -fasm-blocks except on X86 (where we just ignore it, since
passing it is very prevalent in some circles).

llvm-svn: 116761
2010-10-18 22:49:46 +00:00
Daniel Dunbar 2b4de14b1d 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.

llvm-svn: 116759
2010-10-18 22:36:15 +00:00
Daniel Dunbar 767bbabb24 Driver/Darwin: Forward -ObjC when linking, which may be needed when using static
libraries with Objective-C code.

llvm-svn: 116758
2010-10-18 22:08:36 +00:00
Douglas Gregor c769d6e007 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.

llvm-svn: 116757
2010-10-18 22:01:46 +00:00
Douglas Gregor 643c330b91 Provide code completion for types after the '^' that starts a block
literal. 

llvm-svn: 116754
2010-10-18 21:34:55 +00:00
John McCall 18e4edae82 Fix some bugs in local class mangling brought up in PR8355.
Patch by Richard Smith!

llvm-svn: 116752
2010-10-18 21:28:44 +00:00
Douglas Gregor 8e3e8743fb 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.

llvm-svn: 116746
2010-10-18 21:05:04 +00:00
Argyrios Kyrtzidis 9beef8e53d 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

llvm-svn: 116737
2010-10-18 19:20:11 +00:00
Argyrios Kyrtzidis 754fb5ffb3 Merge header & cpp for test/PCH/attrs.c - more convenient to keep the tests in one source file.
llvm-svn: 116736
2010-10-18 19:20:05 +00:00
Douglas Gregor 1b035bbe3a 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*.

llvm-svn: 116723
2010-10-18 18:21:28 +00:00
Fariborz Jahanian f34011e4ca patch fixes class names missing from method names in debug information for
synthesized property. // rdar: //8498026

llvm-svn: 116717
2010-10-18 17:51:06 +00:00
Anders Carlsson 778ca32c88 Implement the first half of [dcl.attr.override]p6.
llvm-svn: 116709
2010-10-18 16:24:27 +00:00
Francois Pichet a310806ae5 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

llvm-svn: 116704
2010-10-18 15:01:13 +00:00
Douglas Gregor 6769922d8c Add iteration over the preprocessor conditional stack to PreprocessorLexer
llvm-svn: 116703
2010-10-18 14:43:21 +00:00
Douglas Gregor 70d80598c5 Add declarations nested in a linkage specification to the output of
-ast-print-xml, from Martin Vejnar!

llvm-svn: 116702
2010-10-18 14:35:28 +00:00
Michael J. Spencer a9e009e5bd CodeGen: Fix long double on Windows using MSVC runtime.
llvm-svn: 116700
2010-10-18 07:11:10 +00:00
Michael J. Spencer feb799c14b Fix Whitespace.
llvm-svn: 116699
2010-10-18 07:10:59 +00:00
Bill Wendling 5cd41c4b13 Reapply r116684 with fixes. The test cases needed to be updated.
llvm-svn: 116696
2010-10-18 03:41:31 +00:00
Oscar Fuentes 16d73f9216 Do not use absolute path on the clang++ symlink.
Based on a patch by Ryuta Suzuki!

llvm-svn: 116695
2010-10-18 02:25:54 +00:00
Anders Carlsson 0ea1047d51 Implement [dcl.attr.override]p2 and add tests for p1 and p2.
llvm-svn: 116692
2010-10-17 23:36:12 +00:00
Anders Carlsson fa9de26518 Add test for [dcl.attr.final]p4.
llvm-svn: 116691
2010-10-17 22:47:44 +00:00
Oscar Fuentes 95b6f045f1 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.

llvm-svn: 116689
2010-10-17 16:10:32 +00:00
Bill Wendling c7c9be661f Temporarily revert r116684. It was causing failures with
Clang :: CodeGen/x86_32-arguments-darwin.c
    Clang :: CodeGen/x86_32-arguments-linux.c

llvm-svn: 116687
2010-10-17 07:58:46 +00:00
Bill Wendling 812f4b123e 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.

llvm-svn: 116684
2010-10-17 07:38:01 +00:00
Argyrios Kyrtzidis cd86570b93 Xcode keeps modifying the project file and I don't know how to ignore the change; just commit it.
llvm-svn: 116673
2010-10-16 17:18:07 +00:00
John McCall d509182336 Coding by inspection has its problems.
llvm-svn: 116672
2010-10-16 16:34:08 +00:00
Gabor Greif 6a46da277f validator
llvm-svn: 116668
2010-10-16 09:40:21 +00:00
Gabor Greif 4b50bd8a2e these items are done, afaik
llvm-svn: 116667
2010-10-16 09:29:38 +00:00
John McCall 17afe45a87 objc_exception_rethrow does not take an exception argument.
rdar://problem/8535238

llvm-svn: 116663
2010-10-16 08:21:07 +00:00
John McCall c9739e30c6 Reformatting.
llvm-svn: 116662
2010-10-16 07:23:36 +00:00
John McCall 2c2eb12d9c White-listing templated-scope friend decls is a good idea, but doing it
by marking the decl invalid isn't.  Make some steps towards supporting these
and then hastily shut them down at the last second by marking them as
unsupported.

llvm-svn: 116661
2010-10-16 06:59:13 +00:00
Daniel Dunbar 622581b73b Revert r116656, "IRgen/Obj-C/NeXT: Fix the IR signature for
objc_exception_rethrow, so we don't...", since something is actually trying to
call this with the wrong signature (!). Unfortunately I don't understand the new
EH infrastructure well enough to fix it immediately.

llvm-svn: 116660
2010-10-16 05:04:10 +00:00
Daniel Dunbar b4ece9cf2f Add an empty robots.txt, mostly just to reduce errors in HTTP log.
llvm-svn: 116658
2010-10-16 04:10:37 +00:00
Daniel Dunbar cc5b831149 Add a favicon.ico, mostly just to reduce errors in HTTP log.
llvm-svn: 116657
2010-10-16 04:08:19 +00:00
Daniel Dunbar 90bb5c2315 IRgen/Obj-C/NeXT: Fix the IR signature for objc_exception_rethrow, so we don't
generate unnecessary %al clear on x86_64.

llvm-svn: 116656
2010-10-16 04:08:16 +00:00
Fariborz Jahanian 1cee0adea3 Fix a rewriting bug of rewriting properties declared in
protocols. // rdar: //8558702

llvm-svn: 116652
2010-10-16 00:29:27 +00:00
Ted Kremenek 51651089ab Tweak scan-build to work with naked clang commands.
llvm-svn: 116651
2010-10-16 00:29:16 +00:00
Chandler Carruth dc689c4156 Not really sure how this worked, but it seems like a clear typo. =]
llvm-svn: 116650
2010-10-16 00:24:52 +00:00
Douglas Gregor 1f81ced14c Allow list-initialization of a local variable of class type with a
flexible array member, so long as the flexibility array member is
either not initialized or is initialized with an empty initializer
list. Fixes <rdar://problem/8540437>.

llvm-svn: 116647
2010-10-15 23:53:28 +00:00
Douglas Gregor bafff22b91 Disable this test again, which naturally fails on every platform except the one I'm building with
llvm-svn: 116642
2010-10-15 23:23:05 +00:00
Ted Kremenek 4f63ac7057 Tweak retain/release checker diagnostics to specify a leak occurs because an object is not referenced later in the path,
not that it isn't referenced later in the code.  Fixes <rdar://problem/8527839>.

llvm-svn: 116636
2010-10-15 22:50:23 +00:00
Fariborz Jahanian dddf158c19 Check for ivar being a C++ object before attempting to
find a copy constructor/assignment operator used
in getter/setter synthesis. This removes an unintended
diagnostics and makes objc++ consistant with objective-c.
// rdar: //8550657.

llvm-svn: 116631
2010-10-15 22:42:59 +00:00
Daniel Dunbar 6358d6866d Driver: Error on -fno-for-scope, which we have no intention of supporting.
llvm-svn: 116627
2010-10-15 22:30:42 +00:00
Nick Lewycky c60d6e7af0 Report the location of the syntax error inside a macro. Fixes PR7944.
llvm-svn: 116624
2010-10-15 21:43:24 +00:00
Francois Pichet 8c2f519b8b bool bit fields are causing problems with MSVC. Replace them with unsigned bit fields.
llvm-svn: 116623
2010-10-15 21:34:50 +00:00
Dan Gohman f47df3e02a Mention the paragraphs in the standards which sanction TBAA.
llvm-svn: 116617
2010-10-15 20:54:41 +00:00
Dan Gohman c44fd6486e Use a different name for pointer types in tbaa, to be a little
more consistent with other names, and to look less like a magic name.

llvm-svn: 116616
2010-10-15 20:26:20 +00:00
Dan Gohman 2d0a3c7b8c Add a comment.
llvm-svn: 116615
2010-10-15 20:24:53 +00:00
Dan Gohman 4a3b1b3ef4 Fix a typo in a comment Frits van Bommel spotted.
llvm-svn: 116614
2010-10-15 20:24:10 +00:00
Dan Gohman 2e29eb5a4b Experimental TBAA support for enum types.
llvm-svn: 116613
2010-10-15 20:23:12 +00:00
Argyrios Kyrtzidis 59b34c2bb4 Again, add '-include-pch' option to the driver, so it can get passed to the cc1 driver.
llvm-svn: 116608
2010-10-15 18:52:45 +00:00
Argyrios Kyrtzidis dfe47dba37 Revert r116605, a lot more were committed by mistake.
llvm-svn: 116606
2010-10-15 18:51:34 +00:00
Argyrios Kyrtzidis ffbba26285 Add '-include-pch' option to the driver, so it can get passed to the cc1 driver.
llvm-svn: 116605
2010-10-15 18:49:01 +00:00
Fariborz Jahanian 4f99b59df6 Eradicate IsSuper field from ObjCImplicitSetterGetterRefExprClass
AST node. (finishing off radar 8525788).

llvm-svn: 116603
2010-10-15 18:40:05 +00:00
Devang Patel f3ca447c26 TBAA = Type Based Alias Analysis
llvm-svn: 116599
2010-10-15 18:23:36 +00:00
Argyrios Kyrtzidis 434383d703 Read/write to/from PCH DeclarationNameLocs, DeclarationNameInfos and QualifierInfos (rdar://8513756).
llvm-svn: 116598
2010-10-15 18:21:24 +00:00
Dan Gohman d19ee8a07f Don't leak the TBAA object.
llvm-svn: 116595
2010-10-15 18:04:46 +00:00
Dan Gohman f5c5e0773e Add a comment about odd "signed char" incompatibility between C++ and C.
llvm-svn: 116593
2010-10-15 17:52:03 +00:00
David Chisnall 2e16ac52e1 Add clang_getLocationForOffset() to libclang, for gives a source location from a character index into a file.
llvm-svn: 116587
2010-10-15 17:07:39 +00:00
Douglas Gregor 26c5578d84 When performing typo correction, keep track of whether the last lookup
we did was an acceptable lookup. If it is, then we can re-use that
lookup result. If it isn't, we have to perform the lookup again. This
is almost surely the cause behind the mysterious typo.m failures on
some builders; we were getting the wrong lookup results returned.

llvm-svn: 116586
2010-10-15 16:49:56 +00:00
Daniel Dunbar 2a40abae4d Disable type.m while failures are investigated.
llvm-svn: 116577
2010-10-15 15:28:09 +00:00
Daniel Dunbar 1837dbd4e3 Make test more consistent.
llvm-svn: 116576
2010-10-15 15:13:02 +00:00
Douglas Gregor af9eb59274 When we're in the context of an Objective-C message send's receiver,
typo correction prefers "super" over other, equivalent completions. I
believe this will fix the regression on the buildbot.

llvm-svn: 116574
2010-10-15 13:35:25 +00:00
Douglas Gregor 36c22a2335 Diagnose C++ [class.mem]p13-14, where a class member has the same name
as the class itself. Fixes PR7082.

llvm-svn: 116573
2010-10-15 13:21:21 +00:00
Gabor Greif de1f58919a zap trailing whitespace
llvm-svn: 116572
2010-10-15 08:48:51 +00:00
Gabor Greif 7e1dd672fb testcase for http://llvm.org/PR8371 of my last commit, r116570
llvm-svn: 116571
2010-10-15 08:44:44 +00:00
Gabor Greif eef3197301 fix http://llvm.org/PR8371 in the straightforward way, also adding a comment
llvm-svn: 116570
2010-10-15 08:26:25 +00:00
Abramo Bagnara 932e393fda Treat __extension__ like ParenExpr.
llvm-svn: 116569
2010-10-15 07:51:18 +00:00
Craig Silverstein 12a198e5b1 Recurse on a TypeLoc rather than a Type for TypedefDecl, now that the
typloc information is available (I don't think it was, originally).
Submitted as a 'trivial' change.

llvm-svn: 116568
2010-10-15 06:51:01 +00:00
John McCall 1c9c3fd50a Death to blocks, or at least the word "block" in one particular obnoxiously
ambiguous context.

llvm-svn: 116567
2010-10-15 04:57:14 +00:00
Douglas Gregor d4e1fb562e Don't complain about a variable within a linkage-specification that is
initialized. Fixes PR7076.

llvm-svn: 116553
2010-10-15 01:21:46 +00:00
Douglas Gregor b048402073 When we are missing the ',' or '>' to terminate a template parameter
list, complain about it! Fixes PR7053.

llvm-svn: 116551
2010-10-15 01:15:58 +00:00
Douglas Gregor 8a8e0313bf Add builtin conditional operator candidates for scoped enumeration
types, from Alp Toker! Fixes PR8344.

llvm-svn: 116549
2010-10-15 00:50:56 +00:00
Daniel Dunbar 59ae137329 Update CMake.
llvm-svn: 116548
2010-10-15 00:39:31 +00:00
Oscar Fuentes b3ce035c71 Copied some flags from the Makefile build to the list of GCC flags.
This removes a lot of warnings.

llvm-svn: 116545
2010-10-15 00:16:22 +00:00
Dan Gohman d65c196439 Add a TBAA type for pointer types.
llvm-svn: 116544
2010-10-15 00:01:39 +00:00
Dan Gohman 3f1cf0f373 Unsigned types are TBAA-compatible with their signed counterparts.
Also, handle unknown types conservatively.

llvm-svn: 116541
2010-10-14 23:39:00 +00:00
Fariborz Jahanian 9c07e1767d Rewrite bug fix rewriting a property assignment when
its RHS is an ivar. Fixes //rdar: //8541517.

llvm-svn: 116539
2010-10-14 23:31:39 +00:00
Dan Gohman 947c9af774 Experimental TBAA support.
This enables metadata generation by default, however the TBAA pass
in the optimizer is still disabled for now.

llvm-svn: 116536
2010-10-14 23:06:10 +00:00
Devang Patel 0f58561907 Use root non-virtual primary base class, not just immediate primary base class, for AT_containing_type.
This is tested by virtfunc.exp in gdb testsuite.

llvm-svn: 116535
2010-10-14 22:59:23 +00:00
Dan Gohman 10169b94cf Wire up the -fstrict-aliasing and -fno-strict-aliasing options
to CodeGenOption flags.

llvm-svn: 116530
2010-10-14 22:36:56 +00:00
John McCall f477659040 template-ids are looked up differently in friend declarations.
llvm-svn: 116529
2010-10-14 22:22:28 +00:00
Douglas Gregor 57756eabc9 When performing typo correction, look through the set of known
identifiers to determine good typo-correction candidates. Once we've
identified those candidates, we perform name lookup on each of them
and the consider the results. 

This optimization makes typo correction > 2x faster on a benchmark
example using a single typo (NSstring) in a tiny file that includes
Cocoa.h from a precompiled header, since we are deserializing far less
information now during typo correction.

There is a semantic change here, which is interesting. The presence of
a similarly-named entity that is not visible can now affect typo
correction. This is both good (you won't get weird corrections if the
thing you wanted isn't in scope) and bad (you won't get good
corrections if there is a similarly-named-but-completely-unrelated
thing). Time will tell whether it was a good choice or not.

llvm-svn: 116528
2010-10-14 22:11:03 +00:00
Douglas Gregor c3bbf48f47 Make sure that we diagnose invalid qualifiers on friend functions.
llvm-svn: 116527
2010-10-14 22:03:51 +00:00
John McCall 25c9d1170b At Fariborz's request, a somewhat cleaner bit-combining hack.
llvm-svn: 116524
2010-10-14 21:48:26 +00:00
Andrew Trick 6c8ce5c8b5 Reverting r116493: removes a test that failed on clang selfhost and msvc
llvm-svn: 116522
2010-10-14 21:41:16 +00:00
Argyrios Kyrtzidis a665dc0770 Fix compiler error that clang didn't report (probably same problem as rdar://8552377).
It's more stress-free without access checking though..

llvm-svn: 116521
2010-10-14 21:35:29 +00:00
Fariborz Jahanian a895c38928 Put line number on the diagnostic. //rdar: //8550657.
llvm-svn: 116519
2010-10-14 21:30:10 +00:00
Francois Pichet 41232a9872 r116509 fixed the Win32 XFAIL.
The failing was due to this:
1. preamble.c contains CR+LF new lines
2. write() is called with a buffer containing the original (CR+LF) to output the result on the console.
3. In text mode(the default), write() convert LF to CR+LF even if LF is preceded by CR, hence we have CR+CR+LF which filecheck interprets as 2 lines.

llvm-svn: 116513
2010-10-14 20:49:46 +00:00
Douglas Gregor 0afa7f66cd Tweak the typo-correction implementation to determine corrections
solely based on the names it sees, rather than actual declarations it
gets. In essence, we determine the set of names that are "close
enough" to the typo'd name. Then, we perform name lookup for each of
those names, filtering out those that aren't actually visible, and
typo-correct from the remaining results.

Overall, there isn't much of a change in the behavior of typo
correction here. The only test-suite change comes from the fact that
we make good on our promise to require that the user type 3 characters
for each 1 character corrected. 

The real intent behind this change is to set the stage for an
optimization to typo correction (so that we don't need to deserialize
all declarations in a translation unit) and future work in finding
missing qualification ("'vector' isn't in scope; did you mean
'std::vector'?). Plus, the code is cleaner this way.

llvm-svn: 116511
2010-10-14 20:34:08 +00:00
Argyrios Kyrtzidis 6843141d39 Store in PCH the key function of C++ class to avoid deserializing the complete declaration context in order to compute it.
Progress for rdar://7260160.

llvm-svn: 116508
2010-10-14 20:14:38 +00:00
Argyrios Kyrtzidis 0e88a565c0 Allow deserialization of just the fields of a record, when we want to iterate over them,
instead of deserializing the complete declaration context of the record.

Iterating over the fields of a record is very common (e.g to determine the layout), unfortunately we needlessly deserialize every declaration
that the declaration context of the record contains; this can be bad for large C++ classes that contain a lot of methods.
Fix this by allow deserialization of just the fields when we want to iterate over them.
Progress for rdar://7260160.

llvm-svn: 116507
2010-10-14 20:14:34 +00:00
Argyrios Kyrtzidis 55d1fc2d3c Give a default implementation for ASTDeserializationListener's methods, no functionality change.
llvm-svn: 116506
2010-10-14 20:14:28 +00:00
Argyrios Kyrtzidis 0427be938e Introduce command line option -error-on-deserialized-decl that is accompanied by a name
and emits an error if a declaration with this name is deserialized from PCH.

This is for testing, to make sure that we don't deserialize stuff needlessly.

llvm-svn: 116505
2010-10-14 20:14:25 +00:00
Argyrios Kyrtzidis 470c454a61 Don't add the injected class name to the redeclarations chain; the chain should contain actual redeclarations, not implicits.
As a bonus, now we don't deserialize it unless we need it.

llvm-svn: 116504
2010-10-14 20:14:21 +00:00
Argyrios Kyrtzidis a11aca4646 Introduce command line option -dump-deserialized-decls which is used to print the PCH decls that got deserialized, for testing purposes.
llvm-svn: 116503
2010-10-14 20:14:18 +00:00
David Chisnall a9d40ee0ab Test case for r116439
llvm-svn: 116493
2010-10-14 18:15:20 +00:00