Daniel Dunbar
c46a079957
Fix declaration of obc_enumerationMutation function, for GNU runtime.
...
llvm-svn: 76959
2009-07-24 07:40:24 +00:00
Anders Carlsson
6e853bf2b7
Get rid of the size parameter to AppendField. No functionality change.
...
llvm-svn: 76931
2009-07-24 02:45:50 +00:00
Daniel Dunbar
91ade14197
Output UTF-16 string literals independent of host byte order.
...
- Steve, can you take a look at this? It seems like this code should live
elsewhere, and there is a FIXME about having Sema validates the UTF-8 to
UTF-16 conversion.
llvm-svn: 76915
2009-07-23 23:41:22 +00:00
Daniel Dunbar
64509b2765
Factor out map lookup for CFString constants.
...
llvm-svn: 76908
2009-07-23 22:52:48 +00:00
Anders Carlsson
085395426c
Don't just store the field/bit field info one field, do it for all fields in the union.
...
llvm-svn: 76907
2009-07-23 22:52:34 +00:00
Anders Carlsson
e2accf4404
Fix another thinko.
...
llvm-svn: 76903
2009-07-23 21:52:03 +00:00
Anders Carlsson
516e5e7835
Correct a thinko in bitfield layout code. Fixes PR4611.
...
llvm-svn: 76898
2009-07-23 21:16:33 +00:00
Daniel Dunbar
2a5b83c7e6
Simplify, NFC.
...
llvm-svn: 76897
2009-07-23 20:38:28 +00:00
Daniel Dunbar
635d481de0
Simplify.
...
llvm-svn: 76885
2009-07-23 17:33:49 +00:00
Anders Carlsson
d78fc89fcb
We don't need to keep track of the packed alignment, just whether the struct is packed or not. Fixes PR4610.
...
llvm-svn: 76884
2009-07-23 17:24:40 +00:00
Anders Carlsson
8af896c10a
Move the LLVM field number for bit fields into the BitFieldInfo structure, since it's meaning is completely different than for non-bit fields.
...
llvm-svn: 76882
2009-07-23 17:01:21 +00:00
Douglas Gregor
2aff97c9e6
Unbreak the CMake build
...
llvm-svn: 76878
2009-07-23 15:15:06 +00:00
Daniel Dunbar
7c02cf609d
Shield clang from LLVM API changes, until the dust settles.
...
llvm-svn: 76862
2009-07-23 05:30:36 +00:00
Anders Carlsson
f55922b8b8
Set field info for unions.
...
llvm-svn: 76856
2009-07-23 04:59:05 +00:00
Anders Carlsson
718a89a501
Use arrays as union padding. Also, since the resulting struct will always contain a single element and either a single i8 element or an array of i8s, there's no reason to use a packed struct.
...
llvm-svn: 76854
2009-07-23 04:50:01 +00:00
Anders Carlsson
f814ee6003
Handle zero width bit fields in unions correctly (by ignoring them).
...
llvm-svn: 76847
2009-07-23 04:00:39 +00:00
Anders Carlsson
697f65943d
Implement union layout support.
...
llvm-svn: 76846
2009-07-23 03:43:54 +00:00
Anders Carlsson
307846fe67
Check in CGRecordLayoutBuilder which is a reimplementation of the record layout code. (Yay, no more packed structs unless absolutely necessary). We currently don't use the layouts being built but that will change when the new code is mature enough :)
...
llvm-svn: 76845
2009-07-23 03:17:50 +00:00
Daniel Dunbar
a244814e6f
These IRgen improvements have been done.
...
Technically we could still do a bit more to avoid deferred generation of statics
which we know are used, but I seriously doubt this is important.
llvm-svn: 76844
2009-07-23 03:03:07 +00:00
Devang Patel
06cceef545
Use DICompositeType->replaceAllUsesWith().
...
This requires llvm rev. 76769 or higher.
llvm-svn: 76770
2009-07-22 18:57:00 +00:00
Steve Naroff
3de6b70730
Fix a couple recent ABI regressions noticed during code review (fallout from the ObjC type system rewrite).
...
It's unfortunate that the mangling includes the low-level structs. Nevertheless, we need this for binary compatibility with GCC.
llvm-svn: 76755
2009-07-22 17:14:51 +00:00
Eli Friedman
5ac69057c0
Make vectorized floating-point comparisons work without crashing.
...
llvm-svn: 76726
2009-07-22 06:07:16 +00:00
Mon P Wang
acedf7768f
Preserve address space information through member accesses, e.g.,
...
__attribute__((address_space(1))) struct {int arr[ 3 ]; } *p1;
... = p1->arr[2]; // load from address space 1
llvm-svn: 76717
2009-07-22 03:08:17 +00:00
Owen Anderson
a265a3876c
Update for LLVM API change.
...
llvm-svn: 76599
2009-07-21 18:06:41 +00:00
Owen Anderson
f319a7d6e7
Update for LLVM API change.
...
llvm-svn: 76534
2009-07-21 02:57:15 +00:00
Fariborz Jahanian
83381cc9a6
Move EmitCtorPrologue to CGCXX. Add an assert and FIXMEs.
...
llvm-svn: 76498
2009-07-20 23:18:55 +00:00
Fariborz Jahanian
127059c7ec
Early ir-gen for constructor prologue. This is on going.
...
llvm-svn: 76493
2009-07-20 22:35:22 +00:00
Mike Stump
94e12450aa
Remove an apparently unused header.
...
llvm-svn: 76473
2009-07-20 21:17:53 +00:00
Daniel Dunbar
ea3060a9e5
Catch another trivial case where we can avoid emitting a separate return blcok.
...
llvm-svn: 76365
2009-07-19 08:24:34 +00:00
Daniel Dunbar
c3ab4c6c98
Detect when the current generation point is unreachable after emitting
...
expressions.
- This generally catches the important case of noreturn functions.
- With the last two changes, we are down to 152 unreachable blocks emitted on
403.gcc, vs the 1805 we started with.
llvm-svn: 76364
2009-07-19 08:23:12 +00:00
Daniel Dunbar
669521c97c
Fix thinko.
...
llvm-svn: 76362
2009-07-19 07:03:11 +00:00
Daniel Dunbar
b6adc43f6e
Avoid generation of dead code in a few more situations.
...
- Emit variable declarations as "simple", we want to avoid forcing the creation
of a dummy basic block, but still need to make the variable available for
later use.
- With that, we can now skip IRgen for other unreachable statements (which
don't define a label).
- Anders, I added two fixmes on calls to EmitVLASize, can you check them?
llvm-svn: 76361
2009-07-19 06:58:07 +00:00
Anders Carlsson
27b50135ee
Rename NextOffset to DataSize, which better matches the Itanium C++ ABI
...
llvm-svn: 76339
2009-07-18 21:26:44 +00:00
Anders Carlsson
15b73deeea
Revert r75641.
...
llvm-svn: 76327
2009-07-18 19:43:29 +00:00
Steve Naroff
c277ad10f0
Remove ObjCQualifiedInterfaceType:-)
...
llvm-svn: 76321
2009-07-18 15:33:26 +00:00
Chris Lattner
f56501ce48
fix objc codegen to not have its own list of things that eventually get into llvm.used, just
...
populate CGM's list directly.
llvm-svn: 76266
2009-07-17 23:57:13 +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
b825c0ddc5
Replaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents.
...
llvm-svn: 76139
2009-07-17 01:20:38 +00:00
Fariborz Jahanian
c3443a3bf3
ir-gen for --/++ operators of objc object pointers
...
in 32bit abi.
llvm-svn: 76109
2009-07-16 22:04:59 +00:00
Anton Korobeynikov
b5b703b2f7
Hook in s390x stuff into clang
...
llvm-svn: 76099
2009-07-16 20:09:57 +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
a296c03430
Update for LLVM API change.
...
llvm-svn: 76090
2009-07-16 18:09:38 +00:00
Chris Lattner
aa64ca28cb
use CreateRuntimeVariable to get __CFConstantStringClassReference
...
instead of doing it manually (which might end up getting auto-renamed),
fixing a FIXME. rdar://7065446
llvm-svn: 76079
2009-07-16 16:48:25 +00:00
Steve Naroff
79d1215d83
Remove ASTContext::isObjCObjectPointerType().
...
Convert all clients to use the new predicate on Type.
llvm-svn: 76076
2009-07-16 15:41:00 +00:00
Chris Lattner
3afa3e1d91
codegen string literals using private linkage now like llvm-gcc, eliminating
...
some target hooks.
llvm-svn: 75895
2009-07-16 05:03:48 +00:00
Owen Anderson
9f98d37612
Update for LLVM API change.
...
llvm-svn: 75869
2009-07-16 00:14:12 +00:00
Ted Kremenek
3e808edac9
Lexically order files in CMakeLists.txt files.
...
llvm-svn: 75832
2009-07-15 21:08:41 +00:00
Steve Naroff
1329fa0ed9
Implement the ObjC pseudo built-in types as clang "BuiltinType's". I say pseudo built-in types, since Sema still injects a typedef for recognition (i.e. they aren't truly built-ins from a parser perspective).
...
This removes the static data/methods on ObjCObjectPointerType while preserving the nice API (no need to fiddle with ASTContext:-).
This patch also adds Type::isObjCBuiltinType().
This should be the last fairly large patch related to recrafting the ObjC type system. The follow-on patches should be fairly small.
llvm-svn: 75808
2009-07-15 18:40:39 +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
Devang Patel
9be7b20401
Revert 75648 for now. It is causing test failures.
...
llvm-svn: 75684
2009-07-14 21:31:22 +00:00