Commit Graph

95 Commits

Author SHA1 Message Date
Owen Anderson 9793f0e4d7 Update for LLVM API change.
llvm-svn: 77514
2009-07-29 22:16:19 +00:00
Ted Kremenek c23c7e6a51 Change uses of:
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
  Type::getAsRecordType() -> Type::getAs<RecordType>()
  Type::getAsPointerType() -> Type::getAs<PointerType>()
  Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
  Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
  Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
  Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
  Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
  Type::getAsTagType() -> Type::getAs<TagType>()
  
And remove Type::getAsReferenceType(), etc.

This change is similar to one I made a couple weeks ago, but that was partly
reverted pending some additional design discussion. With Doug's pending smart
pointer changes for Types, it seemed natural to take this approach.

llvm-svn: 77510
2009-07-29 21:53:49 +00:00
Owen Anderson ade90fd1ba Update for LLVM API change.
llvm-svn: 77492
2009-07-29 18:54:39 +00:00
Owen Anderson 0e0189d64d Update for LLVM API change.
llvm-svn: 77267
2009-07-27 22:29:56 +00:00
Owen Anderson b7a2fe6f81 Update for LLVM API change.
llvm-svn: 77012
2009-07-24 23:12:58 +00:00
Ted Kremenek 8a286fbdb9 Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methods
until Doug Gregor's Type smart pointer code lands (or more discussion occurs).
These methods just call the new Type::getAs<XXX> methods, so we still have
reduced implementation redundancy. Having explicit getAsXXXType() methods makes
it easier to set breakpoints in the debugger.

llvm-svn: 76193
2009-07-17 17:50:17 +00:00
Ted Kremenek e3fb4b6524 Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.
This method is intended to eventually replace the individual
Type::getAsXXXType<> methods.

The motivation behind this change is twofold:

1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of
them are basically copy-and-paste.

2) By centralizing the implementation of the getAs<Type> logic we can more
smoothly move over to Doug Gregor's proposed canonical type smart pointer
scheme.

Along with this patch:

a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>.
b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>.

llvm-svn: 76098
2009-07-16 19:58:26 +00:00
Owen Anderson 170229f68d Update for LLVM API change, and contextify a bunch of related stuff.
llvm-svn: 75705
2009-07-14 23:10:40 +00:00
Owen Anderson ae86c19e68 Update for LLVM API change.
llvm-svn: 75446
2009-07-13 04:10:07 +00:00
Owen Anderson c10c8d3e2b Update for LLVM API change.
llvm-svn: 75028
2009-07-08 19:05:04 +00:00
Owen Anderson 9f211fb4fa Update for LLVM API change.
llvm-svn: 74986
2009-07-08 01:29:18 +00:00
Mike Stump cbc2bcaf17 As an optimization, we maintain a cache of generated
___Block_byref_id_object_dispose and ___Block_byref_id_object_copy
functions so that we can simply reuse instead of creating a new one.
Additionally, add an assert to ensure no one yet tries to align a
__block variable beyond the alignment of a pointer as the codegen is
incomplete.

llvm-svn: 72974
2009-06-05 23:26:36 +00:00
Mike Stump 18bb9284ff Reflow some comments.
llvm-svn: 71937
2009-05-16 07:57:57 +00:00
Chris Lattner 46813bbfa2 Fix rdar://6880259 - invalid function name in block call (__NSConcreteGlobalBlock2)
by using the appropriate CGM interface instead of directly creating a global.

llvm-svn: 71617
2009-05-13 02:50:56 +00:00
Mike Stump d898026e8a Don't assert when we think we need copy/dispose, but don't need them.
Radar 6838889

llvm-svn: 70525
2009-05-01 01:31:57 +00:00
Chris Lattner 324f80b12a fix a problem producing debug info with global blocks.
llvm-svn: 69875
2009-04-23 07:18:56 +00:00
Chris Lattner 28ec0cf86c the logic for computing __func__ and friends is really broken:
the type assigned by sema (and is visible with sizeof(__func__) for
example) has nothing to do with what codegen ends up producing.
We should eventually add a method on PredefinedExpr to handle this.
In the meantime, just set up some framework and add some fixme's.

llvm-svn: 69872
2009-04-23 05:30:27 +00:00
Daniel Dunbar c3e7cff6d3 Attributes on block functions were not being set.
- <rdar://problem/6800351> clang not producing correct large struct
   return code for Blocks

llvm-svn: 69337
2009-04-17 00:48:04 +00:00
Mike Stump 3b65ac2696 Fixup codegen for copy/dispose for block literals. Radar 6791245
llvm-svn: 69232
2009-04-15 22:11:36 +00:00
Devang Patel 9074ed8c6a Set DebugInfo at the beginning of GenerateBlockFunction().
llvm-svn: 69228
2009-04-15 21:51:44 +00:00
Daniel Dunbar 0ca1660129 Audit __private_extern__ handling.
- Exposed quite a few Sema issues and a CodeGen crash.

 - See FIXMEs in test case, and in SemaDecl.cpp (PR3983).

I'm skeptical that __private_extern__ should actually be a storage
class value. I think that __private_extern__ basically amounts to
  extern A __attribute__((visibility("hidden")))
and would be better off handled (a) as that, or (b) with an extra bit
in the VarDecl.

