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

1480 Коммитов

Автор SHA1 Сообщение Дата
Eli Friedman 04e8357f68 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79510 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-20 04:21:42 +00:00
Benjamin Kramer ad97866feb Update CMakeLists.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79416 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 12:02:15 +00:00
Eli Friedman a95d75769e 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79412 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 07:44:53 +00:00
Argyrios Kyrtzidis a1d5662d96 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79392 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 01:27:57 +00:00
Argyrios Kyrtzidis b17166c807 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79391 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-19 01:27:32 +00:00
Fariborz Jahanian d2ae5aa732 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79371 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 21:37:33 +00:00
Fariborz Jahanian 154440e6a8 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).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79365 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-18 20:50:23 +00:00
David Chisnall 0f43656064 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79248 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 16:35:33 +00:00
Mike Stump fe3010d09c Refine vbase offset calculations. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79198 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 19:04:13 +00:00
Chris Lattner 5e94a0d82b fix my previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79191 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 16:51:50 +00:00
Chris Lattner a50089ec68 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79190 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 16:45:18 +00:00
Anders Carlsson 2d46eb21eb Call MaybeBindToTemporary for overloaded binary and unary operators.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79173 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 04:11:06 +00:00
Anders Carlsson 6f68027af2 Add MaybeBindToTemporary calls for member call expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79171 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 03:42:12 +00:00
Mike Stump 276b9f1d81 Cleanups and fixups for calculating the virtual base offsets. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79156 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 01:46:26 +00:00
Eli Friedman 97c134ea0d Fix test failure due to uninitialized member.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79145 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 22:23:00 +00:00
Eli Friedman 1d954f6a00 Implement __is_empty. Patch by Sean Hunt.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79143 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 21:55:26 +00:00
Eli Friedman bbed6b9644 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79071 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 02:50:32 +00:00
John McCall 07a5c22bb6 Disable all recognition of main() in -ffreestanding. Addresses bug #4720.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79070 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 02:09:25 +00:00
Anders Carlsson 0e67f9dc4d Fix spacing
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78981 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 02:39:47 +00:00
Mike Stump 2153891806 Deconflate virtual base offsets from non-virtual base offsets.
Deconflate a virtual base primary from a non-virtual base.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78971 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 01:44:03 +00:00
Mike Stump 0880e75541 We can't avoid doing the work to find all the indirect primary virtual
base classes as we'll need that to layout the virtual bases...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78954 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 23:26:06 +00:00
Mike Stump 4ef980984f Refine vtable layout for virtual bases and keep better track of
primaries.  WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78950 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 22:53:07 +00:00
Mike Stump d53cef178d Prep for vbase layout refinements. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78882 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 02:02:14 +00:00
Mike Stump 94d0bceeb3 Refine virtual base layout. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78873 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 00:34:14 +00:00
Fariborz Jahanian 0270b8aa3f More toward synthesizing copy assignments. SWIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78861 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 23:34:46 +00:00
Mike Stump 0a5cfd86de Remove another done audit FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78847 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 22:10:00 +00:00
Mike Stump 02b16238a3 Refactor a bit and remove some FIXME audit markers, now that the code
has been audited for correctness.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78846 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 22:06:55 +00:00
Mike Stump d76264e0b2 Refine primary vbase selection ordering. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78844 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 21:50:08 +00:00
Nate Begeman 888376a2bb Transition the PCH support for ShuffleVectorExpr over to ASTContext allocation
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78783 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 02:28:50 +00:00
Fariborz Jahanian 6cc670e2eb Warn on use of property dot syntax when unused.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78760 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 00:45:33 +00:00
Anders Carlsson 0eca1b609a Add some information about temporaries to the statement dumper.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78754 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 00:21:52 +00:00
Fariborz Jahanian 0fd8904c5f Patch to warn if a property which is 'assign' by default
may not implement NSCopying protocol in -fobjc-gc[-only] mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78726 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 22:02:25 +00:00
John McCall c48fbdfb83 Add a FriendClassDecl type for holding declarations of friend types in
the AST, and create such declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78719 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 21:13:21 +00:00
Chris Lattner ab0e8873c3 Fix rdar://7126285: don't warn on unused ObjC property access
that uses "dot syntax" since it might have a side effect.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78704 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 20:08:03 +00:00
Fariborz Jahanian e649412808 ir-gen support for anonymous union data member
copying in copy constructors and used in
default constructor's initializer list.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78700 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 18:49:54 +00:00
John McCall 3f9a8a6061 Argument-dependent lookup for friend declarations. Add a new decl type,
FriendFunctionDecl, and create instances as appropriate.

