Eli Friedman
2ad7e17096
PR4143: don't crash generating debug info for incomplete enum types.
...
llvm-svn: 70825
2009-05-04 04:39:55 +00:00
Eli Friedman
33955dd28f
Remove unnecessary push_back (at least, I think it's unnecessary);
...
hopefully, this fixes PR4144 without any regressions.
llvm-svn: 70823
2009-05-04 04:12:48 +00:00
Daniel Dunbar
98ba964e5c
Don't allow clients to traverse into superclass synthesized properties
...
via CollectObjCIvars.
- In places where we need them, we should have the implementation and
access the properties through it.
This is a fairly substantial functionality change:
1. @encode no longer encodes synthesized ivars, ever.
2. The ivar layout bitmap no longer encodes information for
synthesized ivars in superclasses. Well, actually I had already
broken that, but it is intentional now.
We are now differing substantially from llvm-gcc and gcc
here. However, in my opinion this fundamentally *must* work if
non-fragile classes are to work. Without this change, the result of
@encode and the ivar layout depend on the order that the
implementation is seen in a file (if it is in the same file with its
superclass). Since both scenarios should work the same, our behavior
is now consistent with gcc behavior as if an implementation is never
seen following an implementation of its superclass.
Note that #2 is only a functionality change when (A) an
implementation appears in the same translation unit with the
implementation of its superclass, and (B) the superclass has
synthesized ivars. My belief is that this situation does not occur in
practice.
I am not yet sure of the role/semantics of @encode when synthesized
ivars are present... it's use is fairly unsound in a non-fragile world.
llvm-svn: 70822
2009-05-04 04:10:48 +00:00
Daniel Dunbar
62b1070fa2
Inline GetFieldBaseOffset into sole callsite.
...
llvm-svn: 70813
2009-05-03 23:35:23 +00:00
Daniel Dunbar
5b743915c3
Avoid recomputing field offsets.
...
llvm-svn: 70812
2009-05-03 23:31:46 +00:00
Daniel Dunbar
d22aa4a5e5
Normalize formatting
...
llvm-svn: 70810
2009-05-03 23:21:22 +00:00
Daniel Dunbar
36e2a1eea3
Use the implementation decl for looking up offset while building the
...
ivar layout.
- The layout needs access to synthesized ivars.
llvm-svn: 70798
2009-05-03 21:05:10 +00:00
Eli Friedman
5b73b5e197
PR4134: Implement __builtin_extract_return_addr.
...
llvm-svn: 70794
2009-05-03 19:23:23 +00:00
Eli Friedman
5a3b1b0f7a
Fix comment to account for r70786.
...
llvm-svn: 70789
2009-05-03 19:01:39 +00:00
Eli Friedman
c0042d804c
PR4133: fix always_inline implementation to be consistent with gcc.
...
llvm-svn: 70786
2009-05-03 18:13:43 +00:00
Anders Carlsson
1619a5041c
Make codegen for constructors work again.
...
llvm-svn: 70785
2009-05-03 17:47:16 +00:00
Anders Carlsson
4c78596182
assert that mangleName is not called for C++ ctors/dtors.
...
llvm-svn: 70783
2009-05-03 16:51:04 +00:00
Daniel Dunbar
3434d492b3
It turns out BuildAggrIvarLayout wasn't even using the shadow struct,
...
just computing it!
llvm-svn: 70779
2009-05-03 14:22:14 +00:00
Daniel Dunbar
94f46dc056
Lift common subexpression, remove dead "base" variable.
...
llvm-svn: 70778
2009-05-03 14:17:18 +00:00
Daniel Dunbar
15bd88860c
Factor out BuildAggrIvarRecordLayout routine.
...
llvm-svn: 70777
2009-05-03 14:10:34 +00:00
Daniel Dunbar
7abf83cc86
Lift out GetGCAttrTypeForType routine.
...
llvm-svn: 70776
2009-05-03 13:55:09 +00:00
Daniel Dunbar
7b89ace186
Add constructors for GC_IVAR and SKIP_SCAN, tighten up uses.
...
Lift up a size calculation and note some asymmetries.
llvm-svn: 70775
2009-05-03 13:44:42 +00:00
Daniel Dunbar
22007d345f
Normalize style, remove a dead assert.
...
llvm-svn: 70771
2009-05-03 13:32:01 +00:00
Daniel Dunbar
80b4eef686
Use ASTRecordLayout for computing ivar offsets instead of shadow
...
struct.
- We still need to do more lookup than necessary because ivars don't
live in a reasonable DeclContext.
- The only remaining client of the interface shadow struct is the
ivar layout bitmap.
llvm-svn: 70756
2009-05-03 13:15:50 +00:00
Daniel Dunbar
961202372f
Add a ComputeIvarBaseOffset overload taking an implementation
...
decl. Only this routine will be suitable for computing the offset of a
synthesized ivar.
- No functionality change.
llvm-svn: 70696
2009-05-03 12:57:56 +00:00
Daniel Dunbar
12119b959b
Compute Objective-C metadata size information from the record layout,
...
not the shadow structure.
llvm-svn: 70691
2009-05-03 10:46:44 +00:00
Chris Lattner
61af27860d
look at the right operand when increasing the size of an asm output,
...
this fixes http://llvm.org/bugs/show_bug.cgi?id=3373#c20
llvm-svn: 70685
2009-05-03 09:05:53 +00:00
Daniel Dunbar
ccf6183687
Remove unused argument.
...
llvm-svn: 70684
2009-05-03 08:56:52 +00:00
Daniel Dunbar
0cec95f86a
Coalesce the ivar offset calculation further.
...
llvm-svn: 70683
2009-05-03 08:55:17 +00:00
Chris Lattner
99837deeaf
don't shadow 'i'
...
llvm-svn: 70680
2009-05-03 08:38:58 +00:00
Chris Lattner
59c3a9cd54
add support for tying asm operands where the result is smaller than
...
the input. This is part of PR3373.
llvm-svn: 70677
2009-05-03 08:21:20 +00:00
Chris Lattner
10f221f321
implement support for asm outputs targetting non-simple lvalue destinations
...
like bitfields. incidentally llvm-gcc crashes on this sort of thing also. :)
llvm-svn: 70675
2009-05-03 07:53:25 +00:00
Daniel Dunbar
d09551a376
Use type from ivar instead of from shadow struct field.
...
- No functionality change.
llvm-svn: 70674
2009-05-03 07:52:00 +00:00
Chris Lattner
b65933eaa2
handle codegen of asms where a small input is tied to a large output.
...
llvm-svn: 70672
2009-05-03 07:27:51 +00:00
Chris Lattner
17769a34da
refactor some code to get the input/output constraint info before
...
processing the outputs, no functionality change.
llvm-svn: 70671
2009-05-03 07:05:00 +00:00
Chris Lattner
c6ad258a6b
When creating a dwarf record type for an objc interface, make sure to propagate
...
the runtime version number onto it, so that the debugger knows it's an objc
interface, not a C struct. rdar://6848435
llvm-svn: 70618
2009-05-02 01:13:16 +00:00
Chris Lattner
44f3ea7339
capture whether optimizations are enabled or not in debug info
...
llvm-svn: 70617
2009-05-02 01:04:13 +00:00
Chris Lattner
5912de15d0
encode the version of the objc runtime into the dwarf compile unit. rdar://6848435,
...
several other fixes coming.
llvm-svn: 70616
2009-05-02 01:00:04 +00:00
Anders Carlsson
4ac533dc90
We can now call member functions where the base is a pointer.
...
llvm-svn: 70579
2009-05-01 21:55:16 +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
Anders Carlsson
b4e463287e
Don't use indirect memory destinations for inline asm. Fixes 6841383.
...
llvm-svn: 70523
2009-05-01 00:16:04 +00:00
Fariborz Jahanian
e29b4f0785
Remove a warning when this file is compiled optimized.
...
llvm-svn: 70518
2009-04-30 23:08:58 +00:00
Fariborz Jahanian
18c435a17d
API for message dispatch of methods returning floats
...
to match gcc's closely.
llvm-svn: 70493
2009-04-30 16:31:11 +00:00
Eli Friedman
902fddd1cf
Fix for PR4108: be a bit looser with the casts that we accept in
...
constant initializers.
llvm-svn: 70483
2009-04-30 07:03:22 +00:00
Chris Lattner
b822fad20f
fix i128 to return in 2 64-bit registers (rax/rdx on x86-64)
...
llvm-svn: 70481
2009-04-30 06:22:07 +00:00
Chris Lattner
f122cef4df
initial support for __[u]int128_t, which should be basically
...
compatible with VC++ and GCC. The codegen/mangling angle hasn't
been fully ironed out yet. Note that we accept int128_t even in
32-bit mode, unlike gcc.
llvm-svn: 70464
2009-04-30 02:43:43 +00:00
Fariborz Jahanian
4b4ef86369
Undid setting of the flag for msg_Send for 32bit code gen.
...
It seems to effect code gen. Add a FIXME instead.
llvm-svn: 70423
2009-04-29 22:47:27 +00:00
Fariborz Jahanian
e55f8660be
Export lazy references of .objc_class_name of class names
...
referenced in a category implementation meta-data
(Next objc 32bit abi).
llvm-svn: 70407
2009-04-29 20:40:05 +00:00
Fariborz Jahanian
e27b929809
Type of msgSend message dispatch API is a vararg.
...
llvm-svn: 70404
2009-04-29 19:14:43 +00:00
Douglas Gregor
76fe50c654
Improve compatibility with GCC regarding inline semantics in GNU89
...
mode and in the presence of __gnu_inline__ attributes. This should fix
both PR3989 and PR4069.
As part of this, we now keep track of all of the attributes attached
to each declaration even after we've performed declaration
merging. This fixes PR3264.
llvm-svn: 70292
2009-04-28 06:37:30 +00:00
Devang Patel
df348f10b6
While generating debug info ignore unnamed fields.
...
llvm-svn: 70266
2009-04-27 22:40:36 +00:00
Daniel Dunbar
01910a50c4
x86-32 ABI: Fix crash on return of structure with flexible array
...
member.
Also, spell bitfield more consistently as bit-field.
llvm-svn: 70220
2009-04-27 18:31:32 +00:00
Sebastian Redl
a7b98a772c
Implement function-try-blocks. However, there's a very subtle bug that I can't track down.
...
llvm-svn: 70155
2009-04-26 20:35:05 +00:00
Eli Friedman
1c4a175aef
Remove getIntegerConstantExprValue in favor of using EvaluateAsInt.
...
llvm-svn: 70145
2009-04-26 19:19:15 +00:00
Chris Lattner
c16d476b30
pull operands names "[foo]" into ConstraintInfo.
...
llvm-svn: 70136
2009-04-26 17:57:12 +00:00
Chris Lattner
c3f4c7b1c5
pull the constraint string into the ConstraintInfo struct
...
instead of passing it around in addition to it.
llvm-svn: 70135
2009-04-26 17:19:08 +00:00
Chris Lattner
d9725f7041
change TargetInfo::ConstraintInfo to be a struct that contains
...
the enum along with some other data.
llvm-svn: 70114
2009-04-26 07:16:29 +00:00
Chris Lattner
f0b64d73a8
split ObjC and C++ Statements out into their own headers.
...
llvm-svn: 70105
2009-04-26 01:32:48 +00:00
Anders Carlsson
6f5c15688d
When calling the cleanup function specified by __attribute__((cleanup)), make sure to bitcast the argument so it has the same type as the first argument of the cleanup function. Fixes <rdar://problem/6827047>.
...
llvm-svn: 70098
2009-04-26 00:34:20 +00:00
Chris Lattner
c06ce0f710
"This fixes message sends to super in a way that both works with real code and passes the test in the test suite. It also fixes a crash when using recent versions of GNU libobjc and compiling modules that do not contain any constant strings but do contain a declaration of the constant string class and possible some other corner cases (thanks to Pete French for providing me with a test case for that one)."
...
Patch by David Chisnall!
llvm-svn: 70093
2009-04-25 23:19:45 +00:00
Eli Friedman
50322773b7
Minor simplification.
...
llvm-svn: 70091
2009-04-25 22:44:54 +00:00
Chris Lattner
a4185c543e
fix PR4067: [Linux kernel] cannot aggregate codegen stmtexpr as lvalue
...
llvm-svn: 70067
2009-04-25 19:35:26 +00:00
Daniel Dunbar
ef2ffbc390
Fix pointer addressing and array subscripting of Objective-C interface
...
types.
- I broke this in the switch to representing interfaces with opaque
types.
- <rdar://problem/6822660> clang crashes on subscript of interface in
32-bit mode
llvm-svn: 70009
2009-04-25 05:08:32 +00:00
Fariborz Jahanian
969bc68195
Minor refactoring. No intended change in behavior.
...
llvm-svn: 69988
2009-04-24 21:07:43 +00:00
Fariborz Jahanian
ce567657fd
Minor refactoring. No change in functionality.
...
llvm-svn: 69979
2009-04-24 17:15:27 +00:00
Fariborz Jahanian
a123b64218
Some code clean up of objc2's bitmap layout.
...
llvm-svn: 69970
2009-04-24 16:17:09 +00:00
Sanjiv Gupta
4742515771
Clang part of r69947. Reverting back 69574 as it is no longer needed.
...
llvm-svn: 69949
2009-04-24 02:40:57 +00:00
Douglas Gregor
89c8e000cf
Fix handling of C99 "extern inline" semantics when dealing with
...
multiple declarations of the function. Should fix PR3989 and
<rdar://problem/6818429>.
llvm-svn: 69905
2009-04-23 18:22:55 +00:00
Devang Patel
a6acb390e7
Handle corner case where clang-cc is invoked directly to compile preprocessed source file without -main-file-name. In this case, CDDebugInfo is not able identify correct main source file becase SM.isFromMainFile() returns true for locations from header files as well as locations from main source file.
...
This patch takes conservative approach by not emitting more then one compile unit with isMain bit set.
llvm-svn: 69902
2009-04-23 18:09:16 +00:00
Fariborz Jahanian
80672fce8f
Removed bunch of FIXMEs no longer needed.
...
llvm-svn: 69896
2009-04-23 16:27:20 +00:00
Daniel Dunbar
f0a8344bac
Mark IMAGE_INFO as constant on x86_64-darwin.
...
- This shouldn't change anything, we never actually access it, but
this is consistent with llvm-gcc (and 32-bit)
llvm-svn: 69880
2009-04-23 08:03:21 +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
7b0344f656
implement debug info for _Complex.
...
llvm-svn: 69873
2009-04-23 06:13:01 +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
22b0ada8cf
Use std::sort instead of qsort.
...
- Notably, there was a memory error here, SkipIvars does not have to
be the same size as IvarsInfo.
- Fariborz, please check.
llvm-svn: 69850
2009-04-23 01:29:05 +00:00
Douglas Gregor
29bd76fd04
Eliminate the three SmallVectors in ObjCImplDecl (for instance
...
methods, class methods, and property implementations) and instead
place all of these entities into the DeclContext.
This eliminates more linear walks when looking for class or instance
methods and should make PCH (de-)serialization of ObjCDecls trivial
(and lazy).
llvm-svn: 69849
2009-04-23 01:02:12 +00:00
Fariborz Jahanian
6df69867c3
ivar layout bitmap is alive!
...
llvm-svn: 69838
2009-04-22 23:00:43 +00:00
Daniel Dunbar
e4f25b706b
Reapply r69771, with updates & fixes:
...
Rework the shadow struct that is layed out for Objective-C classes.
- Superclasses are now always laid out in their shadow structure at
the first field.
- Prior to this, the entire class heirarchy was flattened into a
single structure which meant that alignment, padding, and bitfields
were incorrect (the ASTRecordLayout was correct however, which
meant our debug info didn't coincide with ivar offsets, for
example).
- This is still very suboptimal (for example, ivar are looked up
recursively, but I believe the ivar layout itself is now at least
close to correct.
- <rdar://problem/6773388> error: objc[29823]: layout bitmap sliding
backwards
llvm-svn: 69811
2009-04-22 17:43:55 +00:00
Daniel Dunbar
202f3dc5b3
Remove lookupFieldDeclFromIvar from ObjCIvarDecl interface.
...
- This is only used by CGObjCRuntime now.
llvm-svn: 69800
2009-04-22 12:00:04 +00:00
Daniel Dunbar
7d4e1c5e4a
Don't convert interface types (to structs) as part of CodeGenTypes.
...
- This has pros and cons, but for now the pros seem to significantly
outway the con.
The con is that we will always need to cast in the runtime
implementation to a struct type, if we wish to access an interface
directly.
The pros are:
- Avoid the cost of generating types which are used. Most
manipulation of Objective-C objects is done through messages, and
only the implementation of a class will directly access
memory. Previously, we would convert the type even if it only
appear as a function parameter, for example.
- We don't need to worry about incomplete types, and
UpdateCompletedType for interfaces is gone.
- It becomes easier to narrow the interface to the shadow struct for
Objective-C interfaces (so it can be eliminated).
Currently the runtimes still use the CodeGenTypes machinery to
generate the LLVM structure they need via ConvertTagDecl, but this can
eventually be replaced.
llvm-svn: 69797
2009-04-22 10:28:39 +00:00
Daniel Dunbar
7b4dfc8b78
Add CGObjCRuntime::GetConcreteClassStruct to encapsulate access to the
...
underlying llvm::StructType for an interface.
llvm-svn: 69796
2009-04-22 09:39:34 +00:00
Daniel Dunbar
83a66f78d2
Simplify.
...
llvm-svn: 69793
2009-04-22 08:50:59 +00:00
Daniel Dunbar
725dc2c5bb
Emit meta data using the Ivar, not a looked up FieldDecl.
...
llvm-svn: 69790
2009-04-22 08:22:17 +00:00
Daniel Dunbar
89623deca1
Use ComputeIvarBaseOffset instead of looking up by hand.
...
llvm-svn: 69789
2009-04-22 08:20:31 +00:00
Daniel Dunbar
9fd114d577
Merge ivar access amongst the three runtimes.
...
- For now, this means we are always doing the address computations by
hand instead of constructing a proper GEP. Right now, however, this
is less important than having fewer entry points to dealing with
Objective-C interface layout.
llvm-svn: 69787
2009-04-22 07:32:20 +00:00
Chris Lattner
43e6f8c08b
implement debug info support for id<proto> and interface<proto>
...
llvm-svn: 69784
2009-04-22 06:58:56 +00:00
Chris Lattner
ad8f750f71
ObjCQualifiedClass is dead, remove it.
...
llvm-svn: 69783
2009-04-22 06:50:37 +00:00
Daniel Dunbar
722f424178
Make ObjCInterfaceDecl's const in some more places.
...
llvm-svn: 69775
2009-04-22 05:08:15 +00:00
Daniel Dunbar
658ba85820
Revert r69771, I missed some (obvious) details. :/
...
llvm-svn: 69773
2009-04-22 04:39:47 +00:00
Daniel Dunbar
aefc2b9be3
Mark another TypeForDecl const and make getObjCInterfaceType's argument const.
...
llvm-svn: 69772
2009-04-22 04:34:53 +00:00
Daniel Dunbar
25b81ef847
Rework the shadow struct that is layed out for Objective-C classes.
...
- Superclasses are now always laid out their shadow structure at the
first field.
- Prior to this, the entire class heirarchy was flattened into a
single structure which meant that alignment, padding, and bitfields
weren't packed correctly (the ASTRecordLayout was correct however,
which meant our debug info didn't coincide with ivar offsets, for
example).
- This is still very suboptimal, but I believe the ivar layout itself
is now at least close to correct.
- <rdar://problem/6773388> error: objc[29823]: layout bitmap sliding
backwards
llvm-svn: 69771
2009-04-22 03:45:12 +00:00
Chris Lattner
2dfdb3ea94
move 64-bit abi functions to lazy model, everything is lazy now, yay.
...
llvm-svn: 69767
2009-04-22 02:53:24 +00:00
Chris Lattner
ce8754edac
remove the last of the non-lazy objc runtime functions for the 32-bit ABI,
...
7 left for 64-bit ABI.
llvm-svn: 69766
2009-04-22 02:44:54 +00:00
Chris Lattner
0a696a42fe
number of non-lazy runtime functions from 9 -> 4.
...
llvm-svn: 69765
2009-04-22 02:38:11 +00:00
Chris Lattner
095ac38f1c
make message send functions lazy, we're down from 14 non-lazy functions to 9.
...
llvm-svn: 69764
2009-04-22 02:32:31 +00:00
Chris Lattner
c6406dbf7f
move more EH stuff to being lazily created. An empty .m file now
...
produces just 14 dead "declares" in llvm ir instead of 19.
llvm-svn: 69763
2009-04-22 02:26:14 +00:00
Chris Lattner
a7c00b4c4c
make try/catch objc runtime functions be lazily generated.
...
rdar://6809612
llvm-svn: 69762
2009-04-22 02:15:23 +00:00
Chris Lattner
f8dc07369a
Fix some mishandling of the attr(gnu_inline) mode when used with
...
extern. Previously we would warn about it and ignore the attribute.
This is incorrect, it should be handled as a c89 "extern inline"
function. Many thanks to Matthieu Castet for pointing this out and
beating me over the head until I got it.
PR3988: extern inline function are not externally visible
llvm-svn: 69756
2009-04-22 00:03:30 +00:00
Chris Lattner
2f343dd5c8
fix PR4026: Clang can't codegen __func__ without implicit cast
...
llvm-svn: 69747
2009-04-21 23:00:09 +00:00
Daniel Dunbar
d1148a7f72
Make sure to mark the interface as completed when we see an
...
@implementation that closes a @class delcaration.
- I don't know how to make a test case for this, but this strengthens
the invariants that hold internally. The functionality change here
is the edit to SemaDeclObjC.cpp.
llvm-svn: 69728
2009-04-21 21:41:56 +00:00
Douglas Gregor
fa9ab53d95
Fix emission of static tentative definitions referenced from other static functions
...
llvm-svn: 69699
2009-04-21 19:28:58 +00:00
Fariborz Jahanian
f5fec02d0c
More objc2's ivar layout bitmap. No change in functionality.
...
llvm-svn: 69695
2009-04-21 18:33:06 +00:00
Chris Lattner
b534f6a601
don't bother emitting a zero byte memset at all. We used to get them
...
in cases like this:
typedef struct {
short instance;
char name[0];
} ATTR_LIST_ENTRY2;
void test() {
ATTR_LIST_ENTRY2 X = (ATTR_LIST_ENTRY2) { .instance = 7, };
}
While it is safe to emit them, it is pretty silly.
llvm-svn: 69687
2009-04-21 17:59:23 +00:00
Douglas Gregor
beecd58e21
Explictly track tentative definitions within Sema, then hand those
...
tentative definitions off to the ASTConsumer at the end of the
translation unit.
Eliminate CodeGen's internal tracking of tentative definitions, and
instead hook into ASTConsumer::CompleteTentativeDefinition. Also,
tweak the definition-deferal logic for C++, where there are no
tentative definitions.
Fixes <rdar://problem/6808352>, and will make it much easier for
precompiled headers to cope with tentative definitions in the future.
llvm-svn: 69681
2009-04-21 17:11:58 +00:00
Sanjiv Gupta
4c5dfd3c45
Pass and return aggregate types directly to function calls.
...
llvm-svn: 69668
2009-04-21 06:01:16 +00:00
Chris Lattner
a9aeea9f27
use of predefined identifiers like __func__ at global scope warn in sema,
...
but crashed codegen. Fix this to report the name of the llvm function.
This fixes rdar://6808051
llvm-svn: 69658
2009-04-21 04:41:23 +00:00
Daniel Dunbar
e000df6882
Remove unnused variable.
...
llvm-svn: 69650
2009-04-21 01:32:46 +00:00
Daniel Dunbar
9ebf9516af
Kill ASTContext::[gs]etFieldForDecl, instead we just lookup things
...
when we need them -- which is exactly what some code was already
doing!
- No intended functionality change.
llvm-svn: 69648
2009-04-21 01:19:28 +00:00
Daniel Dunbar
be9dae80b3
Remove LateBoundIVars() runtime interface, it is unused.
...
llvm-svn: 69641
2009-04-21 00:49:20 +00:00
Daniel Dunbar
e03f005d30
Assert on a few conditions that (I believe) should hold
...
w.r.t. ASTContext::[gs]etFieldDecl, and the Field argument to
EmitObjCValueForIvar).
llvm-svn: 69639
2009-04-21 00:41:40 +00:00
Fariborz Jahanian
80c9ce2c4a
ObjC2's Ivar bitmap layout work. No change in functionality.
...
llvm-svn: 69629
2009-04-20 22:03:45 +00:00
Daniel Dunbar
e3f5cfc0b8
Move countInheritedIvars to within striking distance of
...
GetClassSizeInfo
Reduce nesting in GetInterfaceDeclStructLayout.
Tweak some comments.
No functionality change.
llvm-svn: 69621
2009-04-20 20:18:54 +00:00
Chris Lattner
ddf6ca0355
the __gnuc_inline__ attribute is actually named __gnu_inline__,
...
PR4023
llvm-svn: 69618
2009-04-20 19:12:28 +00:00
Daniel Dunbar
be1f26df5d
Inline GetFirstIvarInRecord into sole caller.
...
- No functionality change.
llvm-svn: 69582
2009-04-20 07:18:49 +00:00
Daniel Dunbar
75e909f5e0
Set a bit in IMAGE_INFO to indicate that we don't contain any
...
@synthesized ivars for superclasses.
- <rdar://problem/6806371> [clang] Mark code without miscompiled
@synthesized properties
llvm-svn: 69581
2009-04-20 07:11:47 +00:00
Daniel Dunbar
f5c18461e3
Lift out GetNamedIvarList.
...
Drop uses of GetFirstInvarInRecord, instead we lookup the ivars we
know are in the record.
- This is somewhat less efficient, but I need to detangle this code
first...
llvm-svn: 69579
2009-04-20 06:54:31 +00:00
Daniel Dunbar
caec0238bc
Don't emit ivar offsets for unnamed bit fields.
...
Also, added assertion that the field matches what would be looked up.
llvm-svn: 69572
2009-04-20 05:53:40 +00:00
Eli Friedman
bc633beda4
PR3247: Handle a couple of cases where we weren't emitting VLA sizes (and
...
subsequently crashed).
llvm-svn: 69567
2009-04-20 03:54:15 +00:00
Eli Friedman
3253e189c6
PR3248: Make sure the evaluate the operand of a sizeof when it has a VLA type.
...
Adapted from patch by Tim Northover.
llvm-svn: 69566
2009-04-20 03:21:44 +00:00
Daniel Dunbar
5d5dbb1754
Remove non-const form of lookupFieldDeclForIvar.
...
llvm-svn: 69563
2009-04-20 00:37:55 +00:00
Daniel Dunbar
ae03226bc6
Comment fixes.
...
llvm-svn: 69562
2009-04-20 00:33:43 +00:00
Daniel Dunbar
554fd79b38
Lift GetClassSizeInfo out of GenerateClass, add a FIXME.
...
- No functionality change.
llvm-svn: 69561
2009-04-19 23:41:48 +00:00
Eli Friedman
4f856744e5
PR3853: Add CodeGen support for __thread.
...
llvm-svn: 69545
2009-04-19 21:05:03 +00:00
Eli Friedman
fe92e701aa
Silence gcc warning.
...
llvm-svn: 69541
2009-04-19 20:21:56 +00:00
Chris Lattner
5f65cc8215
silence a warning, it isn't clear what the right answer is here,
...
will talk to steve.
llvm-svn: 69519
2009-04-19 06:59:18 +00:00
Chris Lattner
96adcd5e74
silence a warning, I need to talk to Devang about this code.
...
llvm-svn: 69517
2009-04-19 06:50:29 +00:00
Chris Lattner
b433b279f3
Fix rdar://6804402 - crash on objc implementations declared with
...
@class but no implementation. This was broken in all 3 runtime
impls.
llvm-svn: 69512
2009-04-19 06:02:28 +00:00
Daniel Dunbar
9a7a78b0ae
Fix bug in computation of ivar offsets for (adjacent) bitfields.
...
- The confusing IRgen bitfield interface is partly to blame here;
fixing the functional error for now, cleanups to the interface to
follow.
llvm-svn: 69503
2009-04-19 02:03:42 +00:00
Chris Lattner
cd3bb8f7e4
revert david's patch, which causes a testsuite failure.
...
llvm-svn: 69501
2009-04-19 01:33:30 +00:00
Daniel Dunbar
bf90b33665
Reuse ObjcIvarOffsetVariable instead of duplicating code.
...
- No functionality change (but added a FIXME).
llvm-svn: 69496
2009-04-19 00:44:02 +00:00
Daniel Dunbar
a106052090
Remove some unnecessary complexity.
...
- No functionality change.
llvm-svn: 69495
2009-04-19 00:31:15 +00:00
Chris Lattner
c1b96c3590
"This patch fixes message sends to super in class methods for the GNU runtime (currently an instance method lookup is being performed)."
...
Patch by David Chisnall!
llvm-svn: 69493
2009-04-18 23:12:40 +00:00
Anders Carlsson
623dcae172
Use EmitCallArgs in EmitObjCMessageExpr.
...
llvm-svn: 69471
2009-04-18 20:29:27 +00:00
Anders Carlsson
603d6aff8b
Make CodeGenFunction::EmitCallArgs a template function that takes a generic "Type Info" parameter. The type info parameter knows how to iterate over its arguments.
...
llvm-svn: 69469
2009-04-18 20:20:22 +00:00
Daniel Dunbar
41595d43d5
Use getAsPointerType instead of using getCanonicalType directly.
...
- <rdar://problem/6803995>
llvm-svn: 69435
2009-04-18 08:54:40 +00:00
Daniel Dunbar
508a7dda4a
Fix a bug found by inspection, class/meta references could be emitted
...
into the wrong section (they shared the same lookup table).
llvm-svn: 69433
2009-04-18 08:51:00 +00:00
Chris Lattner
c2e868fd14
fix incorrect lowering of __builtin_ia32_shufpd, rdar://6803924
...
llvm-svn: 69428
2009-04-18 07:01:54 +00:00
Douglas Gregor
e3dcb2ddd1
FunctionDecl::getBody() is getting an ASTContext argument for use in
...
lazy PCH deserialization. Propagate that argument wherever it needs to
be. No functionality change, except that I've tightened up a few PCH
tests in preparation.
llvm-svn: 69406
2009-04-18 00:02:19 +00:00
Chris Lattner
6fdd57cba8
fix a crash compiling code with its own definition of objc_assign_weak.
...
rdar://6800430
llvm-svn: 69392
2009-04-17 22:12:36 +00:00
Devang Patel
12f0dea922
Use PresumedLoc to record line number in debug info entries.
...
llvm-svn: 69389
2009-04-17 21:35:15 +00:00
Daniel Dunbar
66b13dac0a
Don't put msgrefs in used globals (in particular, we don't want
...
no-dead-strip set on them).
llvm-svn: 69388
2009-04-17 21:10:58 +00:00
Devang Patel
75009454e3
Appropriately set file name and directory name in debug info compile units.
...
llvm-svn: 69387
2009-04-17 21:06:59 +00:00
Chris Lattner
10dae30049
Fix rdar://6800926 - crash compiling non-fragile _Bool bitfield ivar,
...
the functional change here is changing ConvertType -> ConvertTypeForMem
so that we handle i1 fields properly as memory.
llvm-svn: 69361
2009-04-17 17:46:19 +00:00
Chris Lattner
c4688d21f7
tidy some code.
...
llvm-svn: 69360
2009-04-17 17:44:48 +00:00
Anders Carlsson
eaa28f7e18
Add support for generating (very basic) C++ destructors. These aren't called by anything yet.
...
llvm-svn: 69343
2009-04-17 01:58:57 +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
Anders Carlsson
b7f8f594f3
Implement basic code generation of constructor calls. We can now compile:
...
struct S {
S(int, int);
};
void f() {
S s(10, 10);
}
llvm-svn: 69330
2009-04-17 00:06:03 +00:00
Anders Carlsson
e8eeffdf16
Add GetAddrOfCXXConstructor and use it.
...
llvm-svn: 69328
2009-04-16 23:57:24 +00:00
Fariborz Jahanian
68c4c61be8
Removed a no longer needed FIXME comment.
...
llvm-svn: 69315
2009-04-16 21:49:16 +00:00
Fariborz Jahanian
bcf548760e
Category method synbols must be qualified by gategory name to
...
match gcc's.
llvm-svn: 69305
2009-04-16 18:34:20 +00:00
Sebastian Redl
1a99f441e6
Fix a crash bug when comparing overload quality of conversion operators with conversion constructors.
...
Remove an atrocious amount of trailing whitespace in the overloaded operator mangler. Sorry, couldn't help myself.
Change the DeclType parameter of Sema::CheckReferenceInit to be passed by value instead of reference. It wasn't changed anywhere.
Let the parser handle C++'s irregular grammar around assignment-expression and conditional-expression.
And finally, the reason for all this stuff: implement C++ semantics for the conditional operator. The implementation is complete except for determining lvalueness.
llvm-svn: 69299
2009-04-16 17:51:27 +00:00
Daniel Dunbar
426b5cf16a
Ensure that the most recent declaration of a tentative definition wins
...
when generating a common definition.
llvm-svn: 69287
2009-04-16 15:34:14 +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
Daniel Dunbar
7dd749e6fd
Defer generation of tentative definitions.
...
- PR3980.
- <rdar://problem/6762287> [irgen] crash when generating tentative
definition of incomplete structure
- This also avoids creating common definitions for things which are
later overwritten.
- XFAIL'ed external-defs.c, it isn't completing types properly yet.
llvm-svn: 69231
2009-04-15 22:08:45 +00:00
Devang Patel
9074ed8c6a
Set DebugInfo at the beginning of GenerateBlockFunction().
...
llvm-svn: 69228
2009-04-15 21:51:44 +00:00
Anders Carlsson
617482c666
Actually generate code for the simple constructors we know we can generate code for.
...
llvm-svn: 69222
2009-04-15 21:02:13 +00:00
Daniel Dunbar
4b68d26a93
Don't use \01 in symbol name if unnecessary.
...
- This was particularly bad since I fixed one instance of this name
and not another, meaning we got an LLVM module with the same
effective name in two different globals!
llvm-svn: 69205
2009-04-15 19:52:32 +00:00
Daniel Dunbar
24645c9ff4
Fix alignment on obj_msgrefs to match llvm-gcc.
...
llvm-svn: 69199
2009-04-15 19:04:46 +00:00
Daniel Dunbar
e60aa05d34
Add test case for superrefs section (and make spacing consistent).
...
llvm-svn: 69198
2009-04-15 19:03:14 +00:00
Fariborz Jahanian
f5e8ddd550
__objc_superrefs belongs to __DATA segment.
...
llvm-svn: 69170
2009-04-15 16:31:36 +00:00
Anders Carlsson
f747524819
Start attempting to generate code for C++ ctors.
...
llvm-svn: 69168
2009-04-15 15:55:24 +00:00
Anders Carlsson
e4c40c8baf
Add support for mangling C++ constructors. Review appreciated (I'm looking at you, Doug)
...
llvm-svn: 69150
2009-04-15 05:36:58 +00:00
Anders Carlsson
375d6beb6c
Add CGCXX.h with ctor/dtor type enumerations. No functionality change.
...
llvm-svn: 69137
2009-04-15 04:36:55 +00:00
Anders Carlsson
c483bd0724
Simplify CodeGenFunction::GenerateCode.
...
llvm-svn: 69134
2009-04-15 04:10:19 +00:00
Daniel Dunbar
b25452a98e
Tweaks to Objective-C metadata (32 & 64-bit) to match llvm-gcc.
...
- Set alignment on property lists.
- 32-bit:
o Set section on property lists.
o Fix section name for category class methods.
o Fix symbol name for property lists.
o Fix section name for class method.
o Set alignment and section on class extension structure.
o Set alignment on a number of things: instance variables, methods,
method descriptions, the symbols structure.
- 64-bit:
o Fix section flags for protocol list.
I doubt most of these were problems in practice, but it is nice to
match llvm-gcc.
llvm-svn: 69132
2009-04-15 02:56:18 +00:00
Daniel Dunbar
3241fae46c
Set alignment on __cstring metadata variables to 1 (matching
...
llvm-gcc).
llvm-svn: 69097
2009-04-14 23:14:47 +00:00
Daniel Dunbar
729df96bf5
Avoid use of magic \01 prefix when unneeded.
...
llvm-svn: 69093
2009-04-14 22:44:26 +00:00
Daniel Dunbar
346892aafc
Comment fix.
...
llvm-svn: 69091
2009-04-14 22:41:13 +00:00
Chris Lattner
28549de12c
remove dead enum
...
llvm-svn: 69070
2009-04-14 20:30:29 +00:00
Chris Lattner
bae0e68930
Fix PR3988: extern inline functions get strong symbol definitions in
...
C99 mode. This is a regression from an earlier patch of mine.
This also simplifies the linkage enums a bit.
llvm-svn: 69069
2009-04-14 20:25:53 +00:00
Fariborz Jahanian
899e7eb6c7
Do not dead code strip global meta-data objects.
...
This will match gcc's behavior in the arena.
llvm-svn: 69061
2009-04-14 18:41:56 +00:00
Mike Stump
d73e4419f5
Fixup whitespacing.
...
llvm-svn: 69055
2009-04-14 18:24:37 +00:00
Daniel Dunbar
4527d30c3d
Fix comment.
...
llvm-svn: 69053
2009-04-14 17:42:51 +00:00
Anders Carlsson
a5d077df73
Support code generation of 'this' exprs
...
llvm-svn: 69050
2009-04-14 16:58:56 +00:00
Chris Lattner
02e987f3e8
implement codegen support for __attribute((__gnuc_inline__)),
...
pulling some attribute munging stuff into GetLinkageForFunction.
This should fix PR3986
llvm-svn: 69045
2009-04-14 16:44:36 +00:00
Daniel Dunbar
389325715b
Refactor how attributes are set on values.
...
- Pull out SetCommonAttributes, which handles the things common to
aliases, methods, functions, and variables.
- Pull out SetLLVMFunctionAttributesForDefinition, which handles the
LLVM attributes which we only want to apply to a definition (like
noinline and alwaysinline).
- Kill SetGVDeclarationAttributes (inlined into SetFunctionAttributes
and specialized).
- Kill SetFunctionAttributesForDefinition (inlined into sole caller).
- Inline SetGVDefinitionAttributes into SetMethodAttributes and
specialize.
- Rename SetGVDefinitionAttributes to SetFunctionDefinitionAttributes.
This is supposed to be a no functionality change commit, but I may
have made a mistake.
llvm-svn: 69036
2009-04-14 08:05:55 +00:00
Daniel Dunbar
81a3f1bdf3
Split SetGlobalValueAttributes into definition/declaration halves.
...
- No functionality change.
llvm-svn: 69035
2009-04-14 07:19:20 +00:00
Daniel Dunbar
aeddffc99d
Rename (one) SetFunctionAttributes to SetLLVMFunctionAttributes to
...
disambiguate it.
- No functionality change.
llvm-svn: 69034
2009-04-14 07:08:30 +00:00
Daniel Dunbar
64a41cb39e
Reduce indentation, no functionality change.
...
llvm-svn: 69033
2009-04-14 07:02:17 +00:00
Chris Lattner
92028dad66
defer emission of always_inline, extern_inline, and inline functions (when
...
not in c89 mode).
llvm-svn: 69032
2009-04-14 06:44:48 +00:00
Chris Lattner
169a5c963f
give always_inline functions internal linkage. If they cannot be
...
inlined for some reason, then we don't want a strong or even weak
definition.
llvm-svn: 69031
2009-04-14 06:32:05 +00:00
Chris Lattner
256c9507c8
set the linkage of an inline function according to its language rules.
...
llvm-svn: 69030
2009-04-14 06:27:57 +00:00
Daniel Dunbar
29eff88fc8
Add a comment on SetGlobalValueAttributes.
...
llvm-svn: 69029
2009-04-14 06:19:49 +00:00
Chris Lattner
3e031f4121
add a new enum type for linkage, no functionality change.
...
llvm-svn: 69028
2009-04-14 06:04:17 +00:00
Daniel Dunbar
f5f359fb73
Clean up handling of visibility.
...
llvm-svn: 69027
2009-04-14 06:00:08 +00:00
Chris Lattner
73920ce565
reduce indentation, no functionality change.
...
llvm-svn: 69026
2009-04-14 05:33:52 +00:00
Chris Lattner
6a0f907a5e
do not set visibility on "private" or "available externally" linkage objects.
...
llvm-svn: 69025
2009-04-14 05:27:13 +00:00
Mike Stump
4c0dc0e48a
Use hasAttr instead of getAttr for conditionals.
...
llvm-svn: 69021
2009-04-14 02:45:29 +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
Mike Stump
ca5ae66122
Fixup CodeGen for __weak __block variables. Radar 6756266
...
llvm-svn: 69010
2009-04-14 00:57:29 +00:00
Eli Friedman
20bb5e02a5
Minor work related to removing the assumption that value initialization
...
implies an all-zero bit pattern.
llvm-svn: 68994
2009-04-13 21:47:26 +00:00
Eli Friedman
c08711e840
Minor simplification.
...
llvm-svn: 68992
2009-04-13 21:41:57 +00:00
Daniel Dunbar
4184ac847f
Update to use hasAttr() instead of getAttr().
...
- No functionality change.
llvm-svn: 68987
2009-04-13 21:08:27 +00:00
Steve Naroff
fb46e8658c
Move/update recent FIXME (wrt UTF-8 checking for ObjC @-strings).
...
llvm-svn: 68982
2009-04-13 20:26:29 +00:00
Steve Naroff
84073ec51f
Fixed crasher in <rdar://problem/6780904> [irgen] Assertion failed: (Result == conversionOK && "UTF-8 to UTF-16 conversion failed"), function GetAddrOfConstantCFString, file CodeGenModule.cpp, line 1063.
...
Still a diagnostic related FIXME (will discuss with Daniel/Fariborz offline).
llvm-svn: 68975
2009-04-13 19:08:08 +00:00
Anders Carlsson
1235bbce7e
Use the new guard variable mangling function and get rid of the old code.
...
llvm-svn: 68971
2009-04-13 18:03:33 +00:00
Anders Carlsson
0c08f6fdde
Add support for mangling guard variables.
...
llvm-svn: 68969
2009-04-13 18:02:10 +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
Anders Carlsson
d8281f1589
Don't mangle variables that are at translation unit scope.
...
llvm-svn: 68853
2009-04-11 01:19:45 +00:00
Anders Carlsson
d8e39bbb84
Add support for generating reference initialization code.
...
llvm-svn: 68852
2009-04-11 01:08:03 +00:00
Mike Stump
d352fd3699
Fixup copy/dispose helpers for Objective-C. Radar 6756504
...
llvm-svn: 68837
2009-04-10 23:09:55 +00:00
Anders Carlsson
7f96b360f2
Remove asserts that weren't really useful, and that would fire in case the CleanupEntries vector needed to be reallocated.
...
llvm-svn: 68835
2009-04-10 22:49:13 +00:00
Daniel Dunbar
8c920c9220
Don't set both readnone and readonly.
...
llvm-svn: 68833
2009-04-10 22:14:52 +00:00
Daniel Dunbar
d272cca527
Internal variables could mistakenly have "hidden" visibility when
...
their emission was deferred.
- <rdar://problem/6775234> variables with internal linkage should not
be exposed with -fvisibility=hidden.
llvm-svn: 68818
2009-04-10 20:26:50 +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
Fariborz Jahanian
464423dce4
Patch to generate meta-data for prtocol used
...
in @protocol expression.
llvm-svn: 68806
2009-04-10 18:47:34 +00:00
Anders Carlsson
6ef4ea499f
Rename variables to avoid conflict.
...
llvm-svn: 68764
2009-04-10 04:59:59 +00:00
Chris Lattner
6bc4aaa2eb
Make messages consistent.
...
llvm-svn: 68756
2009-04-10 00:37:08 +00:00
Chris Lattner
5286e774ee
reject codegen of __thread variables as unimplemented, rdar://6775265
...
llvm-svn: 68755
2009-04-10 00:35:59 +00:00
Douglas Gregor
bcced4ec31
Propagate the ASTContext to various AST traversal and lookup functions.
...
No functionality change (really).
llvm-svn: 68726
2009-04-09 21:40:53 +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
60ce3fe140
Add code for emitting call arguments (not used yet).
...
llvm-svn: 68639
2009-04-08 20:47:54 +00:00
Anders Carlsson
03a409feda
We weren't generating correct code for calls to variadic member functions.
...
llvm-svn: 68635
2009-04-08 20:31:57 +00:00
Devang Patel
2ac33a08d5
Use presumed location to get line number info.
...
llvm-svn: 68630
2009-04-08 19:47:04 +00:00
Daniel Dunbar
d92123fd2a
Make sure value is initialized when built w/o asserts.
...
llvm-svn: 68615
2009-04-08 16:23:09 +00:00
Daniel Dunbar
3b358a3d83
Make debug info work when using -save-temps.
...
- This is pretty ugly, but the most obvious solution. Chime in if you
have a nicer one.
- The problem is that with -save-temps, clang-cc has no idea what the
name of the original input file is. However, the user expects to be
able to set breakpoints based on the input file name.
- We support this by providing a new option -main-file-name (similar
to -dumpbase used by gcc) which allows the driver to pass in the
original file name.
- <rdar://problem/6753383> building with clang using --save-temps
gets the compile unit name from the .i file...
llvm-svn: 68595
2009-04-08 05:11:16 +00:00
Anders Carlsson
80f97ab08f
Add a destination type argument to EmitConstantExpr. This will be used for when the destination has a reference type. (No functionality change yet)
...
llvm-svn: 68593
2009-04-08 04:48:15 +00:00
Daniel Dunbar
8f28d01126
Implementation definition of interfaces with __objc_exception attribute.
...
- Complete <rdar://problem/6635883> Support __objc_exception__
attribute
llvm-svn: 68591
2009-04-08 04:21:03 +00:00
Sanjiv Gupta
562d68e8db
Pointer width on targets like PIC16 is 16-bit, while the valid index size to GEP is only 32 or 64. So promote index to 32 in such cases.
...
llvm-svn: 68590
2009-04-08 04:16:39 +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
Daniel Dunbar
ea10ab668f
Visibility attributes should only be set on definition.
...
llvm-svn: 68561
2009-04-07 22:36:33 +00:00
Anders Carlsson
5f50c651e9
Shuffle some call code around. No functionality change.
...
llvm-svn: 68557
2009-04-07 22:10:22 +00:00
Fariborz Jahanian
57eb2e021e
Propagte -fvisibility to objc2's class symbols.
...
llvm-svn: 68543
2009-04-07 20:26:30 +00:00
Anders Carlsson
d8db853243
Remove some dead code.
...
llvm-svn: 68532
2009-04-07 18:53:02 +00:00
Daniel Dunbar
d7beeea228
Handle use side of __objc_exception__ attribute; when using an
...
exception with this attribute we don't need to emit a weak definition
for the exception type information.
llvm-svn: 68513
2009-04-07 06:43:45 +00:00
Daniel Dunbar
15894b791b
Various fixes to symbols used for Obj-C x86_64 metadata.
...
- Changed method names to match gcc (categories names still aren't
mangled in).
- Expose correct name for class and metadata symbols (although
-fvisibility=hidden isn't yet correct).
- Remove several things from llvm.used that didn't need to be there
(I suspect this can still be trimmed).
- Don't use asm-prefix extension for _objc_empty_{cache,vtable} (not
needed).
- Hide EH type class info with -fvisibility=hidden
- Change setGlobal[Option]Visibility to not change the visibility of
functions with internal linkage.
llvm-svn: 68510
2009-04-07 05:48:37 +00:00
Daniel Dunbar
4fab57ddea
Implement __sync_{add,sub,and,or,xor}_and_fetch and
...
__sync_bool_compare_and_swap.
- <rdar://problem/6762223> [sema/irgen] support
__sync_bool_compare_and_swap and __sync_add_and_fetch
llvm-svn: 68482
2009-04-07 00:55:51 +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
Fariborz Jahanian
bc3c77b881
Fixed visibility issues related to objc2's synthesized
...
ivars.
llvm-svn: 68453
2009-04-06 18:30:00 +00:00
Anders Carlsson
6f811f149b
Add a getFunctionInfo that takes a BlockPointerType.
...
llvm-svn: 68452
2009-04-06 18:05:26 +00:00
Anders Carlsson
2266e244b5
Simplify C++ member function calls.
...
llvm-svn: 68451
2009-04-06 17:45:20 +00:00
Chris Lattner
dcceee734c
Fix a couple of cases where Constant* pointers can dangle in
...
ObjCNonFragileABITypesHelper by converting them to dynamic
getters. This fixes a crash on rdar://6757213. The others
should be converted over as well.
llvm-svn: 68445
2009-04-06 16:53:45 +00:00
Anders Carlsson
468fa6366b
Add some basic support for generating C++ member functions.
...
llvm-svn: 68425
2009-04-04 20:47:02 +00:00
Anton Korobeynikov
c847824e8e
Basic support for regparm codegen
...
llvm-svn: 68414
2009-04-04 00:49:24 +00:00
Anders Carlsson
e5fd6f2227
Add support for calling C++ member functions.
...
llvm-svn: 68412
2009-04-03 22:50:24 +00:00
Anders Carlsson
b15b55c2d0
Add a getFunctionInfo that takes a CXXMethodDecl.
...
llvm-svn: 68411
2009-04-03 22:48:58 +00:00
Steve Naroff
55a719835d
Add a comment/FIXME so Eli can sleep better:-))
...
llvm-svn: 68379
2009-04-03 09:44:50 +00:00
Fariborz Jahanian
befc9dfbff
Implement -fvisibility.
...
llvm-svn: 68369
2009-04-03 03:28:57 +00:00
Daniel Dunbar
fd6cfcffa2
Add target hook for setting symbol prefix and section of unicode
...
string literals.
llvm-svn: 68363
2009-04-03 00:57:44 +00:00
Fariborz Jahanian
38a5c9650e
Fix up lookup rules for properties declared in
...
objc's continuation class.
llvm-svn: 68339
2009-04-02 18:44:20 +00:00
Mike Stump
d3e3885f2d
Remove -ftrapu.
...
llvm-svn: 68330
2009-04-02 18:15:54 +00:00
Sanjiv Gupta
639f2d92f8
Don't use static globals for params as it confuses the optimzer that their values are never being used in the function.
...
llvm-svn: 68328
2009-04-02 17:51:27 +00:00
Anders Carlsson
4eca109941
Implement mangling of declarations inside functions.
...
llvm-svn: 68321
2009-04-02 16:24:45 +00:00
Anders Carlsson
f2125a02db
Mangle VarDecls correctly.
...
llvm-svn: 68320
2009-04-02 16:05:20 +00:00
Anders Carlsson
810679c37a
Move the function decl mangling code out into its own function. No functionality change.
...
llvm-svn: 68319
2009-04-02 15:51:53 +00:00
Anders Carlsson
cbaeb9e633
Emit code for linkage specifications.
...
llvm-svn: 68300
2009-04-02 05:55:18 +00:00
Anders Carlsson
f7e01ffa4a
When compiling C++ code, always mangle the names of static block var decls.
...
llvm-svn: 68280
2009-04-02 03:29:47 +00:00
Mike Stump
40968598c7
Fixup -ftrapv to be more gcc compatible. -ftrapu (for want of a
...
better name) is the option that SmallTalk can use to intercept all
overflows, including unsigned. I added some testcases so we don't
break anything.
Also included is another patch from David for += and friends.
llvm-svn: 68267
2009-04-02 01:03:55 +00:00
Steve Naroff
8d816d6cb5
CodeGenModule::GetAddrOfConstantCFString():
...
- Finish up support for converting UTF8->UTF16 to support ObjC @"string" constants.
Remove warning from CheckObjCString.
As the FIXME in the test case indicates, I still have a bug to work out (apparently with \u handling).
llvm-svn: 68245
2009-04-01 21:16:31 +00:00
Mike Stump
0c61b7322a
Add -ftrapv support, patch from David Chisnall; well all except the
...
clang option code that is and two bug fixes.
llvm-svn: 68240
2009-04-01 20:28:16 +00:00
Fariborz Jahanian
c2d5618083
Fixes a problem where the compiler is reporting the wrong size to the Gnu
...
runtime on 64-bit architectures.
Patch by David Chisnall
llvm-svn: 68238
2009-04-01 19:49:42 +00:00
Fariborz Jahanian
78be1651e2
Nonfragile ivar synthesis with property is in a continuation
...
class.
llvm-svn: 68234
2009-04-01 19:37:34 +00:00
Douglas Gregor
b4b81d8ab1
Revert r68221, -ftrapv support, which causes several regressions in
...
Clang's test suite.
llvm-svn: 68230
2009-04-01 18:59:55 +00:00
Mike Stump
fbc8c132ba
Add -ftrapv support, patch from David Chisnall; well all except the
...
clang option code that is.
llvm-svn: 68221
2009-04-01 18:19:33 +00:00