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

1558 Коммитов

Автор SHA1 Сообщение Дата
Chris Lattner 48eb4613c6 rename these tests to match the attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61770 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 23:10:19 +00:00
Daniel Dunbar 523aa600be Remainder is only valid on integer vector operands.
Improve ext vector test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61766 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 22:55:36 +00:00
Sebastian Redl 64b45f7e0d PODness and Type Traits
Make C++ classes track the POD property (C++ [class]p4)
Track the existence of a copy assignment operator.
Implicitly declare the copy assignment operator if none is provided.
Implement most of the parsing job for the G++ type traits extension.
Fully implement the low-hanging fruit of the type traits:
__is_pod: Whether a type is a POD.
__is_class: Whether a type is a (non-union) class.
__is_union: Whether a type is a union.
__is_enum: Whether a type is an enum.
__is_polymorphic: Whether a type is polymorphic (C++ [class.virtual]p1).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61746 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 20:52:13 +00:00
Douglas Gregor 6c6fce03ea Add forgotten test case for linkage specifications
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61737 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 19:50:09 +00:00
Douglas Gregor 074149e11b Introduce support for "transparent" DeclContexts, which are
DeclContexts whose members are visible from enclosing DeclContexts up
to (and including) the innermost enclosing non-transparent
DeclContexts. Transparent DeclContexts unify the mechanism to be used
for various language features, including C enumerations, anonymous
unions, C++0x inline namespaces, and C++ linkage
specifications. Please refer to the documentation in the Clang
internals manual for more information.

Only enumerations and linkage specifications currently use transparent
DeclContexts.

Still to do: use transparent DeclContexts to implement anonymous
unions and GCC's anonymous structs extension, and, later, the C++0x
features. We also need to tighten up the DeclContext/ScopedDecl link
to ensure that every ScopedDecl is in a single DeclContext, which
will ensure that we can then enforce ownership and reduce the memory
footprint of DeclContext.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61735 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 19:45:36 +00:00
Chris Lattner 83cf05a3b0 Fix a bug where we'd try to look beyond the current cached tokens when
not in backtracking mode.  This was just using the wrong predicate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61666 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 01:42:04 +00:00
Chris Lattner a67865c64e add a testcase
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61660 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 00:59:08 +00:00
Anders Carlsson b723f7520b Fix the bug that would cause Python to crash at startup.
When emitting the static variables we need to make sure that the order is preserved. 
Fix this by making StaticDecls a std::list which has O(1) random removal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61621 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-04 02:08:04 +00:00
Douglas Gregor f780abc21c Parser support for C++ using directives, from Piotr Rak
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61486 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-30 03:27:21 +00:00
Sebastian Redl b8ab5eb7d7 Fix a grep error that caused CodeGenObjC/encode-test.m to fail.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61455 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-28 15:48:05 +00:00
Sebastian Redl a4ed0d8d75 Diagnose declarations that don't declare anything, and fix PR3020.
Examples:
int;
typedef int;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61454 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-28 15:28:59 +00:00
Sebastian Redl 3c902ced87 Fix filename typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61453 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-28 14:19:27 +00:00
Nuno Lopes 9c08f27ca5 add RUN line
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61452 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-27 23:47:34 +00:00
Douglas Gregor 70316a065b Add support for out-of-line definitions of conversion functions and member operators
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61442 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 15:00:45 +00:00
Anton Korobeynikov fceeec91fa Complete the test after adding handling of merged attributes on decls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61438 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 00:52:17 +00:00
Anton Korobeynikov 2f402708e6 Add full dllimport / dllexport support: both sema checks and codegen.
Patch by Ilya Okonsky

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61437 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 00:52:02 +00:00
Anton Korobeynikov 7f7bb72fd0 Testcase for stdcall/fastcall sema checks.
Patch by Ilya Okonsky!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61436 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 00:51:21 +00:00
Steve Naroff 86bc6cf05a Add parser support for __forceinline, __w64, __ptr64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61431 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-25 14:41:26 +00:00
Steve Naroff 239f07384f Add parser support for __cdecl, __stdcall, and __fastcall.
Change preprocessor implementation of _cdecl to reference __cdecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61430 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-25 14:16:32 +00:00
Douglas Gregor c4b4e7b8f6 Keep track of template arguments when we parse them. Right now, we don't actually do anything with the template arguments, but they'll be used to create template declarations
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61413 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-24 02:52:09 +00:00
Douglas Gregor 61366e9cd4 Correct the order in which we cope with end-of-class-definition
semantics and improve our handling of default arguments. Specifically,
we follow this order:

  - As soon as the see the '}' in the class definition, the class is
  complete and we add any implicit declarations (default constructor,
  copy constructor, etc.) to the class.
  - If there are any default function arguments, parse them
  - If there were any inline member function definitions, parse them

As part of this change, we now keep track of the the fact that we've
seen unparsed default function arguments within the AST. See the new
ParmVarDecl::hasUnparsedDefaultArg member. This allows us to properly
cope with calls inside default function arguments to other functions
where we're making use of the default arguments.

