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

5456 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor ce82196076 Member function templates can occur after . or ->
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91137 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 18:14:22 +00:00
Eli Friedman ecb7e932e9 Fix for PR5706: let mangleName deal with mangling names without identifiers
correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91136 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 18:00:57 +00:00
Douglas Gregor 7628294ee8 Tweak code-completion results by suppressing class template
specializations and class template partial specializations (they're
never named directly). Also, member access expressions only refer to
value declarations (fields, functions, enumerators, etc.) and
Objective-C property declarations; filter out everything else.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91133 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 17:31:05 +00:00
Anders Carlsson 22ed438eaf XFAIL this for now, fixing linkage bugs causes the order of globals to change. Will fix later today.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91130 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 17:01:29 +00:00
Anders Carlsson 4e7135613a Use GetAddrOfRTTI when getting the RTTI pointer for a base class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91127 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 16:37:06 +00:00
Douglas Gregor e29ffaae9b Class template (partial) specializations should not show up in code completion results
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91125 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 16:18:54 +00:00
Eli Friedman 3a1737030e Move the code for converting a member pointer to a bool so that it is usable
for logical not.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91112 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 09:26:29 +00:00
Eli Friedman b81c786de5 Fix for PR5718: implement equality comparisons for member function pointers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91108 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 07:36:43 +00:00
Ted Kremenek 2b87ae45e1 Enhance understanding of VarRegions referenced by a block whose declarations are outside the current stack frame. Fixes <rdar://problem/7462324>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91107 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 06:43:27 +00:00
John McCall a970c57771 Test member template using hiding.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91099 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 02:55:56 +00:00
Anders Carlsson 31b7f52d8c Improve linkage of RTTI data structures. Introduce CodeGenModule::GetAddrOfRTTI which figures out the right linkage of the RTTI information for the given type and whether it should be defined or not. I will migrate clients over to GetAddrOfRTTI in subsequent commits (with tests).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 02:46:30 +00:00
Eli Friedman 03981014e4 Fix a recent regression from the initialization changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91097 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 02:42:07 +00:00
John McCall d7533ec10b Check if the target of a using decl is already declared in this scope before
doing any of the other redeclaration checks.  We were missing a few cases.
Fixes PR 5752.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91096 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 02:33:26 +00:00
John McCall 60fa3cfd7a Implement access declarations. Most of the work here is parsing them, which
is difficult because they're so terribly, terribly ambiguous.


We implement access declarations in terms of using declarations, which is
quite reasonable.  However, we should really persist the access/using
distinction in the AST and use the appropriate name in diagnostics.  This
isn't a priority, so I'll just file a PR and hope someone else does it. :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91095 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 02:10:03 +00:00
Chris Lattner 7e1848ddba Give the "cannot pass object of non-POD type 'class C' through variadic constructor; call will abort at runtime" warning a -W flag (non-pod-varargs) and default it being an error by default. There is no good reason to allow users to get bitten by this sort of thing by default.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91094 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 01:52:50 +00:00
Eli Friedman ed0716b7b7 Fix the handling of dependent enums per C++ DR 502.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91089 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 01:34:50 +00:00
Anders Carlsson 8370c58b92 When an exception needs to be freed by calling __cxa_exception_free, make sure to stash away the exception pointer somewhere.
This fixes an "Instruction does not dominate all uses!" verification error when compiling TableGen.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91084 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 00:32:37 +00:00
Daniel Dunbar 5c2609a1f9 Remove this test for now, it is flaky.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91083 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 00:27:30 +00:00
Fariborz Jahanian 737061fc29 Patch to fix a crash trying to access a category name in
objective-c++ mode and also removed dead-code in this area.
(fixes radar 7456710).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91081 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 00:26:36 +00:00
Mike Stump 23b7217c24 Testcase for recent checkin.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91080 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 00:10:15 +00:00
Mike Stump c9875bfa6f Don't complain about falling off the end of a function with an asm
block, if the function is supposed to return a value as we don't know
exactly what the asm code does.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91073 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 22:57:48 +00:00
Eli Friedman 9dfebdcdcd Support unary type traits in a scalar context. Not that I've actually seen
this construct, but might as well for completeness.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91071 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 22:40:32 +00:00
Eli Friedman 29a7f3342c Clean up enum constants so that they're finally sane. Fixes PR3173 and a
recently introduced crash.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91070 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 22:29:29 +00:00
Anders Carlsson 548e60efea Make sure that explicitly instantiated functions get the right linkage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91069 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 22:25:34 +00:00
John McCall 35dfab9cb1 Actually try to trigger the last diagnostic in the declaration-collision test case.
Surprisingly, we *do* diagnose one of them.  Since we don't really track scopes into
instantiation, this has to signal some kind of bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91063 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 21:17:25 +00:00
Fariborz Jahanian 505c882768 No need to add -x objecitve-c++
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91060 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 20:57:43 +00:00
Fariborz Jahanian 5501636b41 Add support for finding composite type of twp objective-c pointers
in objective-c++ mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91059 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 20:46:08 +00:00
John McCall 41ce66f8e2 Improve the diagnostic when a new declaration conflicts with a using shadow
declaration.  Rename note_using_decl to note_using, which is possibly less confusing.
Add a test for non-class-scope using decl collisions and be sure to note the case
we can't diagnose yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91057 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 19:51:03 +00:00
Douglas Gregor 0966f35898 Implement C++ DR437, which involves exception-specifications that name
a type currently being defined, from Nicola Gigante!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91052 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 18:13:52 +00:00
Douglas Gregor d87b61f639 Move initialization via initializer list over to InitializationSequences.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91050 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 17:56:55 +00:00
John McCall 9f54ad4381 Implement redeclaration checking and hiding semantics for using declarations. There
are a couple of O(n^2) operations in this, some analogous to the usual O(n^2)
redeclaration problem and some not.  In particular, retroactively removing
shadow declarations when they're hidden by later decls is pretty unfortunate.
I'm not yet convinced it's worse than the alternative, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91045 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 09:41:52 +00:00
Eli Friedman 153c33ed95 Fix for PR5515: allow "merging" array bounds both forwards and backwards.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91044 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 08:54:47 +00:00
Eli Friedman 2ce79bc4fd Test for r90950.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91043 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 08:51:23 +00:00
Anders Carlsson 7b06f6c20e Mangle static variables inside Objective-C methods in Objective-C++. We currently mangle them the same way as gcc does.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91042 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 03:14:39 +00:00
Chris Lattner 932dff777d If we enter parens, colons can become un-sacred, allowing us to emit
a better diagnostic in the second example.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91040 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 02:08:07 +00:00
Chris Lattner a69d0ed3ab fix a more evil case of : / :: confusion arising in ?:.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91039 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 02:02:58 +00:00
Chris Lattner a1efc8c8c6 fix incorrect parsing of bitfields pointed out by Doug. I chose
to use ColonProtectionRAIIObject in the C codepath even though it
won't matter for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91037 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 01:59:24 +00:00
Anders Carlsson c7974ca531 Handle emitting static variables that have reference type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91027 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 01:05:11 +00:00
Chris Lattner 6fb09c8acc fix PR5740: a colon is sacred when parsing case statement expressions!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91016 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 00:38:54 +00:00
Chris Lattner 3c46a66de8 rename testcase
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91015 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 00:37:13 +00:00
Fariborz Jahanian 820bca41c3 Code gen for ObjCIsaExpr AST used as lvalue.
(fixes radar 7457534).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90995 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 23:35:29 +00:00
Mike Stump 7695809982 Add terminate handler for copy constructors for thrown objects. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90994 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 23:31:35 +00:00
Ted Kremenek 6bcd5a04db Fix null dereference in OSAtomicChecker and special case SymbolicRegions. We still aren't handling them correctly; I've added to failing test cases to test/Analysis/NSString-failed-cases.m that should pass and then be merged in to test/Analysis/NSString.m.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90993 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 23:29:55 +00:00
Douglas Gregor 20093b4bf6 Reimplement reference initialization (C++ [dcl.init.ref]) using the
new notion of an "initialization sequence", which encapsulates the
computation of the initialization sequence along with diagnostic
information and the capability to turn the computed sequence into an
expression. At present, I've only switched one CheckReferenceInit
callers over to this new mechanism; more will follow.

