Commit Graph

1142 Commits

Author SHA1 Message Date
Daniel Dunbar 58e2971bb0 x86-32 Darwin ABI: Single element arrays can be part of "single
element structures", which have different ABI rules.
 - Current return-arguments-32 status is: 1 out of 1000 failures (-7)

 - Also, vectors inside "single element structs" require special
   handling.

llvm-svn: 68196
2009-04-01 07:08:38 +00:00
Chris Lattner 3088a31e96 remove ASTContext::buildObjCInterfaceType, which breaks canonical
types.  It is no longer needed now that the code generator 
re-lays-out interfaces if they are defines after being laid out
from a forward decl.

llvm-svn: 68194
2009-04-01 06:23:52 +00:00
Daniel Dunbar cd76e673eb x86-32 Darwin ABI: Handle direct return of vectors.
- Current return-arguments-32 status is: 8 out of 1000 failures (-7)

llvm-svn: 68192
2009-04-01 06:13:08 +00:00
Daniel Dunbar f77e292a0f Fix a subtle bug where the cleanup scope entries had a dangling block reference
- <rdar://problem/6732143> Crash when generating @synchronize for
   zero-cost exception

 - Thanks to Anders for helping track down the problem.

llvm-svn: 68186
2009-04-01 04:37:47 +00:00
Chris Lattner d18136a644 fix the two xfails I added with a previous patch by making ObjC interface
types get completed when their definition is seen if previously laid out by
the code generator.

llvm-svn: 68177
2009-04-01 02:36:43 +00:00
Chris Lattner 6483908957 move trivial forwarding function inline.
llvm-svn: 68176
2009-04-01 02:08:13 +00:00
Chris Lattner 87bc387f8f tidy some code.
llvm-svn: 68174
2009-04-01 02:00:48 +00:00
Mike Stump cafa0a9746 Fix block comparisons. Radar 6732116.
llvm-svn: 68171
2009-04-01 01:17:39 +00:00
Anders Carlsson 237f349073 Implement code generation of namespaces and add mangling tests.
llvm-svn: 68170
2009-04-01 00:58:25 +00:00
Anders Carlsson 12edad2c50 Fix a bug (that I thought I had fixed already) where mangling a prefix could get us into an infinite loop
llvm-svn: 68168
2009-04-01 00:42:16 +00:00
Anders Carlsson 7a6f8b9281 Fix a mangling bug where functions with no arguments weren't getting the 'v' parameter specifier.
llvm-svn: 68162
2009-04-01 00:15:23 +00:00
Daniel Dunbar 08b216abf1 Add Target hooks for IRgen of [cf]string literals.
- Notably, set section on cfstring literal string data (for now, this
   is done everywhere because it matches what we were already doing
   for the CFString data itself)

 - <rdar://problem/6599098> [irgen] linker requires objc string data
   to go into cstring

llvm-svn: 68160
2009-03-31 23:42:16 +00:00
Chris Lattner f41e87f4cd Change UsedArray to be a vector of WeakVH to fix a dangling pointer problem that occurs when
attribute(used) and asm renaming are used together.

llvm-svn: 68155
2009-03-31 22:37:52 +00:00
Chris Lattner 2739d2bbe6 remove some obsolete comments, use an AssertingVH.
llvm-svn: 68151
2009-03-31 22:17:44 +00:00
Daniel Dunbar 35579146aa x86_32 Darwin ABI: Treat empty unions like empty structures.
- Current return-arguments-32 status: 15/1000 failures

llvm-svn: 68132
2009-03-31 19:01:39 +00:00
Fariborz Jahanian 89d239796a Patch to fix proptocol reference ir-gen for GNU runtime.
Patch by David Chisnal.

