Devang Patel
e7ce54074f
Fix location of setter/getter synthesized for a property.
...
llvm-svn: 131701
2011-05-19 23:37:41 +00:00
Eli Friedman
2f1e9e618c
Make __builtin_shufflevector and -ftrapv work correctly together. PR9945.
...
llvm-svn: 131611
2011-05-19 00:37:32 +00:00
Roman Divacky
c161735bdf
Add ARMTargetCodeGenInfo::initDwarfEHRegSizeTable() defining 16 32bit regs.
...
llvm-svn: 131558
2011-05-18 19:36:54 +00:00
Bill Wendling
28b9e8b3a8
Conditionalize the use of 4.4 or 4.2 format based on the target.
...
<rdar://problem/8107317>
llvm-svn: 131504
2011-05-17 23:06:23 +00:00
Fariborz Jahanian
ccdfa39005
Code cleanup of my last patch.
...
llvm-svn: 131499
2011-05-17 22:46:11 +00:00
Fariborz Jahanian
7bd3d1c49b
Patch to fix IR-gen crash generating structure ABI which implements
...
user specified string class via -fconstant-string-class option.
pr9914.
llvm-svn: 131496
2011-05-17 22:21:16 +00:00
Eli Friedman
af9b325d23
For calls returning first-class aggregates, store by element instead of creating aggregate stores in common cases. This is more friendly to fast-isel.
...
llvm-svn: 131490
2011-05-17 21:08:01 +00:00
John McCall
3597b6340c
Revert r131434, my commit disabling the complete-object constructor
...
optimization for abstract classes; there was a misunderstanding, and
it turns out that there are no kexts which rely on this.
llvm-svn: 131489
2011-05-17 21:05:49 +00:00
Argyrios Kyrtzidis
d42411fa19
Revert r131447, see if it fixes the buildbot.
...
llvm-svn: 131450
2011-05-17 02:17:52 +00:00
Argyrios Kyrtzidis
ceee5e8133
Inside isEmptyRecord function, for CXXRecordDecl just check the isEmpty bit.
...
llvm-svn: 131447
2011-05-17 00:46:40 +00:00
Devang Patel
f9076f3b45
Set up appropriate context for member function.
...
Radar 9440721
llvm-svn: 131441
2011-05-17 00:20:09 +00:00
Ted Kremenek
c249c411c2
Fix crash on C++ code when compiling with -finstrument-functions.
...
llvm-svn: 131435
2011-05-16 23:49:20 +00:00
John McCall
2ccfe89b3e
Emit complete-object constructors for abstract classes in kext mode for
...
reasons that honestly really, really need to be looked into.
llvm-svn: 131434
2011-05-16 23:34:46 +00:00
Anders Carlsson
d6f1518cc9
Fix another regression from the "skip vtable pointer initialization"
...
optimization. Make sure to require a vtable when trying to get the address
of a VTT, otherwise we would never end up emitting the VTT.
llvm-svn: 131400
2011-05-16 04:08:36 +00:00
John McCall
7ec4b4342c
Don't actually emit calls to the reserved global placement new and delete
...
operators; their semantics are guaranteed by the language.
If someone wants to argue that freestanding compiles shouldn't recognize
this, I might be convinceable.
llvm-svn: 131395
2011-05-16 01:05:12 +00:00
Anders Carlsson
49c0bd2a25
Re-enable the fix for PR9181 now that all the edge cases are handled.
...
llvm-svn: 131385
2011-05-15 17:36:21 +00:00
John McCall
036f2f6b35
The array-size operand to a new-expression is not necessarily a size_t.
...
It can be larger, it can be smaller, it can be signed, whatever. Handle
all the crazy cases with grace and spirit.
llvm-svn: 131378
2011-05-15 07:14:44 +00:00
John McCall
745ae2853c
Make CGF.getContext() inlinable, because it's trivial, and optimize
...
hasAggregateLLVMType.
llvm-svn: 131375
2011-05-15 02:34:36 +00:00
John McCall
85dd2c5039
More killing of std::vector.
...
llvm-svn: 131374
2011-05-15 02:19:42 +00:00
John McCall
9dc0db2192
Use arrays and SmallVectors instead of std::vectors when building function
...
types. Also, cache a translation of 'void' in CGM and provide a ptrdiff_t
alias. No functionality change.
llvm-svn: 131373
2011-05-15 01:53:33 +00:00
Anders Carlsson
b55c8c127e
Disable the optimization until the bug noticed by Sean Hunt has been fixed.
...
llvm-svn: 131372
2011-05-15 01:50:14 +00:00
Anders Carlsson
9bd7d16440
When emitting the destructor for a class with a vtable, if we can determine
...
that the destructor body is trivial and that all member variables also have either
trivial destructors or trivial destructor bodies, we don't need to initialize the
vtable pointers since no virtual member functions will be called on the destructor.
Fixes PR9181.
llvm-svn: 131368
2011-05-14 23:26:09 +00:00
John McCall
5880fb8edf
Only perform the null-initialization of an aggregate result of a message
...
send if the receiver is null. Normally it's not worthwhile to check this,
but avoiding the null-initialization is nice, and this also avoids nasty
problems where the null-initialization is visible within the call because
we use an aliased result buffer. rdar://problem/9402992
llvm-svn: 131366
2011-05-14 21:12:11 +00:00
John McCall
9e8bb000d8
Objective-C vtables are not taking the world by storm; call them
...
out as "v-table" message sends and stop calling normal messages "legacy"
message sends.
Also, fix some comments to reveal the true state of affairs.
llvm-svn: 131335
2011-05-14 03:10:52 +00:00
John McCall
234eac88ae
Reorganize this method to avoid multiple calls for computing CGFunctionInfo
...
and to decrease the amount of effort in appending strings.
llvm-svn: 131323
2011-05-13 23:16:18 +00:00
Joerg Sonnenberger
be7850dd8a
Simplify
...
llvm-svn: 131321
2011-05-13 22:58:37 +00:00
Joerg Sonnenberger
caf8ffd8e3
Bug 8765: Honor assembler labels for builtins. Ensure that the label is
...
mangled to avoid doing it twice for platforms that use prefixes like
Darwin.
llvm-svn: 131311
2011-05-13 21:12:10 +00:00
Bill Wendling
bb455154a1
Remove the 'unaligned load' builtins now that they're no longer used in the *mmintrin.h files.
...
llvm-svn: 131300
2011-05-13 18:52:28 +00:00
Fariborz Jahanian
a52b1f72ef
Produce UTF-8 strings with -fconstant-string-class
...
-fno-constant-cfstrings. Patch by Jonathan Schleifer.
llvm-svn: 131298
2011-05-13 18:13:10 +00:00
Douglas Gregor
61226d3fcf
When determining whether we can make a declaration into a global
...
constant, also consider whether it's a class type that has any mutable
fields. If so, it can't be a global constant.
llvm-svn: 131276
2011-05-13 01:05:07 +00:00
Devang Patel
e91b54cc56
Doug convinced me that DW_AT_APPLE_objc_complete_type is more appropriate name.
...
s/DW_AT_APPLE_objc_class_extension/DW_AT_APPLE_objc_complete_type/g
llvm-svn: 131245
2011-05-12 21:29:57 +00:00
Devang Patel
70d77d144b
Do not add AT_APPLE_objc_class_extension attribute if @implementation is not seen.
...
llvm-svn: 131242
2011-05-12 21:14:54 +00:00
Devang Patel
36882c8f24
Use DW_AT_APPLE_objc_class_extension attribute to identify interfaces that represent class extension.
...
Radar 9423077.
llvm-svn: 131239
2011-05-12 19:07:41 +00:00
Bill Wendling
e106c34817
LLVM doesn't always optimize away the four loads from this:
...
(__m128){ p[0], p[1], p[2], p[3] }
which produces really bad code. This could be done in instcombine, but it's
probably better to do it in the front-end instead.
<rdar://problem/9424836>
llvm-svn: 131237
2011-05-12 19:02:15 +00:00
John McCall
3f6e745292
Make this code more resilient against catch variables which need cleanups.
...
llvm-svn: 131215
2011-05-12 01:00:15 +00:00
Alexis Hunt
f479f1b7e4
Rename "hasTrivialConstructor" to "hasTrivialDefaultConstructor" and
...
modify the semantics slightly to accomodate default constructors (I
hope).
llvm-svn: 131087
2011-05-09 18:22:59 +00:00
Anders Carlsson
c36783e8b9
Move code to emit the callee of an CXXOperatorCallExpr out into a separate function in CGClass.cpp
...
llvm-svn: 131075
2011-05-08 20:32:23 +00:00
Anders Carlsson
cc53197903
Don't emit complete constructors for abstract classes. Also, don't emit
...
complete destructors for abstract classes unless the destructor is virtual
and thus needs to be in the vtable.
llvm-svn: 131068
2011-05-08 17:25:05 +00:00
Douglas Gregor
2d1c055eba
In C++, allow us to emit a global as 'constant' even if it has class
...
type, so long as it is known to have a constant initializer and the
class type is a POD class. Fixes <rdar://problem/9306265>.
llvm-svn: 131060
2011-05-07 22:06:45 +00:00
Douglas Gregor
9ca5465500
Revert r130717, which caused a regression (<rdar://problem/9402621>).
...
llvm-svn: 131057
2011-05-07 20:12:26 +00:00
Cameron Esfahani
bceca20ab9
Fix false positive warning about uninitialized variable.
...
llvm-svn: 131019
2011-05-06 21:28:42 +00:00
Alexis Hunt
4a8ea1092a
Modify some deleted function methods to better reflect reality:
...
- New isDefined() function checks for deletedness
- isThisDeclarationADefinition checks for deletedness
- New doesThisDeclarationHaveABody() does what
isThisDeclarationADefinition() used to do
- The IsDeleted bit is not propagated across redeclarations
- isDeleted() now checks the canoncial declaration
- New isDeletedAsWritten() does what it says on the tin.
- isUserProvided() now correct (thanks Richard!)
This fixes the bug that we weren't catching
void foo() = delete;
void foo() {}
as being a redefinition.
llvm-svn: 131013
2011-05-06 20:44:56 +00:00
Eli Friedman
409943efcb
Don't emit nsw flags for vector operations; there's basically no benefit, and a lot of downside (like PR9850, which is about clang's xmmintrin.h making an unexpected transformation on an expression involving _mm_add_epi32).
...
llvm-svn: 131000
2011-05-06 18:04:18 +00:00
Eli Friedman
49a94b1c7c
Add an implementation of thunks for varargs methods. The implementation is a bit messy, but it is correct as long as the method in question doesn't use indirect gotos. A couple of possible alternative implementations are outlined in FIXME's in this patch. rdar://problem/8077308 .
...
llvm-svn: 130993
2011-05-06 17:27:27 +00:00
Axel Naumann
bd26a58538
Reset the emitted initializers.
...
This enables incremental codegen, where the initializer array can be removed from the module, such that only new initializers will be emitted and run.
llvm-svn: 130986
2011-05-06 15:24:04 +00:00
Fariborz Jahanian
30aa4aa4ae
type of last arg of objc_assign_ivar is ptrdiff_t.
...
// rdar://9362887
llvm-svn: 130956
2011-05-05 22:00:38 +00:00
Richard Smith
3f1b5d077b
Implement support for C++0x alias templates.
...
llvm-svn: 130953
2011-05-05 21:57:07 +00:00
Devang Patel
979aba5d09
Do not drop uint128 on the floor.
...
llvm-svn: 130929
2011-05-05 17:06:30 +00:00
Nick Lewycky
85c011ddc4
Preserve the full name of the file, so that '-c -o foo.pic.o' produces
...
foo.pic.gcno instead of foo.gcno.
llvm-svn: 130899
2011-05-05 00:08:20 +00:00
Bill Wendling
f7d4598b74
Pack ivar offsets together.
...
Ivar offsets for synthesized ivars are wrong, which could end up with a large
number of dirty pages because of ivar fixups at runtime. When we pack all of the
synthesized ivars into the same section, it limits the number of dirty pages
created. Place them in the "__DATA,__objc_ivar" section.
<rdar://problem/9374905>
llvm-svn: 130870
2011-05-04 21:37:25 +00:00