Aside from (hopefully) being much more true to the standard, the
diagnostics provided by this reference-initialization code are a bit
better than before. Some examples:

p5-var.cpp:54:12: error: non-const lvalue reference to type 'struct
Derived'
      cannot bind to a value of unrelated type 'struct Base'
  Derived &dr2 = b; // expected-error{{non-const lvalue reference to
  ...
           ^     ~
p5-var.cpp:55:9: error: binding of reference to type 'struct Base' to
a value of
      type 'struct Base const' drops qualifiers
  Base &br3 = bc; // expected-error{{drops qualifiers}}
        ^     ~~

p5-var.cpp:57:15: error: ambiguous conversion from derived class
      'struct Diamond' to base class 'struct Base':
    struct Diamond -> struct Derived -> struct Base
    struct Diamond -> struct Derived2 -> struct Base
  Base &br5 = diamond; // expected-error{{ambiguous conversion from
      ...
              ^~~~~~~
p5-var.cpp:59:9: error: non-const lvalue reference to type 'long'
      cannot bind to
      a value of unrelated type 'int'
  long &lr = i; // expected-error{{non-const lvalue reference to type
      ...
        ^    ~

p5-var.cpp:74:9: error: non-const lvalue reference to type 'struct
Base' cannot
      bind to a temporary of type 'struct Base'
  Base &br1 = Base(); // expected-error{{non-const lvalue reference to
  ...
        ^     ~~~~~~

p5-var.cpp:102:9: error: non-const reference cannot bind to bit-field
'i'
  int & ir1 = (ib.i); // expected-error{{non-const reference cannot
  ...
        ^     ~~~~~~
p5-var.cpp:98:7: note: bit-field is declared here
  int i : 17; // expected-note{{bit-field is declared here}}
      ^






git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90992 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 23:02:17 +00:00
Fariborz Jahanian 3acd9aaa4d Fixes a bogus error when declaring an extern "C" array.
(fixes radar 7457109).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90986 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 21:39:38 +00:00
Fariborz Jahanian 83dc32594c Codegen. support for ObjCIsaExpr AST which until now
was not needed (fixes radar 7453430).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90981 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 19:05:56 +00:00
John McCall 842aef8d94 First pass at implementing C++ enum semantics: calculate (and store) an
"integer promotion" type associated with an enum decl, and use this type to
determine which type to promote to.  This type obeys C++ [conv.prom]p2 and
is therefore generally signed unless the range of the enumerators forces
it to be unsigned.

Kills off a lot of false positives from -Wsign-compare in C++, addressing
rdar://7455616




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90965 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 09:09:27 +00:00
Zhongxing Xu 2f4a6b25a7 OSAtomic simulation: use the original region as the location to load from,
instead of the ElementRegion obtained from casts.

Test cast: the leak cannot occur bacause the true branch cannot be taken.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90964 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 08:32:57 +00:00
Anders Carlsson eac813909b Look through using declarations when searching for allocation overloads.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90961 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 07:39:44 +00:00
Anders Carlsson ca910e84ea In CXXRecordDecl::forallBases, add the base to the "queue", so we walk more than one heirarchy of classes. John, please review.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90948 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 04:26:02 +00:00