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

3275 Коммитов

Автор SHA1 Сообщение Дата
John McCall 871b2e7c0f Rename Sema::IsOverload to Sema::CheckOverload. Teach it to ignore unresolved
using value decls;  we optimistically assume they won't turn into conflicts.
Teach it to tell the caller *why* the function doesn't overload with the returned
decl;  this will be useful for using hiding.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90939 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 03:35:25 +00:00
Anders Carlsson 9f89dd783d Move the missing prototypes checking out into a new function. Don't warn about inline functions. Add a test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90938 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 03:30:09 +00:00
Anders Carlsson b6cc91be4d Pass the current SourceLocation to getAssignOperatorMethod, fixing a crash when the assign operator method needs to be instantiated. Doug, please review the updated default-assignment-operator.cpp change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90935 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 03:01:51 +00:00
Mike Stump b89192151e Add support for the cleanup attribute for C++; we don't have to copy
all of g++'s bugs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90924 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 01:50:36 +00:00
Douglas Gregor 43c79c2b07 Implemented an implicit conversion from "noreturn" function types (and
pointers thereof) to their corresponding non-noreturn function
types. This conversion is considered an exact match for
overload-resolution purposes. Note that we are a little more strict
that GCC is, because we encode noreturn in the type system, but that's
a Good Thing (TM) because it does not allow us to pretend that
potentially-returning function pointers are non-returning function
pointers.

Fxies PR5620.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90913 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 00:47:37 +00:00
Fariborz Jahanian 92ef5d7572 More detailed analysis of typecast to an objective-c pointer
in objective-c++ mode without being too lenient.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90895 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 23:09:15 +00:00
John McCall fead20c1de Handle unresolved using decls in bare lookups. These are not being adequately
tested.  Fixes PR5727.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90893 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 22:45:53 +00:00
Fariborz Jahanian 0cedfbdb44 Patch to allow matching 0 with an objective-c pointer type
in objective-c++ mode. Fixes radar 7443165



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90874 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 20:04:24 +00:00
Fariborz Jahanian ebea307a76 Patch to allow cstyle cast of objective-c pointers in objective-c++
mode as they are pervasive.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90867 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 19:22:33 +00:00
Fariborz Jahanian 52efc3fdba Refactor objective-c pointer assignment compatibility logic. No
intended functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90865 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 18:24:49 +00:00
Douglas Gregor 0ae7b3f1d5 Implement template instantiation for exception specifications. Also,
print exception specifications on function types and
declarations. Fixes <rdar://problem/7450999>.

There is some poor source-location information here, because we don't
track locations of the types in exception specifications. Filed PR5719.

Failures during template instantiation of the signature of a function
or function template have wrong point-of-instantiation location
information. I'll tackle that with a separate commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90863 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 17:45:32 +00:00
Douglas Gregor 1237259bda When performing unqualified name lookup in C++, don't look directly
into transparent contexts; instead, we'll look into their nearest
enclosing non-transparent contexts further up the stack. Fixes PR5479.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90859 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 15:38:36 +00:00
John McCall 454feb9da6 The refactor of implicit member access expressions means we don't need this
horrible isAddressOfOperand hack in TreeTransform, since that syntactic
information is managed by the initial parser callbacks now.

That's enough insomniac commits for one night.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90849 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 09:21:05 +00:00
John McCall dbd872f273 DeclRefExpr stores a ValueDecl internally.
Template instantiation can re-use DeclRefExprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90848 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 09:08:17 +00:00
John McCall 604e7f14d6 Correctly implement the C++03 and 0x restrictions on class-member using
declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90843 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 07:46:18 +00:00
Eli Friedman 6bc20135a2 Fix for PR5710: make sure to put function template specializations into the
DeclContext, so they don't completely disappear from the AST.

I don't particularly like this fix, but I don't see any obviously better way
to deal with it, and I think it's pretty clearly an improvement; comments
welcome.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90835 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 05:40:03 +00:00
Fariborz Jahanian 7e42cf2ca1 Patch to warn when discarding objective-c pointer type qualifiers
Still some refactoring to do.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90830 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 03:35:08 +00:00
John McCall 812c15476c Recover from dot accesses to record pointers and arrow accesses to records.
Patch by Nicola Gigante!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90814 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 22:46:59 +00:00
Ted Kremenek 3cdff236e2 Add the BlockDecl to the DeclContext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90808 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 22:01:30 +00:00
Fariborz Jahanian 6d910f07d8 Allow accessing 'isa' via '->' operator.
(fixes radar 7447251).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90795 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 20:09:25 +00:00
Fariborz Jahanian 2b5ff1a147 Patch to allow restrict applied to id/Class types.
(fixes radar 7442244).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90773 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 18:08:58 +00:00
Douglas Gregor 2a7925c4ab When in an Objective-C instance method, super is a valid code-completion result
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90758 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 09:54:55 +00:00
Douglas Gregor 9a0c85e640 Code completion for Objective-C @ keywords that are statements or expressions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90757 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 09:51:25 +00:00
Douglas Gregor c464ae8444 Code completion for Objective-C @ directives
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90756 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 09:27:33 +00:00
Anders Carlsson d6a637f8c8 Rework how virtual member functions are marked. If a class has no key function, we now wait until the end of the translation unit to mark its virtual member functions as references. This lays the groundwork for fixing PR5557.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90752 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 08:24:59 +00:00
Anders Carlsson f53df2398e Move key functions to a separate map.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90745 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 04:35:11 +00:00
John McCall a93c934af4 DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated variables,
but the results are imperfect.

