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
Mike Stump
017460ab6c
Implement a FIXME. This improves codegen just a tad.
...
llvm-svn: 83221
2009-10-01 22:29:41 +00:00
Mike Stump
7d69911a1f
A couple of refinements for laying out debug information for
...
BlockDeclRefDecls.
llvm-svn: 83185
2009-10-01 00:27:30 +00:00
Mike Stump
2e722b915c
Improve debugging information for BlockDeclRefExpr. WIP. Given this
...
scheme, we can switch the previous scheme over to using this code
path. There's a bit of simplifications yet to do as well.
llvm-svn: 83138
2009-09-30 02:43:10 +00:00
Mike Stump
d2a3e61798
Fix 80-col violation.
...
llvm-svn: 82725
2009-09-24 22:31:14 +00:00
Mike Stump
2114d7c299
Improve debug info generation for __block variables.
...
llvm-svn: 82508
2009-09-22 02:12:52 +00:00
John McCall
9dd450bb78
Change all the Type::getAsFoo() methods to specializations of Type::getAs().
...
Several of the existing methods were identical to their respective
specializations, and so have been removed entirely. Several more 'leaf'
optimizations were introduced.
The getAsFoo() methods which imposed extra conditions, like
getAsObjCInterfacePointerType(), have been left in place.
llvm-svn: 82501
2009-09-21 23:43:11 +00:00
Nick Lewycky
41eaf0ac57
Make clang stop relying on ConstantStruct::get's default value for isPacked
...
which will be going away (ie. it's becoming a required parameter) later today.
llvm-svn: 82323
2009-09-19 20:00:52 +00:00
Anders Carlsson
f8e94f2008
Add support for __block variables with alignment greater than __alignof(void *).
...
llvm-svn: 81602
2009-09-12 02:44:18 +00:00
Anders Carlsson
0168f4b202
For __block variables, cache the LLVM types as well as which LLVM field where the variable is stored.
...
llvm-svn: 81599
2009-09-12 02:14:24 +00:00
Mike Stump
11289f4280
Remove tabs, and whitespace cleanups.
...
llvm-svn: 81346
2009-09-09 15:08:12 +00:00
Mike Stump
4a3999fe90
Reflow comments and some minor whitespace fixups.
...
llvm-svn: 81337
2009-09-09 13:00:44 +00:00
Anders Carlsson
71d1d92d37
Make BuildByRefType take a ValueDecl instead of a QualType and an alignment.
...
llvm-svn: 81315
2009-09-09 02:51:03 +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
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
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