Made some C++ error messages regarding failed initializations more
specific. 



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61406 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-24 00:01:03 +00:00
Fariborz Jahanian 3e1b16c2e5 Last patch, for now, to privde ObjC's encoding of types.
We now pass all gcc's encoding compatibility tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61387 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 21:30:15 +00:00
Steve Naroff 46a98a7df0 Fix <rdar://problem/6465284> clang ObjC rewriter: objc_super messed up again.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61384 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 20:11:22 +00:00
Sebastian Redl 1f5432c227 Merge pr-3188.cpp into constructor.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61370 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 16:41:32 +00:00
Douglas Gregor 2a7e58dc24 Add some block-pointer conversions in C++
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61359 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 00:53:59 +00:00
Fariborz Jahanian 5b8c7d9fb6 More encoding support; in this case, encoding of
outer-most const of pointer types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61355 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 23:22:27 +00:00
Sebastian Redl 494bb06e34 Guard against the return of PR3188
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61348 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 21:43:13 +00:00
Sebastian Redl 8351da06ca Full AST support and better Sema support for C++ try-catch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61346 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 21:35:02 +00:00
Douglas Gregor 27b09ac9f7 Support conversion from a null pointer constant o any Objective-C object pointer type. Fixes rdar://problem/6463298
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61340 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 20:51:52 +00:00
Sebastian Redl 4b07b2968f Partial AST and Sema support for C++ try-catch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61337 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 19:15:10 +00:00
Fariborz Jahanian 804058ece0 Patch to remove bogus warning in case of @dynamic
property in a category and to issue diagnostics
for mismatch method in some other cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61336 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 19:05:31 +00:00
Douglas Gregor 88a3514f36 Add support for calls to overloaded member functions. Things to note:
- Overloading has to cope with having both static and non-static
    member functions in the overload set.
  - The call may or may not have an implicit object argument,
    depending on the syntax (x.f() vs. f()) and the context (static
    vs. non-static member function).
  - We now generate MemberExprs for implicit member access expression.
  - We now cope with mutable whenever we're building MemberExprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61329 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 05:46:06 +00:00
Zhongxing Xu ff944a8c48 Add an option to make 'RemoveDeadBindings' a configurable behavior. This enables
us to measure the effect of this optimization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61319 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 01:52:37 +00:00
Anders Carlsson 3f70456b8a Add codegen support for __null
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61314 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-21 22:39:40 +00:00
Sebastian Redl a0fd8652f3 Parser support for C++ try-catch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61312 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-21 16:41:36 +00:00
Sebastian Redl e3f38eac58 Test case makes a platform assumption, so force triple.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61310 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-21 12:17:24 +00:00
Anders Carlsson 0269709723 Commit the right version of the test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61302 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-21 03:40:32 +00:00
Anders Carlsson b50525ba0e Make sure to emit the size expression for sizeof(type)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61301 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-21 03:33:21 +00:00
Douglas Gregor 86f1940835 Add support for member references (E1.E2, E1->E2) with C++ semantics,
which can refer to static data members, enumerators, and member
functions as well as to non-static data members.

Implement correct lvalue computation for member references in C++. 
Compute the result type of non-static data members of reference type properly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61294 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-20 23:49:58 +00:00
Fariborz Jahanian 4306d3cb91 Finish up saving original parameter type and
using it in ObjC's method parameter encoding.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61293 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-20 23:29:59 +00:00
Eli Friedman 8f39f5e96c Make VLAs usable, and make basic usage work correctly. Also, add a
simple test that actually does VLA codegen.

Note that despite the fact that the alloca isn't in the entry block, it 
should dominate all uses; this is guaranteed by the restrictions on goto 
into VLA scope in C99.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61291 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-20 23:11:59 +00:00
Anders Carlsson eb91f0ecb4 Add some ErrorUnsupported calls and turn on VLA codegen again.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61283 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-20 19:33:21 +00:00
Fariborz Jahanian adcaf544a9 Strangely enough, name of ObjC class is not encoded into the
full encoding of the class which has an ivar of pointer to this
class. Its name is encoded in the type for the ivar in the
ivar-list metadata. This patch conforms to the above rule.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61282 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-20 19:17:01 +00:00
Sebastian Redl e6d5a4a583 Implement checks for bool in increment and decrement.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61275 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-20 09:35:34 +00:00
Zhongxing Xu 4193eca10c Lazy bingding for region-store manager.
* Now Bind() methods take and return GRState* because binding could
  also alter GDM.
* No variables are initialized except those declared with initial
  values.
* failed C test cases are due to bugs in RemoveDeadBindings(),
which removes constraints that is still alive. This will be fixed in later
patch.
* default value of array and struct regions will be implemented in later patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61274 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-20 06:32:12 +00:00
Fariborz Jahanian 43822eaedd More encoding support. This time for
@encode of classes and bitfields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61268 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 23:34:38 +00:00
Douglas Gregor a46969d6cf Add a missing @end. Why didn't this get diagnosed?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61256 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 19:16:37 +00:00
Douglas Gregor c788751123 Support more implicit conversions for Objective-C types. Addresses <rdar://problem/6458293>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61255 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 19:13:09 +00:00
Fariborz Jahanian e4bb68a475 Test case for my last @encode patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61247 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 17:45:06 +00:00
Douglas Gregor 45920e82bd Allow downcasts of pointers to Objective-C interfaces, with a
warning. This matches GCC's behavior and addresses
<rdar://problem/6458293>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61246 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 17:40:08 +00:00