Commit Graph

1512 Commits

Author SHA1 Message Date
Anders Carlsson 4bb87ce33e Improve instantiation of UnresolvedUsingDecls.
llvm-svn: 80434
2009-08-29 19:37:28 +00:00
Eli Friedman 9ab0319b2b Get rid of mostly-unused, buggy method.
llvm-svn: 80432
2009-08-29 19:09:59 +00:00
John McCall 75c03bbb0c For consistency, just make friend declarations AS_public.
llvm-svn: 80420
2009-08-29 03:50:18 +00:00
Anders Carlsson 1e172e068f Store the SourceLocation of right parentheses in member initializers. Patch by Anders Johnsen!
llvm-svn: 80416
2009-08-29 01:31:33 +00:00
Anders Carlsson 6e1ca8315c Don't assert that friend declarations must have access specifiers for now.
llvm-svn: 80415
2009-08-29 01:13:02 +00:00
Anders Carlsson 601d6e4c7b Add printing of access specifiers to DeclPrinter. The formatting is pretty bad but it works :)
llvm-svn: 80402
2009-08-28 22:39:52 +00:00
Fariborz Jahanian 2fee79a9a1 path to ir-gen 12.3.1 Conversion by constructor
llvm-svn: 80398
2009-08-28 22:04:50 +00:00
Anders Carlsson df5a1c8b5d Improve support for using decls in the decl printer.
llvm-svn: 80386
2009-08-28 19:16:39 +00:00
Anders Carlsson d20e795a5b Fix this for real.
llvm-svn: 80377
2009-08-28 16:57:08 +00:00
John McCall aa74a0c3b5 Omnibus friend decl refactoring. Instead of cloning AST classes for friend
declarations of same, introduce a single AST class and add appropriate bits
(encoded in the namespace) for whether a decl is "real" or not.  Much hackery
about previously-declared / not-previously-declared, but it's essentially
mandated by the standard that friends alter lookup, and this is at least
fairly non-intrusive.

Refactor the Sema methods specific to friends for cleaner flow and less nesting.

Incidentally solve a few bugs, but I remain confident that we can put them back.

llvm-svn: 80353
2009-08-28 07:59:38 +00:00
Anders Carlsson 8305c1fa97 Check in UnresolvedUsingDecl.
llvm-svn: 80336
2009-08-28 05:30:28 +00:00
Douglas Gregor e985a3b724 When checking whether one declaration context encloses another, make sure to look at the primary contexts. Thanks to Eli for the test case
llvm-svn: 80212
2009-08-27 06:03:53 +00:00
Douglas Gregor c190523d7a When a member reference expression includes a qualifier on the member
name, e.g.,
  
  x->Base::f()

retain the qualifier (and its source range information) in a new
subclass of MemberExpr called CXXQualifiedMemberExpr. Provide
construction, transformation, profiling, printing, etc., for this new
expression type.

When a virtual function is called via a qualified name, don't emit a
virtual call. Instead, call that function directly. Mike, could you
add a CodeGen test for this, too?

llvm-svn: 80167
2009-08-26 22:36:53 +00:00
Mike Stump 849416a388 More work for conversion functions.
llvm-svn: 80142
2009-08-26 21:11:25 +00:00
Douglas Gregor 053f691d5e Improve diagnostics and recovery when the nested-name-specifier of a
qualified name does not actually refer into a class/class
template/class template partial specialization. 

Improve printing of nested-name-specifiers to eliminate redudant
qualifiers. Also, make it possible to output a nested-name-specifier
through a DiagnosticBuilder, although there are relatively few places
that will use this leeway.

llvm-svn: 80056
2009-08-26 00:04:55 +00:00
Douglas Gregor e861bac059 Improve support for out-of-line definitions of nested templates and
their members, including member class template, member function
templates, and member classes and functions of member templates.

To actually parse the nested-name-specifiers that qualify the name of
an out-of-line definition of a member template, e.g.,

  template<typename X> template<typename Y>
  X Outer<X>::Inner1<Y>::foo(Y) {
    return X();
  }

we need to look for the template names (e.g., "Inner1") as a member of
the current instantiation (Outer<X>), even before we have entered the
scope of the current instantiation. Since we can't do this in general
(i.e., we should not be looking into all dependent
nested-name-specifiers as if they were the current instantiation), we
rely on the parser to tell us when it is parsing a declaration
specifier sequence, and, therefore, when we should consider the
current scope specifier to be a current instantiation.

