Граф коммитов

8207 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor aaa107acc8 When calling a function or messaging a method marked "sentinel", add
the ", nil", ", NULL", or ", (void*)0" to the end of the code
completion, since it always has to be there anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111867 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 23:51:41 +00:00
Douglas Gregor 58ddb60f40 Introduce new libclang API functions that determine the availability
of a cursor or code-completion result, e.g., whether that result
refers to an unavailable, deleted, or deprecated declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111858 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 23:00:57 +00:00
Devang Patel 6237cea785 Emit debug info for enum constants.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111852 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 22:07:25 +00:00
Douglas Gregor aa5f77b2c9 Include __FUNCTION__, __PRETTY_FUNCTION_, __func__ in code-completion
results for expression contexts within a function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111851 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 21:54:33 +00:00
Douglas Gregor fb6294123b Introduce a code-completion hook for the Objective-C collection
argument in a for-each statement (e.g., "for (id x in <blah>)"), which
restricts the expression completions provided to Objective-C types (or
class types in C++).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 21:17:50 +00:00
Daniel Dunbar 673745ff71 Driver/Darwin: Switch to using simplified tool chain by default -- what better
way to see what will break! :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111840 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 20:58:55 +00:00
Tom Care 823894110e Modified pseudoconstant test case to make it a bit clearer and fix a missing line
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111833 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 19:57:25 +00:00
Tom Care db34ab7096 Several small changes to PseudoConstantAnalysis and the way IdempotentOperationChecker uses it.
- Psuedo -> Pseudo (doh...)
- C++ reference support
- Added pseudoconstant test case for __block vars
- Separated out static local checking from pseudoconstant analysis and generalized to non-local checking
- Added missing test cases for storage false positives

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111832 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 19:51:57 +00:00
Fariborz Jahanian 000835d0b0 Support for IRGen of synthesize bitfield ivars in
objc-nonfragile-abi2 (radar 7824380).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111823 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 18:51:39 +00:00
Devang Patel e5848d680c test case for PR7920.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111821 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 18:26:10 +00:00
Douglas Gregor 2ccccb3ff4 Introduce a new code-completion point when we're parsing a
declarator. Here, we can only see a few things (e.g., cvr-qualifiers,
nested name specifiers) and we do not want to provide other non-macro
completions. Previously, we would end up in recovery mode and would
provide a large number of non-relevant completions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111818 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 18:23:48 +00:00
Douglas Gregor ae2fb144fe When complaining about a duplicate declspec, provide a Fix-It that
removes the copy. Patch from Eelis van der Weegen, tweaked/updated by
me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111807 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 14:34:43 +00:00
Chandler Carruth 4e6fbce427 Relax the construction of a definition for implicit, trivial default
constructors. We perform semantic checking when creating the definition, and
this isn't needed in certain contexts (value initialization) but is in others
(default initialization). This fixes PR7948.

We add explicit code to the default initialization path to ensure the
definition is both present and valid.

Doug, please review. I think this follows your latest suggestion, and it ended
up remarkably cleaner than I anticipated. Also let me know if similar logic
should be followed for destructors and copy-constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111802 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 07:55:51 +00:00
Argyrios Kyrtzidis 42d0f2a03e In Sema::AddBuiltinOperatorCandidates, candidate pointer types set can also contain a ObjCObjectPointerType since r111699.
Don't assume that they are only PointerTypes or we will crash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111798 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 07:12:16 +00:00
Chris Lattner b6c504b910 fix rdar://8340348, a miscompile of boost that was exposed by r109848.
That revision started classifying truly empty structs like "Y" and "X"
as being NoClass/NoClass and turning them into 'ignore'.  The call code
turns around and allocates space for the ignored argument with 
GetUndefRValue.  The bug is that GetUndefRValue would return the address
as undef, instead of returning an object with a defined address but 
undefined contents.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111794 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 05:26:13 +00:00
John McCall 0bab0cdab7 Abstract out everything having to do with member pointers into the ABI
class;  they should just be completely opaque throughout IR gen now,
although I haven't really audited that.

Fix a bug apparently inherited from gcc-4.2 where we failed to null-check
member data pointers when performing derived-to-base or base-to-derived
conversions on them.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111789 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 01:21:21 +00:00
John McCall f16aa103d3 Go back to asking CodeGenTypes whether a type is zero-initializable.
Make CGT defer to the ABI on all member pointer types.
This requires giving CGT a handle to the ABI.
It's way easier to make that work if we avoid lazily creating the ABI.
Make it so.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111786 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 21:01:12 +00:00
Douglas Gregor b8f7de94c3 Do not elide copy construction when we're performing base-class initialization
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111783 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 18:27:02 +00:00
Douglas Gregor db68e28c05 Eliminate a stale assertion. Fixes Clang self-host.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111782 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 18:26:35 +00:00
Douglas Gregor 8c3e554d00 Preserve the zero-initialization and construction-kind settings when
instantiating CXXConstructExpr expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111780 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 17:20:18 +00:00
Douglas Gregor 759e41baf6 When performing value-initialization for a class with a non-trivial,
implicitly-defined default constructor, zero-initialize the memory
before calling the default constructor. Previously, we would only
zero-initialize in the case of a trivial default constructor.

Also, simplify the hideous logic that determines when we have a
trivial default constructor and, therefore, don't need to emit any
call at all.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111779 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 16:15:35 +00:00
John McCall e14add4a27 Clean up a very silly use of first-class aggregates.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111777 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 11:04:31 +00:00
John McCall d608cdb7c0 Experiment with using first-class aggregates to represent member function
pointers.  I find the resulting code to be substantially cleaner, and it
makes it very easy to use the same APIs for data member pointers (which I have
conscientiously avoided here), and it avoids a plethora of potential
inefficiencies due to excessive memory copying, but we'll have to see if it
actually works.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111776 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 10:59:02 +00:00
John McCall 875ab10245 Abstract out member-pointer creation. I'm really unhappy about the current
duplication between the constant and non-constant paths in all of this.