The design of FriendFunctionDecl is still somewhat up in the air;  you can
befriend arbitrary types of functions --- methods, constructors, etc. ---
and it's not clear that this representation captures that very well.
We'll have a better picture when we start consuming this data in access
control.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78653 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 06:59:38 +00:00
Mike Stump 49520944c6 Implement more of the inductive case for vtable layout involving
virtual base primaries and improve the layout of classes with virtual
bases.  WIP.

Hey, I've decided I want a change to FileCheck, I need to ensure that
the group is together, nothing in between.  Can we change it to check
the match line is from the line immediately following the last matched
line, if the source for the matched line is immediately after the
source for the previously matched line?

// CHECK: 1
// CHECK: 2
// CHECK: 3

// CHECK: 4
// CHECK: 5
// CHECK: 6

would require 1 2 and 3 to be continuous in the output, and 4 5 and 6
to be continuous.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78638 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 04:03:59 +00:00
Fariborz Jahanian 89350bee4c Fix an indentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78624 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 23:59:59 +00:00
Fariborz Jahanian 8c64e007d9 Support for anonymous union in ctor's initializer and
bunch of FIXMEs for their is-gen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78623 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 23:56:17 +00:00
Nate Begeman 2ef13e5abe Take 2 on AltiVec-style vector initializers.
Fixes PR4704 problems

Addresses Eli's patch feedback re: ugly cast code

Updates all postfix operators to remove ParenListExprs.  While this is awful,
no better solution (say, in the parser) is obvious to me.  Better solutions
welcome.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78621 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 23:49:36 +00:00
Daniel Dunbar 1df5109f47 Revert r78535, it is causing a number of failures to build projects.
--- Reverse-merging r78535 into '.':
D    test/Sema/altivec-init.c
U    include/clang/Basic/DiagnosticSemaKinds.td
U    include/clang/AST/Expr.h
U    include/clang/AST/StmtNodes.def
U    include/clang/Parse/Parser.h
U    include/clang/Parse/Action.h
U    tools/clang-cc/clang-cc.cpp
U    lib/Frontend/PrintParserCallbacks.cpp
U    lib/CodeGen/CGExprScalar.cpp
U    lib/Sema/SemaInit.cpp
U    lib/Sema/Sema.h
U    lib/Sema/SemaExpr.cpp
U    lib/Sema/SemaTemplateInstantiateExpr.cpp
U    lib/AST/StmtProfile.cpp
U    lib/AST/Expr.cpp
U    lib/AST/StmtPrinter.cpp
U    lib/Parse/ParseExpr.cpp
U    lib/Parse/ParseExprCXX.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78551 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 03:01:36 +00:00
Nate Begeman 25b4fdb9d6 AltiVec-style vector initializer syntax, vec4 a = (vec4)(a, b, c, d);
In addition to being defined by the AltiVec PIM, this is also the vector
initializer syntax used by OpenCL, so that vector literals are compatible
with macro arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78535 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-09 17:55:44 +00:00
Anders Carlsson a5dd722bdf Take #pragma pack into account when laying out structs. Fixes rdar://problem/7095436.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78490 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 19:38:24 +00:00
Anders Carlsson a860e755f1 Introduce a new PragmaPack attribute, and use it for #pragma pack. The PackedAttr now only represents __attribute__((packed)).
This is necessary because #pragma pack and __attribute__((packed)) have different semantics. No functionality change yet, but this lays the groundwork for fixing a record layout bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78483 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 18:23:56 +00:00
Anders Carlsson d497206844 Get rid of Stmt::Clone now that we can reference count statements instead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78452 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 02:50:17 +00:00
Douglas Gregor 43d9d92433 Introduce reference counting for statements and expressions, using it
to allow sharing of nodes. Simplifies some aspects of template
instantiation, and fixes both PR3444 and <rdar://problem/6757457>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78450 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 01:41:12 +00:00
Mike Stump 928f1506eb Add ability to generate vcall offsets for primary virtual base.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78396 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 19:00:50 +00:00
Mike Stump e607ed0683 Fix some const_cast issues. This is the beginning of the rabbit hole.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78393 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 18:05:12 +00:00
Douglas Gregor 42602bb40a Separate Stmt::Destroy into the entrypoint for destroying a statement
or expression (Destroy) from the virtual function used to actually
destroy a given expression (DoDestroy). 



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78375 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-07 06:08:38 +00:00
Mike Stump eb19fa9481 Layout virtual bases. Work in progress.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78308 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-06 13:41:24 +00:00