Commit Graph

165 Commits

Author SHA1 Message Date
Fariborz Jahanian 36ad0e99d5 Have __func__ and siblings point to block's implementation function
name. Fixes radar 7860965.

llvm-svn: 107044
2010-06-28 18:58:34 +00:00
Chris Lattner 5e016ae983 finally get around to doing a significant cleanup to irgen:
have CGF create and make accessible standard int32,int64 and 
intptr types.  This fixes a ton of 80 column violations 
introduced by LLVMContextification and cleans up stuff a lot.

llvm-svn: 106977
2010-06-27 07:15:29 +00:00
Fariborz Jahanian 9b5528d278 Patch to correctly mangle block helper functions
when block literal is declared inside a ctor/dtor.
Fixes radr 8096995.

llvm-svn: 106700
2010-06-24 00:08:06 +00:00
Fariborz Jahanian 3b83618054 Block Code Gen. API. Call destructor on descriptior
entry previously constructed via copy constructor.

llvm-svn: 105641
2010-06-08 20:57:22 +00:00
Fariborz Jahanian a2d7c34e93 Fixed a block regression caused by trying to use
an existing ir for load of a bock variable. This cannot be
done across basic blocks.
Fixes radar 8064140.

llvm-svn: 105549
2010-06-07 19:39:39 +00:00
Fariborz Jahanian ea882cd92e Build AST for copy-construction of copied-in
class object in blocks and carry it to IRGen.

llvm-svn: 105487
2010-06-04 21:35:44 +00:00
Fariborz Jahanian 64176c2c97 For C++ copied in objects, use copy constructors in
setting up block's descriptor. This is on going work to
support c++ specific issues in setting up blocks
various APIs.

llvm-svn: 105469
2010-06-04 16:10:00 +00:00
Fariborz Jahanian d1b378e08d Block C++ code gen. Adds support for block reference argument
types. Executable test will be added to LLVM test suite.
(radar 8041962).

llvm-svn: 105347
2010-06-02 21:35:17 +00:00
Douglas Gregor 02df9da2ac Fix compilation failure
llvm-svn: 104613
2010-05-25 17:12:30 +00:00
Douglas Gregor 7e10f3699a Improve name mangling for blocks and support mangling of static local
variables within blocks. We loosely follow GCC's mangling, but since
these are always internal symbols the names don't really matter. I
intend to revisit block mangling later, because GCC's mangling is
rather verbose. <rdar://problem/8015719>.

llvm-svn: 104610
2010-05-25 17:04:15 +00:00
Chandler Carruth 7ea01c3f8a Add braces to avoid an ambiguous else, fixing a GCC warning.
llvm-svn: 104314
2010-05-21 10:29:28 +00:00
John McCall 9d42f0f174 Allocate space in a block record for implicit references to the Objective C
'self' variable arising from uses of the 'super' keyword.  Also reorganize
some code so that BlockInfo (now CGBlockInfo) can be opaque outside of
CGBlocks.cpp.

Fixes rdar://problem/8010633.

llvm-svn: 104312
2010-05-21 04:11:14 +00:00
John McCall 87fe5d5618 Support implicitly closing on 'this' in a block. Fixed PR7165.
(the codegen works here, too, but that's annoying to test without execution)

llvm-svn: 104202
2010-05-20 01:18:31 +00:00
Douglas Gregor 6a047c979f It's bad form to create VarDecl's without DeclContexts
llvm-svn: 103484
2010-05-11 18:17:16 +00:00
Fariborz Jahanian eeb233793d Fixes a code gen crash when block is a reference type, etc.
(radar 7495203).

llvm-svn: 103022
2010-05-04 17:59:32 +00:00
John McCall 4d4dcc8ed7 When synthesizing Objective C records, give the synthetic fields public
access.  Fixes an assertion.

Fixes rdar://problem/7927811.  Too lazy to reduce a test case.

llvm-svn: 102776
2010-04-30 21:35:41 +00:00
Douglas Gregor c4df407604 Keep track of the actual storage specifier written on a variable or
function declaration, since it may end up being changed (e.g.,
"extern" can become "static" if a prior declaration was static). Patch
by Enea Zaffanella and Paolo Bolzoni.

llvm-svn: 101826
2010-04-19 22:54:31 +00:00
Benjamin Kramer 9e2e1c9024 Minor include pruning.
llvm-svn: 100007
2010-03-31 15:04:05 +00:00
Rafael Espindola c50c27cca8 the big refactoring bits of PR3782.
This introduces FunctionType::ExtInfo to hold the calling convention and the
noreturn attribute. The next patch will extend it to include the regparm
attribute and fix the bug.

llvm-svn: 99920
2010-03-30 20:24:48 +00:00
Blaine Garst f27ab71d9f add support for a 1<<29 bit in the block flags field to mark blocks using alternate struct return ABI
llvm-svn: 97775
2010-03-05 01:29:59 +00:00
Blaine Garst fc83aa04db Unconditionally support block introspection data in a new field at the end
of the block descriptor field.  This field is the ObjC style @encode
signature of the implementation function, and was to this point
conditionally provided in the block literal data structure.  That
provisional support is removed.

Additionally, eliminate unused enumerations for the block literal flags field.
The first shipping ABI unconditionally set (1<<29) but this bit is unused
by the runtime, so the second ABI will unconditionally have (1<<30) set so
that the runtime can in fact distinguish whether the additional data is
present or not.

llvm-svn: 96989
2010-02-23 21:51:17 +00:00
Blaine Garst 5421a83e4a remove unused function & enumerations
llvm-svn: 96635
2010-02-19 00:24:37 +00:00
Fariborz Jahanian 999ddbcf8e Patch to remove arbitrary imporation of 'self' into
a block without it being used. This causes over release
of objects in certain runtime-senitive apps.
(fixes radar 7581175).

llvm-svn: 96501
2010-02-17 19:54:08 +00:00
Fariborz Jahanian 586ca163b4 Did not intend to check this in.
llvm-svn: 96486
2010-02-17 18:11:55 +00:00
Fariborz Jahanian c0309cd3d1 Use proper lexcial context for newly added ivars.
llvm-svn: 96484
2010-02-17 18:10:54 +00:00
Fariborz Jahanian 989908fbac Generate the objc_read_weak API when calling
a __weak block. Fixes radar 7628591.

llvm-svn: 95822
2010-02-10 23:34:57 +00:00
John McCall ab26cfa58d Standardize the parsing of function type attributes in a way that
follows (as conservatively as possible) gcc's current behavior:  attributes
written on return types that don't apply there are applied to the function
instead, etc.  Only parse CC attributes as type attributes, not as decl attributes;
don't accepet noreturn as a decl attribute on ValueDecls, either (it still
needs to apply to other decls, like blocks).  Consistently consume CC/noreturn
information throughout codegen;  enforce this by removing their default values
in CodeGenTypes::getFunctionInfo().