Printing of complicated, dependent nested-name-specifiers may be
somewhat broken by this commit; I'll add tests for this issue and fix
the problem (if it still exists) in a subsequent commit.

llvm-svn: 80044
2009-08-25 22:51:20 +00:00
Fariborz Jahanian 797cf62703 Skip over bases/fields with dependent types.
Fixes pr4771.

llvm-svn: 79999
2009-08-25 16:37:49 +00:00
Dan Gohman a98e0e73de Update clang for raw_fd_ostream no longer requiring F_Force.
llvm-svn: 79991
2009-08-25 15:36:09 +00:00
Anders Carlsson 6eb55575da BuildCXXConstructExpr now returns an OwningExprResult.
llvm-svn: 79975
2009-08-25 05:12:04 +00:00
Fariborz Jahanian 20464fba70 Fixes pr4763.
llvm-svn: 79923
2009-08-24 17:19:23 +00:00
Torok Edwin db7149246f Fix build of clang with gcc-4.4: #include <cstdio> was missing.
llvm-svn: 79916
2009-08-24 13:25:12 +00:00
Benjamin Kramer 89b422c118 Replace cerr with errs().
llvm-svn: 79854
2009-08-23 12:08:50 +00:00
Daniel Dunbar 730a54bf28 cerr -> errs.
llvm-svn: 79844
2009-08-23 08:52:09 +00:00
Douglas Gregor 76d8c5725f Don't install Clang libraries.
llvm-svn: 79824
2009-08-23 05:02:18 +00:00
Chris Lattner 84cffc22d4 adjust for raw_fd_ostream api change.
llvm-svn: 79809
2009-08-23 02:59:41 +00:00
Anders Carlsson d7923c6ed7 Add CK_NullToMemberPointer and CK_BaseToDerivedMemberPointer cast kinds. Make -ast-dump print out the cast kinds of cast expressions.
llvm-svn: 79787
2009-08-22 23:33:40 +00:00
Douglas Gregor 05155d8d7b Implement conversion function templates, along with the ability to use
template argument deduction from a conversion function (C++
[temp.deduct.conv]) with implicit conversions.

llvm-svn: 79693
2009-08-21 23:19:43 +00:00
Douglas Gregor 5ed5ae476e Introduce support for constructor templates, which can now be declared
and will participate in overload resolution. Unify the instantiation
of CXXMethodDecls and CXXConstructorDecls, which had already gotten
out-of-sync.

llvm-svn: 79658
2009-08-21 18:42:58 +00:00
Fariborz Jahanian 6c9e5a2b9e Introduce getConstantArrayElementCount API and use it in
construction/destruction of array members.

llvm-svn: 79637
2009-08-21 16:31:06 +00:00
Mike Stump a002945a20 We now support overriding base functions in vtables. WIP.
llvm-svn: 79587
2009-08-21 01:45:00 +00:00
Argyrios Kyrtzidis 6032ef1aa3 Remove TypeSpecStartLocation from VarDecl/FunctionDecl/FieldDecl, and use DeclaratorInfo to get this information.
llvm-svn: 79584
2009-08-21 00:31:54 +00:00
Fariborz Jahanian 9a84665921 Using "ObjCImplicitSetterGetterRefExpr" instead of "ObjCImplctSetterGetterRefExpr".
A field rename and more comments.

llvm-svn: 79537
2009-08-20 17:02:02 +00:00
Eli Friedman 629ffb9ad3 Fix bit-field promotion to be a bit closer to the behavior of gcc.
Patch by Enea Zaffanella, with some simplifications/corrections to
isPromotableBitField by me.

llvm-svn: 79510
2009-08-20 04:21:42 +00:00
Benjamin Kramer a48651de2d Update CMakeLists.
llvm-svn: 79416
2009-08-19 12:02:15 +00:00
Eli Friedman 5ae98ee006 Make integer promotions work correctly on PIC16 and other platforms
where sizeof(short) == sizeof(int).  Move UsualArithmeticConversionsType 
out of Sema, since it was only there as a historical artifact.  Patch by 
Enea Zaffanella.

llvm-svn: 79412
2009-08-19 07:44:53 +00:00
Argyrios Kyrtzidis 60ed560428 Introduce DeclaratorDecl and pass DeclaratorInfo through the Decl/Sema interfaces.
DeclaratorDecl contains a DeclaratorInfo* to keep type source info.
Subclasses of DeclaratorDecl are FieldDecl, FunctionDecl, and VarDecl.
EnumConstantDecl still inherits from ValueDecl since it has no need for DeclaratorInfo.

