- Apr 13, 2009
-
-
Douglas Gregor authored
deterministic when faced with an ambiguity. This eliminates the annoying test/SemaCXX/using-directive.cpp failure. llvm-svn: 68952
-
Chris Lattner authored
llvm-svn: 68918
-
Chris Lattner authored
return null. llvm-svn: 68916
-
- Apr 12, 2009
-
-
Chris Lattner authored
struct xyz { int y; }; enum abc { ZZZ }; static xyz b; abc c; we used to produce: t2.c:4:8: error: unknown type name 'xyz' static xyz b; ^ t2.c:5:1: error: unknown type name 'abc' abc c; ^ we now produce: t2.c:4:8: error: use of tagged type 'xyz' without 'struct' tag static xyz b; ^ struct t2.c:5:1: error: use of tagged type 'abc' without 'enum' tag abc c; ^ enum GCC produces the normal: t2.c:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘b’ t2.c:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘c’ rdar://6783347 llvm-svn: 68914
-
Chris Lattner authored
if a decl is invalid, it isn't added to the Decls array, so we need to pass in Decls.size() to avoid reading uninit memory. llvm-svn: 68913
-
Chris Lattner authored
exit at the first decl found that creates a scope, don't evaluate decl_end() every iteration. llvm-svn: 68908
-
- Apr 11, 2009
-
-
Chris Lattner authored
to their arguments. llvm-svn: 68876
-
Chris Lattner authored
llvm-svn: 68873
-
Chris Lattner authored
1) improve localizability by not passing english strings in. 2) improve location for arguments. 3) print the objc type being passed. Before: method-bad-param.m:15:1: error: Objective-C type cannot be passed by value -(void) my_method:(foo) my_param ^ after: method-bad-param.m:15:25: error: Objective-C interface type 'foo' cannot be passed by value -(void) my_method:(foo) my_param ^ llvm-svn: 68872
-
Douglas Gregor authored
buffer generated for the current translation unit. If they are different, complain and then ignore the PCH file. This effectively checks for all compilation options that somehow would affect preprocessor state (-D, -U, -include, the dreaded -imacros, etc.). When we do accept the PCH file, throw away the contents of the predefines buffer rather than parsing them, since all of the results of that parsing are already stored in the PCH file. This eliminates the ugliness with the redefinition of __builtin_va_list, among other things. llvm-svn: 68838
-
- Apr 10, 2009
-
-
Douglas Gregor authored
cleanup. Aside from a minor tweak to the PCH file format, no functionality change. llvm-svn: 68793
-
Douglas Gregor authored
de-serialization of abstract syntax trees. PCH support serializes the contents of the abstract syntax tree (AST) to a bitstream. When the PCH file is read, declarations are serialized as-needed. For example, a declaration of a variable "x" will be deserialized only when its VarDecl can be found by a client, e.g., based on name lookup for "x" or traversing the entire contents of the owner of "x". This commit provides the framework for serialization and (lazy) deserialization, along with support for variable and typedef declarations (along with several kinds of types). More declarations/types, along with important auxiliary structures (source manager, preprocessor, etc.), will follow. llvm-svn: 68732
-
- Apr 09, 2009
-
-
Douglas Gregor authored
No functionality change (really). llvm-svn: 68726
-
Eli Friedman authored
llvm-svn: 68725
-
- Apr 08, 2009
-
-
Douglas Gregor authored
Fixes <rdar://problem/6759522> llvm-svn: 68611
-
- Apr 07, 2009
-
-
Eli Friedman authored
functions. Fixes PR3941. llvm-svn: 68541
-
- Apr 02, 2009
-
-
Douglas Gregor authored
llvm-svn: 68278
-
Douglas Gregor authored
llvm-svn: 68261
-
- Apr 01, 2009
-
-
Douglas Gregor authored
failures that involve malformed types, e.g., "typename X::foo" where "foo" isn't a type, or "std::vector<void>" that doens't instantiate properly. Similarly, be a bit smarter in our handling of ambiguities that occur in Sema::getTypeName, to eliminate duplicate error messages about ambiguous name lookup. This eliminates two XFAILs in test/SemaCXX, one of which was crying out to us, trying to tell us that we were producing repeated error messages. llvm-svn: 68251
-
- Mar 31, 2009
-
-
Douglas Gregor authored
llvm-svn: 68110
-
- Mar 29, 2009
-
-
Chris Lattner authored
productions (except the already broken ObjC cases like @class X,Y;) in the parser that can produce more than one Decl return a DeclGroup instead of a Decl, etc. This allows elimination of the Decl::NextDeclarator field, and exposes various clients that should look at all decls in a group, but which were only looking at one (such as the dumper, printer, etc). These have been fixed. Still TODO: 1) there are some FIXME's in the code about potentially using DeclGroup for better location info. 2) ParseObjCAtDirectives should return a DeclGroup due to @class etc. 3) I'm not sure what is going on with StmtIterator.cpp, or if it can be radically simplified now. 4) I put a truly horrible hack in ParseTemplate.cpp. I plan to bring up #3/4 on the mailing list, but don't plan to tackle #1/2 in the short term. llvm-svn: 68002
-
- Mar 28, 2009
-
-
Chris Lattner authored
pointer. Its purpose in life is to be a glorified void*, but which does not implicitly convert to void* or other OpaquePtr's with a different UID. Introduce Action::DeclPtrTy which is a typedef for OpaquePtr<0>. Change the entire parser/sema interface to use DeclPtrTy instead of DeclTy*. This makes the C++ compiler enforce that these aren't convertible to other opaque types. We should also convert ExprTy, StmtTy, TypeTy, AttrTy, BaseTy, etc, but I don't plan to do that in the short term. The one outstanding known problem with this patch is that we lose the bitmangling optimization where ActionResult<DeclPtrTy> doesn't know how to bitmangle the success bit into the low bit of DeclPtrTy. I will rectify this with a subsequent patch. llvm-svn: 67952
-
- Mar 27, 2009
-
-
Douglas Gregor authored
llvm-svn: 67818
-
- Mar 26, 2009
-
-
Anders Carlsson authored
Factor the member access specifier setting code into its own function. No intended functionality change. llvm-svn: 67725
-
Anders Carlsson authored
llvm-svn: 67722
-
Douglas Gregor authored
specializations can be treated as a template. Finally, we can parse and process the first implementation of Fibonacci I wrote! Note that this code does not handle all of the cases where injected-class-names can be treated as templates. In particular, there's an ambiguity case that we should be able to handle (but can't), e.g., template <class T> struct Base { }; template <class T> struct Derived : Base<int>, Base<char> { typename Derived::Base b; // error: ambiguous typename Derived::Base<double> d; // OK }; llvm-svn: 67720
-
Anders Carlsson authored
Also, fix fallout from the change. llvm-svn: 67717
-
Douglas Gregor authored
templates, including in-class initializers. For example: template<typename T, T Divisor> class X { public: static const T value = 10 / Divisor; }; instantiated with, e.g., X<int, 5>::value to get the value '2'. llvm-svn: 67715
-
- Mar 25, 2009
-
-
Douglas Gregor authored
llvm-svn: 67710
-
Douglas Gregor authored
the declarations of member classes are instantiated when the owning class template is instantiated. The definitions of such member classes are instantiated when a complete type is required. This change also introduces the injected-class-name into a class template specialization. llvm-svn: 67707
-
Douglas Gregor authored
llvm-svn: 67687
-
- Mar 24, 2009
-
-
Douglas Gregor authored
incomplete types. RequireCompleteType is needed when the type may be completed by instantiating a template. llvm-svn: 67643
-
Anders Carlsson authored
class C { void g(C c); virtual void f() = 0; }; In this case, C is not known to be abstract when doing semantic analysis on g. This is done by recursively traversing the abstract class and checking the types of member functions. llvm-svn: 67594
-
Douglas Gregor authored
a class template. At present, we can only instantiation normal methods, but not constructors, destructors, or conversion operators. As ever, this contains a bit of refactoring in Sema's type-checking. In particular: - Split ActOnFunctionDeclarator into ActOnFunctionDeclarator (handling the declarator itself) and CheckFunctionDeclaration (checking for the the function declaration), the latter of which is also used by template instantiation. - We were performing the adjustment of function parameter types in three places; collect those into a single new routine. - When the type of a parameter is adjusted, allocate an OriginalParmVarDecl to keep track of the type as it was written. - Eliminate a redundant check for out-of-line declarations of member functions; hide more C++-specific checks on function declarations behind if(getLangOptions().CPlusPlus). llvm-svn: 67575
-
- Mar 23, 2009
-
-
Anders Carlsson authored
More improvements to abstract type checking. Handle arrays correctly, and make sure to check parameter types before they decay. llvm-svn: 67550
-
Anders Carlsson authored
llvm-svn: 67542
-
Douglas Gregor authored
library function, accept this declaration and pretend that we do not know that this is a library function. autoconf depends on this (broken) behavior. llvm-svn: 67541
-
Douglas Gregor authored
prototype. Thanks Eli! llvm-svn: 67533
-
Douglas Gregor authored
llvm-svn: 67530
-
- Mar 22, 2009
-
-
Anders Carlsson authored
llvm-svn: 67476
-