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

8631 Коммитов

Автор SHA1 Сообщение Дата
Anders Carlsson a4c6081abd Who would have thought that empty classes were so tricky? Handle cases where an empty virtual base class needs to be moved aside because it conflicts with the first field.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82746 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 01:54:38 +00:00
John McCall a180529e3d Fix an infinite loop arising when trying to generate debug information
for a ObjC class with an ivar of weak self type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82745 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 01:40:47 +00:00
Anders Carlsson fbbce49c11 Handle array fields that contain empty structs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82744 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 01:23:32 +00:00
Ted Kremenek 80417471b0 Fix <rdar://problem/7249327> by allowing silent conversions between signed and unsigned integer values for symbolic values. This is an intermediate solution (i.e. hack) until we support extension/truncation of symbolic integers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82737 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 00:18:15 +00:00
Anders Carlsson 6026504302 More work on empty classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82736 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 00:02:51 +00:00
Fariborz Jahanian 76368e843c Fixed another code gen bug in objc's new write-barrier API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82735 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 00:00:20 +00:00
Anders Carlsson 8fdccd95fc Improve the record layout dumper.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82733 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 23:50:42 +00:00
Douglas Gregor 7dfd0fb083 When entering the scope of a declarator, make sure that the scope is
complete (or, possibly causing template instantiation).

Test this via some explicit specializations of member functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82732 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 23:39:01 +00:00
John McCall 6b304a0254 Make it really, really easy to change the alignment of Type (and ExtQuals).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82730 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 23:30:46 +00:00
Douglas Gregor b9aa6b214c WIP implementation of explicit function template specialization. This
first implementation recognizes when a function declaration is an
explicit function template specialization (based on the presence of a
template<> header), performs template argument deduction + ambiguity
resolution to determine which template is being specialized, and hooks

There are many caveats here:
  - We completely and totally drop any explicitly-specified template
  arguments on the floor
  - We don't diagnose any of the extra semantic things that we should
  diagnose. 
  - I haven't looked to see that we're getting the right linkage for
  explicit specializations