Decl/Sema interfaces accept a DeclaratorInfo as parameter but no DeclaratorInfo is created yet.

llvm-svn: 79392
2009-08-19 01:27:57 +00:00
Argyrios Kyrtzidis 3f79ad7405 Introduce DeclaratorInfo and TypeLoc, intended to be used for storing and reading source information for types.
DeclaratorInfo will contain a flat memory block for source information about a type that came out of a declarator.
TypeLoc and its subclasses will be used by clients as wrappers to "traverse" the memory block and read the information.

Both DeclaratorInfo and TypeLoc are not utilized in this commit.

llvm-svn: 79391
2009-08-19 01:27:32 +00:00
Fariborz Jahanian 19380c4b88 Renamed ClassProp data member of ObjCImplctSetterGetterRefExpr
to InterfaceDecl, as it is unrelated to any property and
holds the InterfaceDecl needed for accessing class getter/setter
methods using the dot-syntax.

llvm-svn: 79371
2009-08-18 21:37:33 +00:00
Fariborz Jahanian 88cc2340de Renamed ObjCKVCRefExpr to ObjCImplctSetterGetterRefExpr.
Removed an unnecessary loop to get to setters incoming
argument. Added DoxyGen comments. Still more work
to do in this area (WIP).

llvm-svn: 79365
2009-08-18 20:50:23 +00:00
David Chisnall 9f57c29053 Initial patch to support definitions of id and Class from headers in Objective-C code.
This currently breaks test/SemaObjC/id-isa-ref.m and issues some spurious warnings when you attempt to assign a struct objc_class* value to a Class variable.  The test case probably should fail as it's written, because without the definition of Class the compiler should not assume struct objc_class* is a valid receiver type, but it's left broken because it would be nice if we could get that passing too for the special case of isa.

Approved by snaroff.

llvm-svn: 79248
2009-08-17 16:35:33 +00:00
Mike Stump 996576f3aa Refine vbase offset calculations. WIP.
llvm-svn: 79198
2009-08-16 19:04:13 +00:00
Chris Lattner d37f61c1c6 fix my previous commit.
llvm-svn: 79191
2009-08-16 16:51:50 +00:00
Chris Lattner d8b800ad31 This is an attempt to improve loc info for 'unused result' expression
warnings, but it fails because we don't have the location of the .
and I don't understand ObjCKVCRefExpr.  I'll revisit this later.

llvm-svn: 79190
2009-08-16 16:45:18 +00:00
Anders Carlsson e80ccac2cb Call MaybeBindToTemporary for overloaded binary and unary operators.
llvm-svn: 79173
2009-08-16 04:11:06 +00:00
Anders Carlsson 8c84c206d9 Add MaybeBindToTemporary calls for member call expressions.
llvm-svn: 79171
2009-08-16 03:42:12 +00:00
Mike Stump 22ea1f8a30 Cleanups and fixups for calculating the virtual base offsets. WIP.
llvm-svn: 79156
2009-08-16 01:46:26 +00:00
Eli Friedman c80ca68423 Fix test failure due to uninitialized member.
llvm-svn: 79145
2009-08-15 22:23:00 +00:00
Eli Friedman c96d4963eb Implement __is_empty. Patch by Sean Hunt.
llvm-svn: 79143
2009-08-15 21:55:26 +00:00
Eli Friedman 04fddf0d1f Fix for PR4721: adjust CodeGen and ASTContext so that we have a
consistent model for handling size expressions for VLAs.

The model is essentially as follows: VLA types own their associated
expression.  In some cases, we need to create multiple VLA types to 
represent a given VLA (for canonical types, or qualifiers on array types,
or type merging).  If we need to create multiple types based off of 
the same VLA declaration, we use the new refcounting functionality so they can 
all own the expression. The VLASizeMap in CodeGenFunction then uses the size
expression to identify the group of VLA types based off of the same original
declaration.

I'm not particularly attached to the VLA types owning the expression, 
but we're stuck with at least until someone comes up with a way 
to walk the VLA expressions for a declaration.

I did the parallel fix in ASTContext for DependentSizedArrayType, but I 
haven't really looked closely at it, so there might still be issues 
there.

I'll clean up the code duplication in ASTContext in a followup commit.

llvm-svn: 79071
2009-08-15 02:50:32 +00:00
John McCall deb8448690 Disable all recognition of main() in -ffreestanding. Addresses bug #4720.
llvm-svn: 79070
2009-08-15 02:09:25 +00:00