llvm-svn: 95436
2010-02-05 21:31:56 +00:00
Ken Dyck 160146eba2 Change the return type of ASTContext::getDeclAlignInBytes() to CharUnits and,
now that the "InBytes" part of the name is implied by the return type, rename
it to getDeclAlign().

llvm-svn: 94681
2010-01-27 17:10:57 +00:00
Ken Dyck 5262b11962 Use CharUnits for alignments in character units.
llvm-svn: 94571
2010-01-26 19:13:33 +00:00
Ken Dyck 98ca79435a Introduce CodeGenModule::GetTargetTypeStoreSize() to calculate the store size
of LLVM types in character units.

llvm-svn: 94542
2010-01-26 13:48:07 +00:00
Chris Lattner bf78478d35 simplify code.
llvm-svn: 94401
2010-01-25 03:29:35 +00:00
Benjamin Kramer d6b28fc6ad Simplify code.
llvm-svn: 94175
2010-01-22 13:59:13 +00:00
Ken Dyck 40775003e6 Roll out ASTContext::getTypeSizeInChars(), replacing instances of
"ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits
ones as appropriate. 

Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType, 
fromQuantity(), and getQuantity() for clarity.

llvm-svn: 93153
2010-01-11 17:06:35 +00:00
Anders Carlsson bfb3671b25 Pass the return value slot to all call exprs.
llvm-svn: 92145
2009-12-24 21:13:40 +00:00
Anders Carlsson 61a401caec Pass ReturnValueSlot to EmitCall. No functionality change yet.
llvm-svn: 92138
2009-12-24 19:25:24 +00:00
John McCall ce54657e95 DeclRefExpr stores a ValueDecl internally.
Template instantiation can re-use DeclRefExprs.

llvm-svn: 90848
2009-12-08 09:08:17 +00:00
Chris Lattner e08ea7874a various cleanups.
llvm-svn: 90657
2009-12-05 08:21:30 +00:00
Daniel Dunbar c76493a65d Don't pass false (default) for isVolatile parameter to CreateLoad.
llvm-svn: 90098
2009-11-29 21:23:36 +00:00
Douglas Gregor ed6c744091 Centralize and complete the computation of value- and type-dependence for DeclRefExprs
llvm-svn: 89649
2009-11-23 11:41:28 +00:00
David Chisnall 950a9518b1 Added block type introspection support.
As per Fariborz's suggestion, committed now but can be reverted later if the used flag is problematic for Apple.

llvm-svn: 89134
2009-11-17 19:33:30 +00:00
Mike Stump c9f1efe6b3 Remove some misguided code.
llvm-svn: 84823
2009-10-22 01:31:24 +00:00
Mike Stump e1b19ba05b Extend out the block descriptor structure for debug information with
the copy/dispose helpers as appropriate.

llvm-svn: 84817
2009-10-22 00:49:09 +00:00
Mike Stump f23b0ead3d Turn on the preallocation of all BlockDeclRefExprs.
llvm-svn: 84789
2009-10-21 22:02:08 +00:00
Mike Stump 066b616684 Refine collection of BlockDeclRefExprs. WIP.
llvm-svn: 84787
2009-10-21 22:01:24 +00:00
Mike Stump 945fec05dd Fix typo.
llvm-svn: 84770
2009-10-21 18:24:18 +00:00
Mike Stump 41eb02d496 Refactor.
llvm-svn: 84769
2009-10-21 18:23:01 +00:00
Mike Stump 7fe9cc1dd5 Prep work to always preallocate BlockDeclRefExprs so that we can
generate the debug information for the first parameter to the block
invoke functions.  WIP.

llvm-svn: 84737
2009-10-21 03:49:08 +00:00
Mike Stump 38382028c7 For now, we need to have the llvm type of the block pointer remain as
it was.  Fixes codegen bug introduced yesterday.

llvm-svn: 84668
2009-10-20 20:30:01 +00:00
Mike Stump d015328f15 Refine the type of the first parameter to block invoke functions.
WIP.  I have yet to find the magic incantation to get the structure
type to be defined.  If someone has a pointer, love to hear it.

llvm-svn: 84590
2009-10-20 02:12:22 +00:00
Benjamin Kramer abd5b90e4c Simplify pointer creation with the new Type::getInt*Ptr methods.
llvm-svn: 83964
2009-10-13 10:07:13 +00:00