summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC
Commit message (Collapse)AuthorAgeFilesLines
* Support noreturn in limited contexts on Objective-C message sends.John McCall2015-09-101-0/+99
| | | | | | rdar://6198039 llvm-svn: 247350
* ARC: Fix the precise-lifetime suppression of returns_inner_pointerJohn McCall2015-09-091-13/+142
| | | | | | | | receiver extension for message sends via property syntax. rdar://22172983 llvm-svn: 247209
* Compute and preserve alignment more faithfully in IR-generation.John McCall2015-09-0811-94/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce an Address type to bundle a pointer value with an alignment. Introduce APIs on CGBuilderTy to work with Address values. Change core APIs on CGF/CGM to traffic in Address where appropriate. Require alignments to be non-zero. Update a ton of code to compute and propagate alignment information. As part of this, I've promoted CGBuiltin's EmitPointerWithAlignment helper function to CGF and made use of it in a number of places in the expression emitter. The end result is that we should now be significantly more correct when performing operations on objects that are locally known to be under-aligned. Since alignment is not reliably tracked in the type system, there are inherent limits to this, but at least we are no longer confused by standard operations like derived-to-base conversions and array-to-pointer decay. I've also fixed a large number of bugs where we were applying the complete-object alignment to a pointer instead of the non-virtual alignment, although most of these were hidden by the very conservative approach we took with member alignment. Also, because IRGen now reliably asserts on zero alignments, we should no longer be subject to an absurd but frustrating recurring bug where an incomplete type would report a zero alignment and then we'd naively do a alignmentAtOffset on it and emit code using an alignment equal to the largest power-of-two factor of the offset. We should also now be emitting much more aggressive alignment attributes in the presence of over-alignment. In particular, field access now uses alignmentAtOffset instead of min. Several times in this patch, I had to change the existing code-generation pattern in order to more effectively use the Address APIs. For the most part, this seems to be a strict improvement, like doing pointer arithmetic with GEPs instead of ptrtoint. That said, I've tried very hard to not change semantics, but it is likely that I've failed in a few places, for which I apologize. ABIArgInfo now always carries the assumed alignment of indirect and indirect byval arguments. In order to cut down on what was already a dauntingly large patch, I changed the code to never set align attributes in the IR on non-byval indirect arguments. That is, we still generate code which assumes that indirect arguments have the given alignment, but we don't express this information to the backend except where it's semantically required (i.e. on byvals). This is likely a minor regression for those targets that did provide this information, but it'll be trivial to add it back in a later patch. I partially punted on applying this work to CGBuiltin. Please do not add more uses of the CreateDefaultAligned{Load,Store} APIs; they will be going away eventually. llvm-svn: 246985
* Fix CHECK directives that weren't checking.Hans Wennborg2015-08-311-1/+1
| | | | llvm-svn: 246492
* DI: Update DISubprogram testcases after LLVM r246098Duncan P. N. Exon Smith2015-08-262-5/+5
| | | | llvm-svn: 246099
* Internal-linkage variables with constant-evaluatable initializers do not ↵Richard Smith2015-08-191-1/+9
| | | | | | need to be emitted. (Also reduces the set of variables that need to be eagerly deserialized when using PCH / modules.) llvm-svn: 245497
* DI: Update testcases for LLVM assembly changeDuncan P. N. Exon Smith2015-07-318-17/+18
| | | | | | | | | | Update testcases after LLVM change r243774. Most of these had no need to check `tag:` field, but did so as a way of getting to the `name:` field. In a few cases I've converted the `tag:` checks to `arg:` or `CHECK-NOT: arg:`. llvm-svn: 243775
* Add missing files for objc_boxable feature.Alex Denisov2015-07-235-0/+551
| | | | | | Original patch [r240761] is missing all new files because of committer's mistake. llvm-svn: 243018
* Fix -save-temp when using objc-arc, sanitizer and profilingSteven Wu2015-07-171-0/+27
| | | | | | | | | | | | Currently, -save-temp will cause ObjCARC optimization to be dropped, sanitizer pass to run early in the pipeline, and profiling instrumentation to run twice. Fix the issue by properly disable all passes in the optimization pipeline when generating bitcode output and parse some of the Language Options even when the input is bitcode so the passes can be setup correctly. llvm-svn: 242565
* Substitute type arguments into uses of Objective-C interface members.Douglas Gregor2015-07-071-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When messaging a method that was defined in an Objective-C class (or category or extension thereof) that has type parameters, substitute the type arguments for those type parameters. Similarly, substitute into property accesses, instance variables, and other references. This includes general infrastructure for substituting the type arguments associated with an ObjCObject(Pointer)Type into a type referenced within a particular context, handling all of the substitutions required to deal with (e.g.) inheritance involving parameterized classes. In cases where no type arguments are available (e.g., because we're messaging via some unspecialized type, id, etc.), we substitute in the type bounds for the type parameters instead. Example: @interface NSSet<T : id<NSCopying>> : NSObject <NSCopying> - (T)firstObject; @end void f(NSSet<NSString *> *stringSet, NSSet *anySet) { [stringSet firstObject]; // produces NSString* [anySet firstObject]; // produces id<NSCopying> (the bound) } When substituting for the type parameters given an unspecialized context (i.e., no specific type arguments were given), substituting the type bounds unconditionally produces type signatures that are too strong compared to the pre-generics signatures. Instead, use the following rule: - In covariant positions, such as method return types, replace type parameters with “id” or “Class” (the latter only when the type parameter bound is “Class” or qualified class, e.g, “Class<NSCopying>”) - In other positions (e.g., parameter types), replace type parameters with their type bounds. - When a specialized Objective-C object or object pointer type contains a type parameter in its type arguments (e.g., NSArray<T>*, but not NSArray<NSString *> *), replace the entire object/object pointer type with its unspecialized version (e.g., NSArray *). llvm-svn: 241543
* Account for calling convention specifiers in function definitions in IR test ↵David Blaikie2015-06-293-10/+10
| | | | | | | | | | | | | cases Several tests wouldn't pass when executed on an armv7a_pc_linux triple due to the non-default arm_aapcs calling convention produced on the function definitions in the IR output. Account for this with the application of a little regex. Patch by Ying Yi. llvm-svn: 240971
* Update clang to take into account the changes to personality fnsDavid Majnemer2015-06-174-6/+9
| | | | llvm-svn: 239941
* Honor the objc_runtime_name attribute when encoding class/protocol names.Douglas Gregor2015-06-161-1/+15
| | | | | | | | While the rest of the Objective-C metadata seems to honor objc_runtime_name, the encoding strings produced by, e.g., @encode and property meta, were not. Fixes rdar://problem/21408305. llvm-svn: 239852
* Adjust clang side tests effected by 239795 before reapplying said changePhilip Reames2015-06-162-12/+12
| | | | llvm-svn: 239848
* Implement no_sanitize attribute.Peter Collingbourne2015-05-151-0/+8
| | | | | | Differential Revision: http://reviews.llvm.org/D9631 llvm-svn: 237463
* Changed renaming of local symbols by inserting a dot vefore the numeric suffixSunil Srivastava2015-05-1213-20/+20
| | | | | | | details in http://reviews.llvm.org/D9483 goes with llvm checkin r237150 llvm-svn: 237151
* DebugInfo: Metadata constructs now start with DI*Duncan P. N. Exon Smith2015-04-2930-104/+104
| | | | | | | | | | LLVM r236120 renamed debug info IR constructs to use a `DI` prefix, now that the `DIDescriptor` hierarchy has been gone for about a week. This commit was generated using the rename-md-di-nodes.sh upgrade script attached to PR23080, followed by running clang-format-diff.py on the `lib/` portion of the patch. llvm-svn: 236121
* [opaque pointer type] Update test cases now that the type for an invoke is ↵David Blaikie2015-04-241-1/+1
| | | | | | just a function type, not a pointer-to-function type llvm-svn: 235756
* Revert "Revert r234581, it might have caused a few miscompiles in Chromium."David Majnemer2015-04-227-13/+190
| | | | | | | | This reverts commit r234700. It turns out that the lifetime markers were not the cause of Chromium failing but a bug which was uncovered by optimizations exposed by the markers. llvm-svn: 235553
* [opaque pointer types] Explicit non-pointer type for call expressionsDavid Blaikie2015-04-1610-18/+18
| | | | | | (migration for recent LLVM change to textual IR for calls) llvm-svn: 235147
* Revert r234581, it might have caused a few miscompiles in Chromium.Nico Weber2015-04-117-190/+13
| | | | | | | If the revert helps, I'll get a repro this Monday. Else I'll put the change back in. llvm-svn: 234700
* Remove threshold for inserting lifetime markers for named temporariesArnaud A. de Grandmaison2015-04-107-13/+190
| | | | | | | | | | | | | | | | | | | Now that TailRecursionElimination has been fixed with r222354, the threshold on size for lifetime marker insertion can be removed. This only affects named temporary though, as the patch for unnamed temporaries is still in progress. My previous commit (r222993) was not handling debuginfo correctly, but this could only be seen with some asan tests. Basically, lifetime markers are just instrumentation for the compiler's usage and should not affect debug information; however, the cleanup infrastructure was assuming it contained only destructors, i.e. actual code to be executed, and was setting the breakpoint for the end of the function to the closing '}', and not the return statement, in order to show some destructors have been called when leaving the function. This is wrong when the cleanups are only lifetime markers, and this is now fixed. llvm-svn: 234581
* [Objective-C patch] Patch to fix a crash in IRGen because Fariborz Jahanian2015-04-061-0/+21
| | | | | | | | of incorrect AST when a compound literal of Objective-C property access is used to initialize a vertor of floats. rdar://20407999 llvm-svn: 234176
* [Objective-C metadata patch]. Patch to allocate one more space for Fariborz Jahanian2015-03-311-0/+17
| | | | | | Protocol objects in OBJC2. rdar://20286356 llvm-svn: 233766
* Test case updates for explicit type parameter to the gep operatorDavid Blaikie2015-03-139-21/+21
| | | | llvm-svn: 232187
* DebugInfo: Move new hierarchy into place (clang)Duncan P. N. Exon Smith2015-03-0329-80/+198
| | | | | | | Update testcases for LLVM change in r231082 to use the new debug info hierarchy. llvm-svn: 231083
* Update Clang tests to handle explicitly typed load changes in LLVM.David Blaikie2015-02-2738-371/+371
| | | | llvm-svn: 230795
* Update Clang tests to handle explicitly typed gep changes in LLVM.David Blaikie2015-02-2715-116/+116
| | | | llvm-svn: 230783
* Remove trailing whitespace to help make test compatible with typeless ↵David Blaikie2015-02-151-1/+1
| | | | | | pointer migration llvm-svn: 229271
* DebugInfo: Attribute cleanup code to the end of the scope, not the end of ↵David Blaikie2015-02-041-7/+5
| | | | | | | | | | | | | | | | | | the function. Now if you break on a dtor and go 'up' in your debugger (or you get an asan failure in a dtor) during an exception unwind, you'll have more context. Instead of all dtors appearing to be called from the '}' of the function, they'll be attributed to the end of the scope of the variable, the same as the non-exceptional dtor call. This doesn't /quite/ remove all uses of CurEHLocation (which might be nice to remove, for a few reasons) - it's still used to choose the location for some other work in the landing pad. It'd be nice to attribute that code to the same location as the exception calls within the block and to remove CurEHLocation. llvm-svn: 228181
* test: Make encode-test-5.m's output not dependent on its filenameDavid Majnemer2015-02-021-1/+1
| | | | | | | Pipe the file into clang instead of passing the file path on the command line. llvm-svn: 227896
* FileCheck'ize CodeGenObjC testDavid Majnemer2015-02-021-6/+11
| | | | | | This fixes PR22437. llvm-svn: 227843
* IR: Move MDLocation into place (clang testcases)Duncan P. N. Exon Smith2015-01-144-24/+24
| | | | | | Update testcases to match LLVM change in r226048. llvm-svn: 226049
* IR: Make metadata typeless in assembly, clang sideDuncan P. N. Exon Smith2014-12-1520-78/+78
| | | | | | Match LLVM changes from r224257. llvm-svn: 224259
* Have the driver and the target code agree on what the default ABIEric Christopher2014-12-052-6/+6
| | | | | | | | | is for each machine. Fix up darwin tests that were testing for aapcs on armv7-ios when the actual ABI is apcs. Should be no user visible change without -cc1. llvm-svn: 223429
* Revert "Remove threshold for lifetime marker insertion of named temporaries"Arnaud A. de Grandmaison2014-12-017-191/+3
| | | | | | Revert r222993 while I investigate some MemorySanitizer failures. llvm-svn: 222995
* Remove threshold for lifetime marker insertion of named temporariesArnaud A. de Grandmaison2014-12-017-3/+191
| | | | | | | | | Now that TailRecursionElimination has been fixed with r222354, the threshold on size for lifetime marker insertion can be removed. This only affects named temporary though, as the patch for unnamed temporaries is still in progress. llvm-svn: 222993
* relax this testcase to not depend on a specific alignment.Adrian Prantl2014-11-211-1/+1
| | | | llvm-svn: 222490
* Debug info for blocks: Fix a bug caught by the Verifier.Adrian Prantl2014-11-211-0/+26
| | | | | | | | | | | | When emitting nested block definitions, the insert-at-point variant of DIBuilder::insertDeclare() could be called with the insertion point set to the end-of-BasicBlock sentinel, causing the parent pointer of the CallInst to be set to the intentionally bogus value of the sentinel. Fixed by conditionally invoking the correct version of insertDeclare(). rdar://problem/19034882 llvm-svn: 222487
* Don't manually insert L prefixes.Rafael Espindola2014-11-0628-159/+159
| | | | | | Simply marking the symbol private conveys the desire to hide them to LLVM. llvm-svn: 221451
* Use FileCheck.Rafael Espindola2014-11-061-3/+4
| | | | llvm-svn: 221435
* Delete dead test.Rafael Espindola2014-11-061-19/+0
| | | | llvm-svn: 221434
* Debug info: Emit the correct type for the __FuncPtr field in a blockAdrian Prantl2014-11-051-0/+18
| | | | | | | | descriptor. rdar://problem/15984431 llvm-svn: 221326
* Objective-C. revert patch for rdar://17554063.Fariborz Jahanian2014-10-282-28/+16
| | | | llvm-svn: 220812
* DebugInfo: Omit scopes in -gmlt to reduce metadata size (on disk and in memory)David Blaikie2014-10-221-1/+1
| | | | | | | I haven't done any actual impact analysis of this change as it's a strict improvement, but I'd be curious to know how much it helps. llvm-svn: 220408
* CodeGen: correct block mangling in ObjCSaleem Abdulrasool2014-10-141-0/+29
| | | | | | | | | | | | Mangling for blocks defined within blocks in an ObjectiveC context were also broken by SVN r219393. Because the code in mangleName assumed that the code was either C or C++, we would trigger assertions when trying to mangle the inner blocks in an ObjectiveC context. Add a test and use the ObjectiveC specific mangling when dealing with an ObjectiveC method declaration. llvm-svn: 219697
* Revert "Remove threshold on object size for inserting lifetime begin / end"Arnaud A. de Grandmaison2014-10-087-191/+3
| | | | | | Revert this patch while I investigate some sanitizer failures off-line. llvm-svn: 219307
* Remove threshold on object size for inserting lifetime begin / endArnaud A. de Grandmaison2014-10-087-3/+191
| | | | | | | | | Boostrapping LLVM+Clang+LLDB without threshold on object size for lifetime markers insertion has shown there was no significant change in compile time, so let the stack slot colorizer do its optimization for all slots. llvm-svn: 219303
* Revert "Revert "DI: LLVM schema change: fold constants into string""Duncan P. N. Exon Smith2014-10-0313-26/+28
| | | | | | | | | | | | | | This reverts commit r218917, effectively reapplying r218913. Original commit message follows. -- Update debug info testcases for an LLVM metadata schema change to fold metadata constant operands into a single `MDString`. Part of PR17891. llvm-svn: 219011
* Revert "DI: LLVM schema change: fold constants into string"Duncan P. N. Exon Smith2014-10-0213-28/+26
| | | | | | This reverts commit r218913 while I investigate some bots. llvm-svn: 218917
OpenPOWER on IntegriCloud