For posterity, I did:

cat <<EOF > $cmdfile
s/DeclaratorInfo/TypeSourceInfo/g
s/DInfo/TInfo/g
s/TypeTypeSourceInfo/TypeSourceInfo/g
s/SourceTypeSourceInfo/TypeSourceInfo/g
EOF

find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \;
find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \;
find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90743 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 02:54:59 +00:00
Chris Lattner 4664649183 reapply my patch for PR4451, which improves diagnostics for :: vs : confusion.
This time with a fix to bail out when in a dependent context.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90730 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 01:36:53 +00:00
Eli Friedman 721e77db41 Move RequireCompleteType requirement for fields early into ActOnField so that
subsequent code which depends on a complete type does the right thing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90727 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 00:22:08 +00:00
Douglas Gregor d490f953e8 PointerUnion == PointerUnion does not do what I thought it did. Also, fix a thinko in a PointerUnion::get call.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90719 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-06 21:27:58 +00:00
Chris Lattner 1ade4ca0aa revert my previous patch, it is breaking something and I don't have time
to fix it ATM.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90717 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-06 20:58:07 +00:00
Douglas Gregor fbcb5d60d0 Switch the std::multimap shadow map used in code completion to an
llvm::DenseMap, for a 20% performance improvement in the
Cocoa-big-list performance benchmark.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90715 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-06 20:23:50 +00:00
Chris Lattner a564b17dcc implement PR4451, improving error recovery for a mistaken : where a :: was
intended.  On the first testcase in the bug, we now produce:

cxx-decl.cpp:12:2: error: unexpected ':' in nested name specifier
y:a a2;
 ^
 ::

instead of:

t.cc:8:1: error: C++ requires a type specifier for all declarations
x:a a2;
^
t.cc:8:2: error: invalid token after top level declarator
x:a a2;
 ^
 ;
t.cc:9:11: error: use of undeclared identifier 'a2'
x::a a3 = a2;
          ^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90713 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-06 19:08:11 +00:00
Chris Lattner 29d9c1adfa remove some extraneous syntax: sourceloc implicitly converts to sourcerange.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90710 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-06 17:36:05 +00:00
Eli Friedman 0336843eb0 Fix a slight oversight in computing whether a copy constructor is elidable.
Fixes PR5695.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90702 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-06 09:26:33 +00:00
Anders Carlsson 3527225899 Pass the desired vtable linkage to GenerateVtable directly. Only call MaybeMarkVirtualImplicitMembersReferenced for non-inline functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90686 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-06 00:23:49 +00:00
Eli Friedman d013733c73 Fix for PR5693: shift some code into SetClassDeclAttributesFromBase so that
it gets called during template instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90682 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 23:03:49 +00:00
Benjamin Kramer 0e7049fc6f Avoid trashing two temporary strings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90663 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 10:22:15 +00:00
Benjamin Kramer f42d4886ae strcasecmp is unportable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90662 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 10:07:04 +00:00
Douglas Gregor 2b0cc12cf1 Improve the performance of code completion by 2.2x when completing for ordinary names with Cocoa.h included, by drastically improving the performance of our results sorting.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90661 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 09:08:56 +00:00
Chris Lattner 02dd4b1e27 fix rdar://7446395, a crash on invalid, by fixing a broken assertion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90647 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 05:40:13 +00:00
John McCall ed97649e95 Fix "using typename" and the instantiation of non-dependent using declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90614 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 22:46:56 +00:00
Anders Carlsson 5c478cf2d5 Diagnose declarations of implicit member functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90605 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 22:33:25 +00:00
John Thompson 6e132aab86 Fix for PR5650 - Revised vector_size attribute handling to be done earlier before declaration is finalized.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90600 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 21:51:28 +00:00
Eli Friedman 16c5378c1e Make sure to call PerformObjectMemberConversion where necessary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90555 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 07:18:51 +00:00
Eli Friedman f595cc41c4 Make the type of the Decl referred to by a MemberExpr a bit more precise.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90549 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 06:40:45 +00:00
Anders Carlsson 3aaf486af6 Make sure that overridden method decls are always canonical.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90542 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 05:51:56 +00:00
Eli Friedman 9aef7263d8 Fix for PR5679: make __builtin_prefetch a bit more flexible in what it accepts
as a constant integer.  Also, some minor cleanup and improvements to the
diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90504 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 00:30:06 +00:00
John McCall 5023437f5a When recovering from an invalid forward reference to an enum type in C++,
create the enum type in the same scope as you would a record type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90500 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 00:07:04 +00:00
Fariborz Jahanian e7184df728 A new helper function to set various bits in the class when
a new virtual function is declared/instantiated. it is used
in couple of places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90470 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 18:44:40 +00:00