llvm-svn: 68125
2009-03-31 18:27:22 +00:00
Fariborz Jahanian 63a224ad59 ir-gen support for nonfragile abi's synthesized ivars.
llvm-svn: 68122
2009-03-31 18:11:23 +00:00
Fariborz Jahanian 3254a6f94c More toward nonfragile abi's synthesized ivars.
llvm-svn: 68115
2009-03-31 17:00:52 +00:00
Steve Naroff 66afeb5968 Some "prep" work for handling ObjC @-string constants that contain UTF-8. No functionality change.
Changed GenerateConstantString() to take an ObjCStringLiteral (instead of a std::string). While this isn't strictly necessary, it seems cleaner and allows us to cache to "containsNonAscii" if necessary (to avoid checking in both Sema and CodeGen).

llvm-svn: 68114
2009-03-31 16:53:37 +00:00
Chris Lattner 05aa49128c remove a dead prototype
llvm-svn: 68105
2009-03-31 09:07:15 +00:00
Chris Lattner 733dc19be6 remove the warning. We don't control what users do, and this code
is run for perfectly reasonable things like NSString* because type
layout is recursive.

llvm-svn: 68104
2009-03-31 09:04:50 +00:00
Chris Lattner 3e2f36e905 do not *copy* objc interface types, just use their reference.
llvm-svn: 68102
2009-03-31 08:55:07 +00:00
Chris Lattner 5b36ddb1ad fill in temporary smallvectors instead of vectors for performance.
Fix BuildAggrIvarLayout to not access vectors out of range.

llvm-svn: 68101
2009-03-31 08:48:01 +00:00
Chris Lattner 06ae0e2c3b small cleanups.
llvm-svn: 68095
2009-03-31 08:33:16 +00:00
Douglas Gregor dc572a3266 Improve the representation of template names in the AST. This
representation handles the various ways in which one can name a
template, including unqualified references ("vector"), qualified
references ("std::vector"), and dependent template names
("MetaFun::template apply").

One immediate effect of this change is that the representation of
nested-name-specifiers in type names for class template
specializations (e.g., std::vector<int>) is more accurate. Rather than
representing std::vector<int> as

  std::(vector<int>)

we represent it as

  (std::vector)<int>

which more closely follows the C++ grammar. 

Additionally, templates are no longer represented as declarations
(DeclPtrTy) in Parse-Sema interactions. Instead, I've introduced a new
OpaquePtr type (TemplateTy) that holds the representation of a
TemplateName. This will simplify the handling of dependent
template-names, once we get there.

llvm-svn: 68074
2009-03-30 22:58:21 +00:00
Fariborz Jahanian ed308a94da Code gen does not yet supports __asm__ on a variable
declaration. Reject it.

llvm-svn: 68058
2009-03-30 20:32:06 +00:00
Fariborz Jahanian 3b636c15e0 Use CodeGenModule API for ObjC runtime function references.
Patch by David Chisnall.

llvm-svn: 68043
2009-03-30 18:02:14 +00:00
Chris Lattner 5bbb3c8ad9 Push DeclGroup much farther throughout the compiler. Now the various
productions (except the already broken ObjC cases like @class X,Y;) in 
the parser that can produce more than one Decl return a DeclGroup instead
of a Decl, etc.

This allows elimination of the Decl::NextDeclarator field, and exposes
various clients that should look at all decls in a group, but which were
only looking at one (such as the dumper, printer, etc).  These have been
fixed.

Still TODO:

1) there are some FIXME's in the code about potentially using
DeclGroup for better location info.
2) ParseObjCAtDirectives should return a DeclGroup due to @class etc.
3) I'm not sure what is going on with StmtIterator.cpp, or if it can
   be radically simplified now.
4) I put a truly horrible hack in ParseTemplate.cpp.

I plan to bring up #3/4 on the mailing list, but don't plan to tackle
#1/2 in the short term.

llvm-svn: 68002
2009-03-29 16:50:03 +00:00
Eli Friedman bbcf49e410 Initial implementation of ARM ABI. Mostly untested. Note that I'm not
really intending to take ownership of this; I wrote this mostly because 
I was curious about how the ARM ABI works.  It should be a decent start, 
though.