On a happy note, this silences a bunch of errors that show up in
libstdc++'s <iostream>, although Clang still can't get through the
entire header.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82728 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 23:14:47 +00:00
Mike Stump bb30419d81 Fix 80-col violation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82725 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 22:31:14 +00:00
Fariborz Jahanian 6c7a1f3647 Patch fixes a code gen. bug in generation of objc_assign_ivar
(objc GC's API).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82724 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 22:25:38 +00:00
John McCall 0953e767ff Refactor the representation of qualifiers to bring ExtQualType out of the
Type hierarchy.  Demote 'volatile' to extended-qualifier status.  Audit our
use of qualifiers and fix a few places that weren't dealing with qualifiers
quite right;  many more remain.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82705 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 19:53:00 +00:00
Anders Carlsson 78762ebb9a Add a -dump-record-layouts argument to clang-cc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82703 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 18:54:49 +00:00
Ted Kremenek 6c2497248b When building CFGs, no longer reverse the statements in the CFGBlock. Instead
have the iterators and operator[] handle the traversal of statements, as they
are stored in reverse order. Tests show this has no real performance impact, but
it does simply the CFG construction logic and will make it slightly easier to
change the allocation strategy for CFGBlocks (as we have fewer copies).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82702 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 18:45:41 +00:00
Ted Kremenek 35dcad8aee Fix crash in RegionStoreManager::Bind() by using 'getAs<PointerType>()' instead of 'cast<PointerType>()' (to handle pointer typedefs).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82686 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 06:24:32 +00:00
Anders Carlsson ffbdefc7a2 More improvements with laying out empty bases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82682 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 05:21:31 +00:00
Daniel Dunbar 55e59e139d Darwin/x86-32: Enumerated types and block pointer types in structures were not
handled correctly.
 - <rdar://problem/7247671> Function arguments incorrect when function returns a
   struct on i386 w/ llvm-g++ and clang

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82681 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 05:12:36 +00:00
Ted Kremenek 0954cdec4b Fix: <rdar://problem/7249340> [RegionStore] model stores to symbolic parameter regions
The issue was a discrepancy between how RegionStoreManager::Bind() and
RegionStoreManager::Retrieve() derived the "key" for the first element
of a symbolic region.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82680 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 04:11:44 +00:00
Anders Carlsson 1345bd2b09 More work on empty classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82679 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 03:22:10 +00:00
Anders Carlsson 9606149722 Scaffolding for supporting empty bases/fields.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82678 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 03:13:30 +00:00
Ted Kremenek 112ba7e57e Shorten the static analyzer diagnostic for 'use of garbage value'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82672 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 00:44:26 +00:00
Fariborz Jahanian 7ad2d562e8 Use Doug's DeclLoc to pinpoint location of the declaration
in a reference initialization diagnostic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82671 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 00:42:43 +00:00
Douglas Gregor 739d828314 Improve diagnostic location information when checking the initialization of a reference
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82666 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 23:04:10 +00:00
Fariborz Jahanian 8f489d692f patch to ir-gen conversion function call used in
initializing a reference class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82664 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 22:34:00 +00:00
Douglas Gregor eb5758bbfd For code completion, note that injected-class-names found as part of
lookup in a member access expression always start a
nested-name-specifier. Additionally, rank names that start
nested-name-specifiers after other names.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82663 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 22:26:46 +00:00
Fariborz Jahanian 2b51138433 Remove the FIXME as I said.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82650 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 20:56:34 +00:00
Fariborz Jahanian 51bebc83e7 This patch addresses a few issues related to 8.5.3 [dcl.init.ref]
It uses a recent API to find inherited conversion functions to do
the initializer to reference lvalue conversion (and removes a FIXME).
It issues the ambiguity diagnostics when multiple conversions are found.
WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82649 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 20:55:32 +00:00
Anders Carlsson 018837b081 Handle namespace aliases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82644 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 19:19:16 +00:00
Anders Carlsson 6ac5fc49ee Emit new[] cookie when needed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82642 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 18:59:48 +00:00
Anders Carlsson a4d4c019bf Basic support for new[].
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82628 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 16:07:23 +00:00
Douglas Gregor 5bd1a1151f When code-completion after a "," is building an overload set, note
that there is one more argument (the one following the comma) and make
the candidate non-viable if the function cannot accept any argument in
that position.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82625 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 14:56:09 +00:00
Daniel Dunbar 9fe4a5d8a6 Factor Windows target into VS, MinGW and Cygwin variants.
- Patch by John Thompson!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82621 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 07:31:35 +00:00
Chris Lattner 21fb98ee00 implement support for __builtin_eh_return_data_regno on x86-32 and x86-64.
This implements PR5034 and rdar://6836445.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82614 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 06:06:36 +00:00
Anders Carlsson 569c1f4a6c Add a new variant of EmitCXXAggrConstructorCall that takes a Value that holds the number of elements to construct, to be used when implementing new[].
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82602 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 02:45:36 +00:00
Ted Kremenek 657406dd40 Fix PR 4988 by removing an invalid assertion (a function can be referenced in
GRExprEngine::VisitDeclRefExpr without 'asLValue' being true).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82598 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 01:30:01 +00:00
Fariborz Jahanian b1663d0507 Produce detailed diagnostics when overload
resolution failed to select a candidate due to
ambiguity in type conversion function selection.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82596 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 00:58:07 +00:00
Anders Carlsson ac18b2e3af Cast the array size expr to a size_t
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82594 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 00:37:25 +00:00
Douglas Gregor 86d802e03a Print the results of code-completion for overloading by displaying the
signature of the function with the current parameter highlighted as a
placeholder.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82593 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 00:34:09 +00:00
Douglas Gregor 0594438e06 Separate the code-completion results for call completion from the
results for other, textual completion. For call completion, we now
produce enough information to show the function call argument that we
are currently on.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82592 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 00:16:58 +00:00
Douglas Gregor 8e0a0e4e45 Make sure we don't try to add code-completion results without an
active shadow map.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82588 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 23:31:26 +00:00
Douglas Gregor 3e7253f155 When code-completion finds a declaration only because it is usable as
the start of a nested-name-specifier, add the "::" after the
nested-name-specifier to the code-completion string.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82587 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 23:22:24 +00:00
Douglas Gregor 0563c2677c Tweak the code-completion results ranking and formation, so that
members found in base classes have the same ranking as members found
in derived classes. However, we will introduce an informative note for
members found in base classes, showing (as a nested-name-specifier)
the qualification to name the base class, to make it clear which
members are from bases.
 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82586 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 23:15:58 +00:00
Anders Carlsson 16d81b8db3 Move codegen of new and delete to CGCXXExpr.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82585 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 22:53:17 +00:00
Mike Stump 45504e568c Remove now fixed FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82584 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 22:31:44 +00:00
Daniel Dunbar f44c585632 Push "clang-is-production" logic up to tools/driver, and make it hittable by
defining the CLANG_IS_PRODUCTION Makefile variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82583 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 22:31:13 +00:00
Anders Carlsson 592a2bbc19 No need to null check implicit lvalue cast exprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82580 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 22:00:46 +00:00
Anders Carlsson dfd0330267 When doing a derived-to-base class and the class offset is 0 we can just do a simple bitcast.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82579 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 21:58:22 +00:00
Daniel Dunbar dff10dcee0 Reconcile Clang/ARM target data string with llvm-gcc (module eabi weirdness).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82578 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 21:44:58 +00:00
Douglas Gregor b3d4525c65 Teach code-completion to introduce a ", ..." placeholder for variadic functions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82577 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 21:42:17 +00:00