llvm-svn: 69020
2009-04-14 02:25:56 +00:00
Fariborz Jahanian a4f6b6b180 Minor refactoring of my last patch.
llvm-svn: 68870
2009-04-11 18:54:57 +00:00
Fariborz Jahanian aae4349df9 Fixes a ir-gen crash for K&R style blocks.
llvm-svn: 68865
2009-04-11 17:55:15 +00:00
Mike Stump 6764593098 Fixup codegen for nested blocks that use copy/dispose in the inner
blocks, so that the outer blocks use it as well.  Radar 6762279

llvm-svn: 68811
2009-04-10 18:52:28 +00:00
Anders Carlsson 479e6fc7a7 Use the new EmitCallArgs function. No indented functionality change.
llvm-svn: 68652
2009-04-08 23:13:16 +00:00
Anders Carlsson a60cbcdfe6 Don't assume that a block always has a FunctionProtoType. Fixes rdar://6768379.
llvm-svn: 68583
2009-04-08 02:55:55 +00:00
Anders Carlsson 5f50c651e9 Shuffle some call code around. No functionality change.
llvm-svn: 68557
2009-04-07 22:10:22 +00:00
Anders Carlsson 350da60733 Use the new getFunctionInfo that takes a BlockPointerType parameter, and get rid of getBlockFunctionType from CGBlocks.cpp
llvm-svn: 68478
2009-04-07 00:20:24 +00:00
Mike Stump cafa0a9746 Fix block comparisons. Radar 6732116.
llvm-svn: 68171
2009-04-01 01:17:39 +00:00
Eli Friedman 09a9b6e335 Move where block-related variables are initialized so that block
types don't get generated when blocks aren't used.

llvm-svn: 67898
2009-03-28 03:24:54 +00:00
Mike Stump 871c1f6f88 Remove -f__block as codegen for __block variables should be solid.
llvm-svn: 67697
2009-03-25 18:05:39 +00:00
Mike Stump d2142cffbf Fixup codegen for block literals that bleed copy/dispose information
from previous block literals.

llvm-svn: 67696
2009-03-25 17:58:24 +00:00
Mike Stump efd7caa825 Fixup codegen for nested block literals so that we generate
copy_helpers and dispose_helpers as necessary for them.

llvm-svn: 67453
2009-03-21 21:00:35 +00:00
Mike Stump 692c6e3729 Fix codegen for support for super inside block literal expressions.
llvm-svn: 67406
2009-03-20 21:53:12 +00:00
Mike Stump 5469f29aa9 Do up codegen for function static data and externs in functions in block
literals.

llvm-svn: 66984
2009-03-13 23:34:28 +00:00
Mike Stump f807ccc58e Remove FIXME, issue has been resolved.
llvm-svn: 66931
2009-03-13 19:38:54 +00:00
Steve Naroff c4b30e596c Fix <rdar://problem/6675489> BlockDecl should not use llvm::smallvector.
Also changed BlockDecl API to be more consistent (wrt FunctionDecl).

llvm-svn: 66904
2009-03-13 16:56:44 +00:00
Daniel Dunbar a61bb4d198 Fix uninitialized use in GetAddrOfGlobalBlock, reenable assert.
- Mike, please verify.

llvm-svn: 66762
2009-03-12 03:07:24 +00:00
Mike Stump de373a033f If someone could figure out this is necessary, that would be good.
llvm-svn: 66341
2009-03-07 16:32:25 +00:00
Mike Stump d9728222a4 Fix typo, need parens.
llvm-svn: 66337
2009-03-07 14:53:10 +00:00
Mike Stump 1ab20cae19 Remove last FIXME for block literal codegen that I know about and turn
on all the new code by default.  There is still plenty of testing to
do and issues I'm sure need resolving.  Let me know if you find
anything.

llvm-svn: 66323
2009-03-07 06:16:52 +00:00
Mike Stump 90d8daf592 Remove some FIXMEs for block literals that should be close to working.
llvm-svn: 66322
2009-03-07 06:04:31 +00:00
Mike Stump 6f7d9f8774 codegen support for dispose helpers for block literals.
llvm-svn: 66320
2009-03-07 02:53:18 +00:00
Mike Stump aeb0ffd56c Codegen support for copy helpers for block literals.
llvm-svn: 66319
2009-03-07 02:35:30 +00:00
Mike Stump d6ef62f0bf Pass the type of the block literal around to make required temporal ordering of code clearer.
llvm-svn: 66284
2009-03-06 18:42:23 +00:00
Mike Stump f89230d93b Complete __Block_byref_id_object_copy cogegen for block literals.
llvm-svn: 66257
2009-03-06 06:12:24 +00:00
Mike Stump fbe25dd1e4 Finish off __Block_byref_id_object_dispose codegen for block literals.
llvm-svn: 66247
2009-03-06 04:53:30 +00:00
Mike Stump 846bf9a797 Remove extra arg.
llvm-svn: 66243
2009-03-06 02:45:21 +00:00
Mike Stump ee2a5ee5f7 More codegen support for the copy/dispose helpers for block literals.
llvm-svn: 66241
2009-03-06 02:29:21 +00:00
Mike Stump 0c74327715 Framework for codegen for copy/dispose helpers.
llvm-svn: 66231
2009-03-06 01:33:24 +00:00