Implement ARM ABI semantics for member pointer constants and conversion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111772 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 06:43:33 +00:00
Benjamin Kramer 1e33f4fd37 Avoid including mm_malloc.h in a cc1 test, it pulls in system headers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111738 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-21 13:39:38 +00:00
John McCall 85eaff3d0b This test needs a triple: it's checking the alignment of a pointer in bytes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111727 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-21 04:58:16 +00:00
Daniel Dunbar 983e3d7dac IRgen: Set the alignment correctly when creating LValue for a decls.
- Fixes PR5598.
 - Review appreciated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111726 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-21 04:20:22 +00:00
Daniel Dunbar f52697a589 Improve test coverage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111712 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-21 02:46:28 +00:00
Chris Lattner f051d060ab filecheckize test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111702 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-21 00:29:50 +00:00
Chris Lattner 496af57256 fix PR7943, a corner case with the GNU __VA_ARGS__ comma
swallowing extension.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111701 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-21 00:27:00 +00:00
Fariborz Jahanian 648d200efa Contributed test case for PR7936
by Jean-Daniel Dupas.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111700 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-21 00:17:33 +00:00
Fariborz Jahanian 2e2acec770 patch to support comparison involving
objctive-c pointer conversions. Fixes pr7936.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111699 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-21 00:10:36 +00:00
Argyrios Kyrtzidis a60786b46e Fix an issue with writing to PCH another included PCH, introduced by the "using an AST on-disk hash table for name lookup" commit.
When including a PCH and later re-emitting to another PCH, the name lookup tables of DeclContexts
may be incomplete, since we now lazily deserialize the visible decls of a particular name.
Fix the issue by iterating over the un-deserialized visible decls and completing the lookup tables
of DeclContexts before writing them out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111698 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 23:35:55 +00:00
Benjamin Kramer 01b57e362a Disallow direct inclusion of avxintrin.h. Users should include immintrin.h instead. This matches GCC's behavior.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111692 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 23:00:03 +00:00
Nick Lewycky d9ca4ab3ed Add a workaround for PR7947, a crash trying to recover from invalid C++ code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111675 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 20:54:15 +00:00
Douglas Gregor 452b7f22d7 Fix a major regression with value-initialization of class types with
trivial default constructors. We're weren't zero-initializing them,
which manifested as <rdar://problem/8320532> (a regression in the GCC
test suite) and is likely to have caused significant other breakage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111650 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 16:57:37 +00:00
Chris Lattner d6b84b9455 fix some vector extractions to return properly zero extended values
(instead of sign extending) to match ICC.  GCC is changing this in 
a series of their own PRs (e.g. 41323).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111637 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 16:08:33 +00:00
Douglas Gregor 72c4c15e03 Revert r111609, which is failing its new test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111611 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 03:26:10 +00:00
John McCall 29c695b861 Detect efforts to declare a template member friend and explicitly ignore them.
Avoids a crash.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111609 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 01:40:01 +00:00
Jordy Rose 59b6dca7e5 Handle nested compound values in BindArray for multidimensional arrays. Fixes PR7945.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111602 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 01:05:59 +00:00
Douglas Gregor 2283d79155 When performing code-completion in the presence of a preamble, make
sure to (1) actually use the remapped files we were given rather
than old data, and (2) keep the remapped files alive until the
code-completion results are destroyed. Big thanks to Daniel for the
test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111597 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 00:59:43 +00:00
John McCall 6dbce19fda Mangle explicit template arguments in dependent or overloaded names.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111591 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 00:17:19 +00:00
Douglas Gregor f128fed9c2 When we decide not to reuse a precompiled preamble, clear out the
previous precompiled preamble completely. Fixes <rdar://problem/8330950>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111590 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 00:02:33 +00:00
Daniel Dunbar b1fd345868 libclang: Execute clang_codeCompleteAt() inside a crash recovery context.
- Test case is disabled for now, because something isn't write with file
   remapping.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111581 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 23:44:10 +00:00
John McCall 7667245662 Correctly instantiate templates with non-type template arguments that
are local externs.  Fixes <rdar://problem/8302138>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111570 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 23:06:02 +00:00
Daniel Dunbar c1cf1586f7 Fix a loop overrun in ComputePreamble when the last remapped file was erased,
and reenable crash recovery test.
 - Reparsing is still very crashy / weird, so I had to sprinkle random code into
   the remapped input to get it to do what I want (i.e., crash!).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111550 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 19:40:40 +00:00
Eli Friedman 295a637416 Test for PR7888.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111545 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 19:13:24 +00:00
Douglas Gregor 06ebc98ff0 We don't actually need to check the implicit object argument's
conversion a second time for a conversion candidate (with the real
acting context), because the only problems we would find are access or
ambiguity issues that won't be diagnosed until we pick this
candidate. Add a test case to prove it to myself.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111526 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 17:02:01 +00:00
Daniel Dunbar b2842aa3a7 CrashRecovery: Disable the reparse test for now while I investigate, it goes
bonkers sometimes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111523 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 16:40:14 +00:00
Douglas Gregor c774b2f664 Properly implement the part of C++ [over.match.funcs]p4 that treats
conversion functions as if their acting context were the class that
we're converting from (the implicit object argument's
type). Retroactively tweaking the implicit conversion sequence, as we
were trying to do before, breaks the invariants of that implicit
conversion sequence (e.g., the types and conversions don't match
up). Fixes <rdar://problem/8018274>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111520 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 15:57:50 +00:00