llvm-svn: 67969
2009-03-29 00:15:25 +00:00
Chris Lattner 529efc74ad rename some methods.
llvm-svn: 67923
2009-03-28 06:33:19 +00:00
Chris Lattner cf16983179 change HandleTranslationUnit to take an ASTContext instead of TranslationUnit
llvm-svn: 67910
2009-03-28 04:11:33 +00:00
Eli Friedman 754d5ac658 Trivial cleanup.
llvm-svn: 67899
2009-03-28 03:27:06 +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
Eli Friedman 9127aa1caf Minor cleanup.
llvm-svn: 67896
2009-03-28 03:10:45 +00:00
Eli Friedman e381f7e3e9 Misc small fixes/cleanups/comment changes.
llvm-svn: 67895
2009-03-28 02:45:41 +00:00
Eli Friedman 8b7b1b1aee Change compound assignment operators to keep track of both the promoted
LHS type and the computation result type; this encodes information into 
the AST which is otherwise non-obvious.  Fix Sema to always come up with the 
right answer for both of these types.  Fix IRGen and the analyzer to 
account for these changes.  This fixes PR2601.  The approach is inspired 
by PR2601 comment 2.

Note that this changes real *= complex in CodeGen from a silent 
miscompilation to an explicit error.

I'm not really sure that the analyzer changes are correct, or how to 
test them... someone more familiar with the analyzer should check those 
changes.

llvm-svn: 67889
2009-03-28 01:22:36 +00:00
Devang Patel afc1c1d405 Do not emit debug information for variables while generating optimized code. The llvm optimizer and code generator are not yet ready to support optimized code debugging.
llvm-svn: 67876
2009-03-27 23:16:32 +00:00
Eli Friedman 7044b76707 Finish off semantic analysis for regparm, and remove the warning. Also
remove a redundant error in CodeGen.

llvm-svn: 67868
2009-03-27 21:06:47 +00:00
Fariborz Jahanian a2d609e2f1 Besides the warning, issue unsupported diagnostics in
ir gen. No intended change in functionality.

llvm-svn: 67857
2009-03-27 18:38:55 +00:00
Fariborz Jahanian dac14a7159 - Minor change to dump of ivar layout map.
- Temporarily undef'ed __OBJC2__ in nonfragile objc abi mode
  as it was forcing ivar synthesis in a certain project which clang
  does not yet support.

llvm-svn: 67766
2009-03-26 19:10:36 +00:00
Chris Lattner 984fac5f5f most of this is plumbing to get CompileOptions down into
CodeGenModule.  Once there, add a new NoCommon option to
it and implement -fno-common.

llvm-svn: 67735
2009-03-26 05:00:52 +00:00
Fariborz Jahanian f909f92799 More for for objc2's ivar layout map (currently
is not in use).

llvm-svn: 67713
2009-03-25 22:36:49 +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
Chris Lattner 8c37df4f91 simplify some conditionals, don't copy LangOptions.
llvm-svn: 67674
2009-03-25 03:28:08 +00:00
Devang Patel 94406c954f Encode language.
llvm-svn: 67650
2009-03-24 20:35:51 +00:00
Daniel Dunbar bf1fe8c36c Support member reference on ?: of struct type.
llvm-svn: 67603
2009-03-24 02:38:23 +00:00
Eli Friedman 2dc5f29ff2 Fix the ABI convention for struct returns on x86 outside of Darwin.
llvm-svn: 67577
2009-03-23 23:26:24 +00:00
Fariborz Jahanian aedcfa49b9 Must allow for strong cast of floats as well (objc2 gc).
llvm-svn: 67551
2009-03-23 19:10:40 +00:00
Eli Friedman 31a20d680a Some minor fixes for complex IRGen.
llvm-svn: 67501
2009-03-23 04:08:46 +00:00