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

17616 Коммитов

Автор SHA1 Сообщение Дата
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
Douglas Gregor 5f16e521eb Beef up Clang-on-LLVM testing a bit, by making LLVM-Syntax recursive
(since we now parse all of the headers appropriately) and teaching
LLVM-Code-Syntax about the extra paths needed to parse the backends.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91068 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 22:08:55 +00:00
Benjamin Kramer 648d846e4f Privatize class members.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91067 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 21:50:21 +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
Fariborz Jahanian eebc4750fd Move composite type finding of two objective-c expressions
into its own helper method. No change in functionality.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91056 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 19:47:41 +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
Eli Friedman 940670512d Get rid of static variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91041 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 02:21:21 +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 864143fe14 Actually store the pointer into the global variable, spotted by Eli.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91036 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 01:58:33 +00:00
Mike Stump 5030a98e20 Setup cleanup on eh edge out of the construction of the cleanup object
during throw to deallocate the exception object.  WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91035 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 01:52:30 +00:00
Chris Lattner f2c8e7dee9 minimal fix for PR5743
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91032 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 01:38:15 +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
Anders Carlsson fcbfdc1a93 Separate generating code for static variables and global variables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91026 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 00:57:45 +00:00
Anders Carlsson 347c2a0f75 Fix tabs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91025 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 00:57:18 +00:00
Chris Lattner de138eb4e6 Second half of r91023, saving files is good.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91024 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 00:45:15 +00:00
Chris Lattner d0d76f1cbe move GreaterThanIsOperatorScope into RAIIObjectsForParser. Add some more
TODOs for other classes that could be moved out of Parser.h.  I don't plan
to do these in the near term though.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91023 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 00:44:03 +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
Chris Lattner 08d92ecf6e refactor the 'ColonIsSacred' argument to ParseOptionalCXXScopeSpecifier
to be a bool in Parser that is twiddled by the ColonProtectionRAIIObject
class.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91014 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 00:32:41 +00:00
Anders Carlsson eb4072ed06 Move more decl related functions to CGDeclCXX.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91012 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 00:30:05 +00:00
Chris Lattner d167ca0d26 rename ExtensionRAIIObject.h -> RAIIObjectsForParser.h
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91008 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 00:21:05 +00:00
Anders Carlsson 5ec2e7ccb0 Add CGDeclCXX.cpp and move EmitCXXGlobalVarDeclInit there.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91006 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 00:16:00 +00:00
Nuno Lopes 68f7a24262 spread 'const' love to some variables. this considerably reduces the amount of dirty data around.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91002 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 00:07:02 +00:00
Mike Stump 8755ec3361 Fixup spacing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91001 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 00:06:18 +00:00
Mike Stump c83ebb592a Fix spacing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91000 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 00:05:14 +00:00
Mike Stump 182f383db1 Ensure we only generate one terminate handler.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90998 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 00:02:42 +00:00
Mike Stump 23e17c81d5 Remove obsolete FIXME and some dead fallback code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90997 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 23:52:09 +00:00
Mike Stump 20d3a53cef Add terminate handler to cleanups on exceptional edges.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90996 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 23:49:53 +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
Mike Stump 9b39c51ae3 Break out code for reuse. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90991 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 22:59:31 +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
Mike Stump 39406b1395 Add throw support. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90982 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 19:24:08 +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
Mike Stump e4cb2a4b4a Fix 80-col violation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90976 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 18:09:35 +00:00
Anders Carlsson 2b7d8ddc74 Add DeclContext::dump.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90974 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 17:27:46 +00:00