aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenObjC
AgeCommit message (Collapse)Author
2013-05-03Correctly emit certain implicit references to 'self' even withinJohn McCall
a lambda. Bug #1 is that CGF's CurFuncDecl was "stuck" at lambda invocation functions. Fix that by generally improving getNonClosureContext to look through lambdas and captured statements but only report code contexts, which is generally what's wanted. Audit uses of CurFuncDecl and getNonClosureAncestor for correctness. Bug #2 is that lambdas weren't specially mapping 'self' when inside an ObjC method. Fix that by removing the requirement for that and using the normal EmitDeclRefLValue path in LoadObjCSelf. rdar://13800041 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181000 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02Ensure that the line table for functions with cleanups is sequential.Adrian Prantl
If there is cleanup code, the cleanup code gets the debug location of the closing '}'. The subsequent ret IR-instruction does not get a debug location. The return _expression_ will get the debug location of the return statement. If the function contains only a single, simple return statement, the cleanup code may become the first breakpoint in the function. In this case we set the debug location for the cleanup code to the location of the return statement. rdar://problem/13442648 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180932 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19Remove an empty line so the line numbers match up again after the recent ↵Adrian Prantl
documentation change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179898 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19still not relaxed enough.Adrian Prantl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179897 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19cleanup and relax test casesAdrian Prantl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179896 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19Emit the underlying type in the debug info for all kinds of fixed enumsAdrian Prantl
instead of only C++11-scoped-with-class-tag enums. rdar://problem/13463793 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179879 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-16objc_autoreleasePoolPop() can throw if a -dealloc does.John McCall
Model it as throwing so that the exception can be caught. This is generally not expected to have significant code-size impact because the contents of the @autoreleasepool block are very likely to contain a call, very likely at the same cleanup level as the @autoreleasepool itself. rdar://13660038 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179630 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-16Trying fixing test to make buildbot happy again.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179629 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-16modify test to try to make buildbot happy.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179606 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-16Objective-C IRGen. Use llvm::WeakVHFariborz Jahanian
for caching couple of global symbols used for generation of CF/NS string meta-data so they are not released prematuely in certain corner cases. // rdar:// 13598026. Reviewed by John M. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179599 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11FileCheck-ify more grep tests with quoted double quotesReid Kleckner
This required some tedious reordering to match clang's order. Presumably these ObjC tests were generated based on llvm-gcc's output ordering. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179282 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10FileCheck-ify some clang grep tests that use double quotesReid Kleckner
The escaping interaction between Python and grep doesn't work on my system. This change fixes the tests for me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179214 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-08Don't copy just to capture a strong block pointer under ARC.John McCall
It turns out that the optimizer can't eliminate this without extra information, for which there's a separate bug. rdar://13588325 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179069 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-04Be sure to check ARC conventions on the implicit method declarationsJohn McCall
of a property just in case the property's getter happens to be +1. We won't synthesize a getter for such a property, but we will allow the user to define a +1 method for it. rdar://13115896 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178731 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-04Protect the values of array and dictionary literals from theJohn McCall
ARC optimizer while they're held in local unsafe buffers. Based on a patch by Jesse Rusak! rdar://13573224 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178721 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-03In ObjC++ on legacy runtimes, push an EH cleanup as well asJohn McCall
a normal cleanup when entering a @try or @synchronized to ensure that we clean that up if an exception is triggered. Apparently GCC did this, so it's hard to argue that we shouldn't do at least as much. rdar://12364847 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178599 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-29generalize testcaseAdrian Prantl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178383 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-29Bugfix/Followup for r177086.Adrian Prantl
* Store the .block_descriptor (instead of self) in the alloca so we can guarantee that all captured variables are available at -O0. * Add the missing OpDeref for the alloca. rdar://problem/12767564 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178361 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23Make clang to mark static stack allocations with lifetime markers to enable ↵Nadav Rotem
a more aggressive stack coloring. Patch by John McCall with help by Shuxin Yang. rdar://13115369 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177819 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23Under ARC, when we're passing the address of a strong variableJohn McCall
to an out-parameter using the indirect-writeback conversion, and we copied the current value of the variable to the temporary, make sure that we register an intrinsic use of that value with the optimizer so that the value won't get released until we have a chance to retain it. rdar://13195034 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177813 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-21Generalize debug info tests to be forward compatible with future ↵David Blaikie
DISubprogram changes git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177659 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19Simplify/generalize some debug info test casesDavid Blaikie
Mostly, try to depend on the annotation comments more so these tests are more legible, brief, and agnostic to schema changes in the future (sure, they're not agnostic to changes to the comment annotations but since they're easier to read they should be easier to update if that happens). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177457 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19Add a clarifying note when a return statement is rejected becauseJohn McCall
we expect a related result type. rdar://12493140 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177378 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-17Generalize a few debug info test casesDavid Blaikie
Checking for the annotation comment rather than the metadata values makes these tests resilient to a coming refactor that will pull these fields out into a separate metadata node. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177237 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-14Add a testcase for r177118.Adrian Prantl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177124 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-14Allocate stack storage for .block_descriptor and captured self at -O0.Adrian Prantl
This way the register allocator will not optimize away the debug info for captured variables. Fixes rdar://problem/12767564 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177086 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-13Tighten up the rules for precise lifetime and documentJohn McCall
the requirements on the ARC optimizer. rdar://13407451 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176924 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-11Improve the caching of debuginfo Objective C interface types.Adrian Prantl
Generate forward declarations that are RAUW'd by finalize(). We thus avoid outputting the same type several times in multiple stages of completion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176820 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-06Ensure that DIType is regenerated after we visit an implementationAdrian Prantl
that adds ivars to an interface. Fixes rdar://13175234 This is an update to r176116 that performs a smart caching of interfaces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176584 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28Add more of the command line options as attribute flags.Bill Wendling
These can be easily queried by the back-end. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176304 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28Use the actual ABI-determined C calling convention for runtimeJohn McCall
calls and declarations. LLVM has a default CC determined by the target triple. This is not always the actual default CC for the ABI we've been asked to target, and so we sometimes find ourselves annotating all user functions with an explicit calling convention. Since these calling conventions usually agree for the simple set of argument types passed to most runtime functions, using the LLVM-default CC in principle has no effect. However, the LLVM optimizer goes into histrionics if it sees this kind of formal CC mismatch, since it has no concept of CC compatibility. Therefore, if this module happens to define the "runtime" function, or got LTO'ed with such a definition, we can miscompile; so it's quite important to get this right. Defining runtime functions locally is quite common in embedded applications. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176286 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27Temporarily revert r176116 for compile-time performance regression.Adrian Prantl
This reverts commit ea95e4587fd13606fbf63b10a07a7d02026aa39c. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176151 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27Reapply r176133 with testcase fixes.Bill Wendling
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176145 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-26Ensure that DIType is regenerated after we visited an implementation that ↵Adrian Prantl
adds ivars to an interface. Fixes rdar://13175234 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176116 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-25Revert "Add more attributes from the command line to functions."Anna Zaks
This reverts commit 176009. The commit is a likely cause of several buildbot failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176044 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-25Add more attributes from the command line to functions.Bill Wendling
This is an ongoing process. Any command line option which a back-end cares about should be added here. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176009 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-22Update tests so that we don't test for function-only attributes on call sites.Bill Wendling
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175921 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-22Update to use references to attribute groups instead of listing the ↵Bill Wendling
attributes on the call/invoke instructions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175878 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-21Patch for debug info of qualified-id types is 'id'Fariborz Jahanian
By Adrian Pranti. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175793 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-21objective-C arc IR-gen. Retaining of strongFariborz Jahanian
arguments in function prologue is done with objc_StoreStrong to pair it with similar objc_StoreStrong for release in function epilogue. This is done with -O0 only. // rdar://13145317 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175698 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-20Modify the tests to use attribute group references instead of listing theBill Wendling
function attributes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175606 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-19Use the actual class visibility for the ObjC EHTYPE global,John McCall
not the global visibility mode. Noticed by inspection. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175479 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18CodeGenFunction::CurFuncDecl can be NULL; fix crash introduced in r175386.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175448 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18Update test cases to account for DIBuilder type changes.David Blaikie
Paired commit with LLVM, may produce temporary build breakage. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175427 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-17Test ivar-invariant.m: use a more idiomatic RUN line and tighten the testDmitri Gribenko
by matching the function name first git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175395 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-17[clang] fix test execution commandSaleem Abdulrasool
Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175387 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-17[CodeGen] tighten objc ivar invariant.load attributionSaleem Abdulrasool
An ivar ofset cannot be marked as invariant load in all cases. The ivar offset is a lazily initialised constant, which is dependent on an objc_msgSend invocation to perform a fixup of the offset. If the load is being performed on a method implemented by the class then this load can safely be marked as an inviarant because a message must have been passed to the class at some point, forcing the ivar offset to be resolved. An additional heuristic that can be used to identify an invariant load would be if the ivar offset base is a parameter to an objc method. However, without the parameters available at hand, this is currently not possible. Reviewed-by: John McCall <rjmccall@apple.com> Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175386 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15Add the 'target-cpu' and 'target-features' attributes to functions.Bill Wendling
The back-end will use these values to reconfigure code generation for different features. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175308 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15objective-C: Fixes a compiler crash when encodingFariborz Jahanian
an ivar of type pointer to a typedef'ed object. // rdar://13190095 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175298 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-14Make this test determinstic for my last patch.Fariborz Jahanian
// rdar://13192366 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175217 91177308-0d34-0410-b5e6-96231b3b80d8