summaryrefslogtreecommitdiff
path: root/test/CodeGenObjC
Commit message (Collapse)AuthorAge
* Improve robustness of tests for module flags metadataOliver Stannard2014-06-19
| | | | | | | | | Fix clang tests to not break if the ID numbers of module flags metadata nodes change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211276 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C IRGen. Patch to generate a weak symbol reference whenFariborz Jahanian2014-06-10
| | | | | | | | | 'super' dispatches a class method in category for OBJC_METACLASS. This is when class is a weak_import class. // rdar://16529125 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210547 91177308-0d34-0410-b5e6-96231b3b80d8
* Add 'nonnull' parameter or return attribute when producing an llvm pointer ↵Nick Lewycky2014-05-28
| | | | | | type in a function type where the C++ type is a reference. Update the tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209723 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Avoid creating DILexicalScopeFiles when the filename in the ↵David Blaikie2014-05-14
| | | | | | | | | | | | | | | | | | | current scope has not changed. This looks like the right way for this check to work, but there is another semi-obvious bug, I would think: why is CurLoc not zero'd out between functions? The possibility for it to bleed between them seems problematic. (& indeed I caused tests to fail when I fixed this a different way, by setting CurLoc to SourceLocation() and the end of EmitFunctionEnd... ) The changes to debug-info-blocks.m are due to a mismatch between the source manager's file naming and CGDebugInfo's default handling when no -main-file-name is specified. This actually reveals somewhat of a bug in the debug info when using source files from standard in, too. See the comment in CGDebugInfo::CreateCompileUnit for more details. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208742 91177308-0d34-0410-b5e6-96231b3b80d8
* Build debug info for ObjC interface types at the end of the translation unit ↵David Blaikie2014-05-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | to ensure all ivars are included. This takes a different approach than the completedType/requiresCompleteType work which relies on AST callbacks to upgrade the type declaration to a definition. Instead, just defer constructing the definition to the end of the translation unit. This works because the definition is never needed by other debug info (so far as I know), whereas the definition of a struct may be needed by other debug info before the end of the translation unit (such as emitting the definition of a member function which must refer to that member function's declaration). If we had a callback for whenever an IVar was added to an ObjC interface we could use that, and remove the need for the ObjCInterfaceCache, which might be nice. (also would need a callback for when it was more than just a declaration so we could get properties, etc). A side benefit is that we also don't need the CompletedTypeCache anymore. Just rely on the declaration-ness of a type to decide whether its definition is yet to be emitted. There's still the PR19562 memory leak, but this should hopefully make that a bit easier to approach. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208015 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjC IVars aren't added when the type isn't emitted after the interface ↵David Blaikie2014-05-05
| | | | | | extension git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208014 91177308-0d34-0410-b5e6-96231b3b80d8
* Make test independent of label. Thanks to Richard Smith for catching this!Adrian Prantl2014-04-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207489 91177308-0d34-0410-b5e6-96231b3b80d8
* Run this test through instnamer to stop it failing on non-asserts clang builds.Richard Smith2014-04-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207488 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug info: Improve line table for functions with cleanups an early exitAdrian Prantl2014-04-29
| | | | | | | | | | | | | and no return expr at the end of the function. The "function has only simple returns" check in FinishFunction tests whether the number of simple return exprs equals the number of return exprs, but so far a fallthrough at the end of a function was not counted as a return, which would result in cleanup code being associated with the wrong source line. rdar://problem/16733984. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207480 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C [IRGen]. Fixes a crash in IRGen involving use ofFariborz Jahanian2014-04-23
| | | | | | | | 'typeof' to extract type of an @encode expression used in an initializer. // rdar://16655340 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207004 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C [IRGen]. Add encoding for 'weak' attribute of aFariborz Jahanian2014-04-02
| | | | | | | | 'readonly' property. // rdar://16136439 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205477 91177308-0d34-0410-b5e6-96231b3b80d8
* ARM64: initial clang support commit.Tim Northover2014-03-29
| | | | | | | | | | | This adds Clang support for the ARM64 backend. There are definitely still some rough edges, so please bring up any issues you see with this patch. As with the LLVM commit though, we think it'll be more useful for merging with AArch64 from within the tree. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205100 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't produce a L symbol in __DATA,__data.Rafael Espindola2014-03-27
| | | | | | The section __DATA,__data is atomized by the linker and cannot have L symbols. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204879 91177308-0d34-0410-b5e6-96231b3b80d8
* test: Give instrumentation based profiling tests their own directoryJustin Bogner2014-03-11
| | | | | | | | These tests are logically related, but they're spread about several different CodeGen directories. Consolidate them in one place to make them easier to manage. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203541 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C IRGen. Fixes several regressions caused by changes madeFariborz Jahanian2014-03-11
| | | | | | | | to setting of ObjC linkages. //rdar://16206443 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203521 91177308-0d34-0410-b5e6-96231b3b80d8
* Use llvm.compiler.used instead of llvm.used for objc symbols.Rafael Espindola2014-03-06
| | | | | | | | | | | | | LLVM currently has a hack (shouldEmitUsedDirectiveFor) that causes it to not print no_dead_strip for symbols starting with 'l' or 'L'. These are exactly the ones that the clang's objc codegen is producing. The net result, is that it is equivalent to llvm.compiler.used. The need for putting the private symbol in llvm.compiler.used should be clear (the objc runtime uses them). The reason for also putting the weak symbols in it is for LTO: ld64 will not ask us to preserve the it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203172 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the test a bit stronger by showing what is added to llvm.used.Rafael Espindola2014-03-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203170 91177308-0d34-0410-b5e6-96231b3b80d8
* PGO: Add support for Objective-C blocks.Bob Wilson2014-03-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203157 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Use private linkage for remaining GlobalVariables with private names."Rafael Espindola2014-03-06
| | | | | | | | This reverts commit r203059. Revert while we discuss what does it mean to be private and weak. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203141 91177308-0d34-0410-b5e6-96231b3b80d8
* Run -fprofile-instr tests with %clang_cc1.Bob Wilson2014-03-06
| | | | | | | This should help avoid problems like the buildbot fallout from my change in r203085. I left the CodeGenCXX tests alone for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203131 91177308-0d34-0410-b5e6-96231b3b80d8
* CodeGenObjC/instr-profile.m: Add -target darwin to appease bots.NAKAMURA Takumi2014-03-06
| | | | | | | | | | | | This expected; ; Function Attrs: uwtable define internal void @"\01+[A foreach:]"(i8* %self, i8* %_cmd, %0* %array) #0 { But the Name is mangled on other hosts; (x86_64-unknown-unknown) ; Function Attrs: nounwind uwtable define internal void @_c_A__foreach_(i8* %self, i8* %_cmd, %1* %array) #0 { git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203092 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt to fix buildbots by dropping the -LABEL from some FileCheck patterns.Bob Wilson2014-03-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203090 91177308-0d34-0410-b5e6-96231b3b80d8
* PGO: add instrumentation for Objective-C methods.Bob Wilson2014-03-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203085 91177308-0d34-0410-b5e6-96231b3b80d8
* Use private linkage for remaining GlobalVariables with private names.Rafael Espindola2014-03-06
| | | | | | | | | | | | | | | | | | | | | | This patch changes the remaining GlobalVariables using "\01L" and "\01l" prefixes to use private linkage. What is strange about them is that they currently use WeakAnyLinkage. There is no comment stating why and that is really odd since the symbols are completely hidden, so it doesn't make sense for them to be weak. Clang revisions like r63329, r63408, r63770, r65761 set the linkage to weak, but don't say why. I suspect they were just copying llvm-gcc. In llvm-gcc I found r58599 and r56322 that set DECL_WEAK, but they were just syncing from the apple gcc. I am not exactly sure what that means, since the last commit to svn://gcc.gnu.org/svn/gcc/branches/apple was in 2006, 2 years earlier. In summary, I have no idea why weak linkage was being used :-( To quote John McCall, "Let’s try without it and see" :-) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203059 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C IRGen. Fix up the hueristics for determiningFariborz Jahanian2014-03-04
| | | | | | | | | if an ivar offset load is invariant iff inside an instance method and ivar belongs to instance method's class and one of its super class. // rdar://16095748 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202872 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Fixes a regression when figuring out linkageFariborz Jahanian2014-03-03
| | | | | | | | for metadata symbols for forward referenced protocols which are never defined. // rdar://16203115 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202761 91177308-0d34-0410-b5e6-96231b3b80d8
* Use private linkage for globals we already name with \01L and \01l.Rafael Espindola2014-02-27
| | | | | | | | | | | | In llvm the only semantic difference between internal and private is that llvm tries to hide private globals my mangling them with a private prefix. Since the globals changed by this patch already had the magic don't mangle marker, there should be no change in the generated assembly. A followup patch should then be able to drop the \01L and \01l prefixes and let llvm mangle as appropriate. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202419 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Remove an assertion which assertsFariborz Jahanian2014-02-24
| | | | | | | | on correctly handled block layout IRGen. // rdar://16111839 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202063 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not put instrumentation counters before phis in ObjC for-in loops.Bob Wilson2014-02-24
| | | | | | | We still don't use the PGO to set branch weights for these loops, but at least this keeps the compiler from crashing. <rdar://problem/16137778> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202002 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix broken CHECK linesNico Rieck2014-02-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201477 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix broken RUN linesNico Rieck2014-02-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201475 91177308-0d34-0410-b5e6-96231b3b80d8
* [IRGen]. Fixes a crash in using Objective-C array Fariborz Jahanian2014-02-14
| | | | | | | | | | properties by fixing shouldBindAsLValue to accept arrays (like record types) because we always manipulate them in memory. Patch suggested by John MaCall. // rdar://15610943 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201428 91177308-0d34-0410-b5e6-96231b3b80d8
* relax testcase and make ppc64 buildbots happy.Adrian Prantl2014-02-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201250 91177308-0d34-0410-b5e6-96231b3b80d8
* Document and improve the debug-property-synth.m test based on theAdrian Prantl2014-02-12
| | | | | | information provided in the referenced radar. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201248 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Remove bad debug info test."Adrian Prantl2014-02-12
| | | | | | | | This reverts commit r201183. The test, albeit undocumented and badly written is still testing something useful. It will be updated in a subsequent commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201247 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove bad debug info test.David Blaikie2014-02-11
| | | | | | | | | | Another test that's testing through assembly from Clang which is problematic. An attempt to upgrade this to just be an IR-generation test was unsuccessful (I was unable to get this test to fail) but it looks like there's other, better, test coverage in this area (test/CodeGenObjC/debuginfo-properties.m) anyway. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201183 91177308-0d34-0410-b5e6-96231b3b80d8
* Use an Itanium triple in DWARF debug info testsTimur Iskhodzhanov2014-01-30
| | | | | | This should fix the clang part of the breakage in r200340. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200435 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C [IRGen]. Generator a tail call to objc_getProperty() in Fariborz Jahanian2014-01-30
| | | | | | | | synthesized getters for performance improvement. // rdar://15884113 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200430 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. provide legacy encoding of *id and *Class typesFariborz Jahanian2014-01-28
| | | | | | | instead of crashing. // rdar://15824769. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200338 91177308-0d34-0410-b5e6-96231b3b80d8
* Use private linkage for utf-16 objc strings too.Rafael Espindola2014-01-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199709 91177308-0d34-0410-b5e6-96231b3b80d8
* Give explicit sections for string constants used in NSStrings.Rafael Espindola2014-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without them they can be merged with non unnamed_addr constants during LTO. The resulting constant is not unnamed_addr and goes in a different section, which causes ld64 to crash. A testcase that would crash before: * file1.mm: void g(id notification) { [notification valueForKey:@"name"]; } * file2.cpp: extern const char js_name_str[] = "name"; * file3.cpp extern bool JS_GetProperty(const char *name); extern const char js_name_str[]; bool js_ReportUncaughtException() { JS_GetProperty(js_name_str); } run clang file1.mm -o file1.o -c -w -emit-llvm clang file2.cpp -o file2.o -c -w -emit-llvm clang file3.cpp -o file3.o -c -w ld -dylib -o XUL file1.o file2.o file3.o -undefined dynamic_lookup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199688 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a triple. Should fix the 64 bit bots.Rafael Espindola2014-01-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199670 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the test more strict.Rafael Espindola2014-01-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199669 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the -cxx-abi command-line flag.Hans Wennborg2014-01-14
| | | | | | | | | | | | | | | This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples, Itanium otherwise. It's no longer possible to do weird combinations. To be able to run a test with a specific ABI without constraining it to a specific triple, new substitutions are added to lit: %itanium_abi_triple and %ms_abi_triple can be used to get the current target triple adjusted to the desired ABI. For example, if the test suite is running with the i686-pc-win32 target, %itanium_abi_triple will expand to i686-pc-mingw32. Differential Revision: http://llvm-reviews.chandlerc.com/D2545 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199250 91177308-0d34-0410-b5e6-96231b3b80d8
* Update tests in preparation for using the MS ABI for Win32 targetsHans Wennborg2014-01-13
| | | | | | | | | | In preparation for making the Win32 triple imply MS ABI mode, make all tests pass in this mode, or make them use the Itanium mode explicitly. Differential Revision: http://llvm-reviews.chandlerc.com/D2401 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199130 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-applying r198699 after reverting r198461.Adrian Prantl2014-01-07
| | | | | | | | Debug info: Implement a cleaner version of r198461. For symmetry with C and C++ don't emit an extra lexical scope for the compound statement that is the body of an Objective-C method. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198715 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Debug info: Ensure that the last stop point in a function is still ↵Adrian Prantl2014-01-07
| | | | | | | | within" This reverts commit r198461. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198714 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Debug info: Implement a cleaner version of r198461. For symmetry with"Adrian Prantl2014-01-07
| | | | | | This reverts commit 198699 so we can get a cleaner patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198713 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug info: Implement a cleaner version of r198461. For symmetry withAdrian Prantl2014-01-07
| | | | | | | | | C and C++ don't emit an extra lexical scope for the compound statement that is the body of an Objective-C method. rdar://problem/15010825 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198699 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug info: Ensure that the last stop point in a function is still withinAdrian Prantl2014-01-03
| | | | | | | | | the lexical block formed by the compound statement that is the function body. rdar://problem/15010825 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198461 91177308-0d34-0410-b5e6-96231b3b80d8