summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add a comment to explain how the decision to pass feature "+long-calls" is made.Akira Hatanaka2015-07-071-0/+3
| | | | llvm-svn: 241568
* Fix gcc warnings of different enum and non-enum types in ternariesDenis Protivensky2015-07-072-9/+9
| | | | llvm-svn: 241567
* [ARM] Define a subtarget feature and use it to decide whether long calls shouldAkira Hatanaka2015-07-0710-21/+63
| | | | | | | | | | | | | | | | | be emitted. This is needed to enable ARM long calls for LTO and enable and disable it on a per-function basis. Out-of-tree projects currently using EnableARMLongCalls to emit long calls should start passing "+long-calls" to the feature string (see the changes made to clang in r241565). rdar://problem/21529937 Differential Revision: http://reviews.llvm.org/D9364 llvm-svn: 241566
* [ARM] Pass subtarget feature "+long-calls" instead of passing backend optionAkira Hatanaka2015-07-074-20/+21
| | | | | | | | | | | | | "-arm-long-calls". This change allows using -mlong-calls/-mno-long-calls for LTO and enabling or disabling long call on a per-function basis. rdar://problem/21529937 Differential Revision: http://reviews.llvm.org/D9414 llvm-svn: 241565
* Don't rely on the use of non-POD types within unions.Douglas Gregor2015-07-072-5/+16
| | | | | | | They aren't universally supported and we're not getting any benefit from using them. llvm-svn: 241564
* s/__nonnull/_Nonnull in a test for Objective-C __kindof.Douglas Gregor2015-07-071-1/+1
| | | | llvm-svn: 241563
* [AST] Add a comment for ObjCMethodDecl::getSendResultType() function.Douglas Gregor2015-07-071-1/+3
| | | | llvm-svn: 241562
* [libclang] Implement proper code-completion in an ObjC type parameter position.Douglas Gregor2015-07-074-2/+35
| | | | | | rdar://19670303 llvm-svn: 241561
* [libclang] When inferring nonnull use the contextual keyword for the ↵Douglas Gregor2015-07-072-1/+21
| | | | | | | | | | code-completion results, when appropriate. rdar://20742295 llvm-svn: 241560
* [libclang] Replace ObjC generic parameters when code-completing method ↵Douglas Gregor2015-07-074-5/+22
| | | | | | | | implementations. rdar://20643768 llvm-svn: 241559
* [libclang] Fix code-completion of block parameters that are marked with ↵Douglas Gregor2015-07-073-6/+26
| | | | | | | | nullability specifier. rdar://20755276 llvm-svn: 241558
* [libclang] Replace ObjC generic parameters in code-completion results.Douglas Gregor2015-07-077-48/+147
| | | | | | rdar://19369529 llvm-svn: 241557
* The AST importer had a bug where it would enter into an infinite recursionDouglas Gregor2015-07-073-17/+45
| | | | | | | | | | | | | | | | when importing type parameter lists. The reason is that type parameters have their DeclContexts set to the interface that is parameterized with those types, and the importer would follow that loop and blow the stack out. I've changed the way this works so that the type parameters are only imported after the interface that contains them has been registered via the Imported() function. This is tested by LLDB. <rdar://problem/20315663> llvm-svn: 241556
* The rest of N4279 and LWG#2464 - for unordered_mapMarshall Clow2015-07-074-2/+526
| | | | llvm-svn: 241555
* Fix alignment check for ObjCObjectTypeLoc.Douglas Gregor2015-07-071-2/+3
| | | | llvm-svn: 241554
* When debugserver is running on an iOS device, callJason Molenda2015-07-071-0/+3
| | | | | | | | | | proc_set_wakemon_params() to raise the limit on the # of wakeups per second that are acceptable before the system may send an EXC_RESOURCE signal to debugserver. <rdar://problem/19631512> llvm-svn: 241553
* Fix \param in r241472. [-Wdocumentation]NAKAMURA Takumi2015-07-071-1/+1
| | | | llvm-svn: 241552
* Use llvm::alignOf rather than alignof()Douglas Gregor2015-07-071-2/+2
| | | | llvm-svn: 241551
* Factor the simpleTransform() visitor so that it is not a local class.Douglas Gregor2015-07-071-288/+294
| | | | | | | Older versions of Clang cannot handle such local classes properly rdar://problem/19386032. llvm-svn: 241550
* Implement variance for Objective-C type parameters.Douglas Gregor2015-07-0719-31/+366
| | | | | | | | | | | | | | | Introduce co- and contra-variance for Objective-C type parameters, which allows us to express that (for example) an NSArray is covariant in its type parameter. This means that NSArray<NSMutableString *> * is a subtype of NSArray<NSString *> *, which is expected of the immutable Foundation collections. Type parameters can be annotated with __covariant or __contravariant to make them co- or contra-variant, respectively. This feature can be detected by __has_feature(objc_generics_variance). Implements rdar://problem/20217490. llvm-svn: 241549
* Implement the Objective-C __kindof type qualifier.Douglas Gregor2015-07-0726-97/+841
| | | | | | | | | | The __kindof type qualifier can be applied to Objective-C object (pointer) types to indicate id-like behavior, which includes implicit "downcasting" of __kindof types to subclasses and id-like message-send behavior. __kindof types provide better type bounds for substitutions into unspecified generic types, which preserves more type information. llvm-svn: 241548
* Warn when an intended Objective-C specialization was actually a useless ↵Douglas Gregor2015-07-077-4/+88
| | | | | | | | | | | | | | | | | | | | | | protocol qualification. Warn in cases where one has provided redundant protocol qualification that might be a typo for a specialization, e.g., NSArray<NSObject>, which is pointless (NSArray declares that it conforms to NSObject) and is likely to be a typo for NSArray<NSObject *>, i.e., an array of NSObject pointers. This warning is very narrow, only applying when the base type being qualified is parameterized, has the same number of parameters as their are protocols listed, all of the names can also refer to types (including Objective-C class types, of course), and at least one of those types is an Objective-C class (making this a typo for a missing '*'). The limitations are partly for performance reasons (we don't want to do redundant name lookup unless we really need to), and because we want the warning to apply in very limited cases to limit false positives. Part of rdar://problem/6294649. llvm-svn: 241547
* Warn when an Objective-C collection literal element is converted to an ↵Douglas Gregor2015-07-073-0/+159
| | | | | | | | | | | | incompatible type. Objective-C collection literals produce unspecialized NSArray/NSDictionary objects that can then be implicitly converted to specialized versions of these types. In such cases, check that the elements in the collection are suitable for the specialized collection. Part of rdar://problem/6294649. llvm-svn: 241546
* C++ support for Objective-C lightweight generics.Douglas Gregor2015-07-0726-365/+1377
| | | | | | | | | | | | | | | | | | | Teach C++'s tentative parsing to handle specializations of Objective-C class types (e.g., NSArray<NSString *>) as well as Objective-C protocol qualifiers (id<NSCopying>) by extending type-annotation tokens to handle this case. As part of this, remove Objective-C protocol qualifiers from the declaration specifiers, which never really made sense: instead, provide Sema entry points to make them part of the type annotation token. Among other things, this properly diagnoses bogus types such as "<NSCopying> id" which should have been written as "id <NSCopying>". Implements template instantiation support for, e.g., NSArray<T>* in C++. Note that parameterized classes are not templates in the C++ sense, so that cannot (for example) be used as a template argument for a template template parameter. Part of rdar://problem/6294649. llvm-svn: 241545
* Improve the Objective-C common-type computation used by the ternary operator.Douglas Gregor2015-07-0710-89/+250
| | | | | | | | | | | | | | | | The Objective-C common-type computation had a few problems that required a significant rework, including: - Quadradic behavior when finding the common base type; now it's linear. - Keeping around type arguments when computing the common type between a specialized and an unspecialized type - Introducing redundant protocol qualifiers. Part of rdar://problem/6294649. Also fixes rdar://problem/19572837 by addressing a longstanding bug in ASTContext::CollectInheritedProtocols(). llvm-svn: 241544
* Substitute type arguments into uses of Objective-C interface members.Douglas Gregor2015-07-0734-212/+1727
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Handle Objective-C type arguments.Douglas Gregor2015-07-0739-354/+1706
| | | | | | | | | | | | | | | | | | | | | Objective-C type arguments can be provided in angle brackets following an Objective-C interface type. Syntactically, this is the same position as one would provide protocol qualifiers (e.g., id<NSCopying>), so parse both together and let Sema sort out the ambiguous cases. This applies both when parsing types and when parsing the superclass of an Objective-C class, which can now be a specialized type (e.g., NSMutableArray<T> inherits from NSArray<T>). Check Objective-C type arguments against the type parameters of the corresponding class. Verify the length of the type argument list and that each type argument satisfies the corresponding bound. Specializations of parameterized Objective-C classes are represented in the type system as distinct types. Both specialized types (e.g., NSArray<NSString *> *) and unspecialized types (NSArray *) are represented, separately. llvm-svn: 241542
* Parsing, semantic analysis, and AST for Objective-C type parameters.Douglas Gregor2015-07-0730-92/+1425
| | | | | | | | | | | | | | | | | | | | Produce type parameter declarations for Objective-C type parameters, and attach lists of type parameters to Objective-C classes, categories, forward declarations, and extensions as appropriate. Perform semantic analysis of type bounds for type parameters, both in isolation and across classes/categories/extensions to ensure consistency. Also handle (de-)serialization of Objective-C type parameter lists, along with sundry other things one must do to add a new declaration to Clang. Note that Objective-C type parameters are typedef name declarations, like typedefs and C++11 type aliases, in support of type erasure. Part of rdar://problem/6294649. llvm-svn: 241541
* For the "ios" target add a shell script phase at the end whichJason Molenda2015-07-071-0/+16
| | | | | | | | | removes the LLDB.framework/Resources and LLDB.framework/Swift directories. This isn't a deep bundle on ios builds; it is shallow. <rdar://problem/16676101> llvm-svn: 241540
* Implement N4279 and LWG#2664 for <map>. Reviewed as ↵Marshall Clow2015-07-073-0/+512
| | | | | | http://reviews.llvm.org/D10669 llvm-svn: 241539
* COFF: Fix bug involving archives defining a symbol multiple times.Peter Collingbourne2015-07-072-1/+40
| | | | | | | | | | | Previously we were unnecessarily loading lazy symbols if they appeared in an archive multiple times, as can happen with comdat symbols. This change fixes the bug by only loading symbols from archives at load time if the original symbol was undefined. Differential Revision: http://reviews.llvm.org/D10980 llvm-svn: 241538
* MIR Parser: Verify the implicit machine register operands.Alex Lorenz2015-07-0713-31/+230
| | | | | | | | | | | | This commit verifies that the parsed machine instructions contain the implicit register operands as specified by the MCInstrDesc. Variadic and call instructions aren't verified. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10781 llvm-svn: 241537
* [StackMap Liveness] Calling the base class' getAnalysisUsage method. NFCI.Juergen Ributzka2015-07-071-2/+1
| | | | | | | | Calling into the base class' getAnalysisUsage method after we did our pass specific modifications. This shouldn't really matter since this is the last pass in the pipeline anyways. llvm-svn: 241536
* [StackMap Liveness] No need to cache the MachineFunction. NFC.Juergen Ributzka2015-07-071-22/+20
| | | | | | Don't cache the MachineFunction in the pass and range'ify some loops. llvm-svn: 241535
* Debug info: Emit distinct __block_literal_generic types for blocks withAdrian Prantl2015-07-073-12/+28
| | | | | | | | | | different function signatures. (Previously clang would emit all block pointer types with the type of the first block pointer in the compile unit.) rdar://problem/21602473 llvm-svn: 241534
* Revert "Revert 241171, 241187, 241199 (32-bit SEH)."Reid Kleckner2015-07-079-235/+386
| | | | | | | | | | | This reverts commit r241244, but restricts SEH support to Win64. This way, Chromium builds will still fall back on TUs with SEH, and Clang developers can work on this incrementally upstream while patching this small predicate locally. It'll also make it easier to review small fixes. llvm-svn: 241533
* [libcxx] Add atomic_support.h header to src that handles needed atomic ↵Eric Fiselier2015-07-076-13/+271
| | | | | | | | | | | | | | | | | | | | | operations. Summary: In some places in libc++ we need to use the `__atomic_*` builtins. This patch adds a header that provides access to those builtins in a uniform way from within the dylib source. If the compiler building the dylib does not support these builtins then a warning is issued. Only relaxed loads are needed within the headers. A singe function to do these relaxed loads has been added to `<memory>`. This patch applies the new atomic builtins to `__shared_count` and `call_once`. Reviewers: mclow.lists Subscribers: majnemer, jroelofs, cfe-commits Differential Revision: http://reviews.llvm.org/D10406 llvm-svn: 241532
* Add a summary for vector typesEnrico Granata2015-07-075-3/+99
| | | | | | | | | | | | The summary is - quite simply - a one-line printout of the vector elements We still need synthetic children: a) as a source of the elements to print in the summary b) for graphical IDEs that display structure regardless of the summary settings rdar://5429347 llvm-svn: 241531
* Fix undefined behaviour exposed by the new -Wshift-negative-value warning.Davide Italiano2015-07-071-1/+1
| | | | llvm-svn: 241530
* Remember to mark the target attribute as documented and clean up theEric Christopher2015-07-071-3/+2
| | | | | | Subjects line to avoid redundancy. llvm-svn: 241529
* [Driver] Use llvm::Triple methods to handle -EL and -EB.Benjamin Kramer2015-07-062-12/+15
| | | | | | Add a test for ppc64(le), which wasn't handled before. llvm-svn: 241528
* [Triple] Add a helper to switch between big/little endian variantsBenjamin Kramer2015-07-063-0/+210
| | | | | | This will be used from clang's driver. llvm-svn: 241527
* Update target attribute support for post-commit feedback.Eric Christopher2015-07-062-2/+2
| | | | | | | Use const auto rather than duplicating the type name and fix the error message when the attribute is applied to an incorrect entity. llvm-svn: 241526
* Handle arbitrary whitespace in the target attribute support.Eric Christopher2015-07-062-1/+8
| | | | | | | This allows us to deal a bit more gracefully with inclusions done by macros, token pasting, or just code layout/formatting. llvm-svn: 241525
* Add some basic documentation for the __attribute__((target(""))) support.Eric Christopher2015-07-061-0/+19
| | | | | | | | Describes the general syntax of how it's used with the unfortunate usage of "subtarget features" and some examples from the x86 port to help users. llvm-svn: 241524
* Make UnitTestMain/TestMain.cpp free from llvm/Config/config.h.NAKAMURA Takumi2015-07-061-3/+2
| | | | | | llvm/Config/config.h is unavailable outside of build tree. llvm-svn: 241523
* Make the "lldb/Utility/JSON.h" able to parse JSON into tokens with the new ↵Greg Clayton2015-07-067-330/+714
| | | | | | | | | | JSONParser class. Change over existing code to use this new parser so StructuredData can use the tokenizer to parse JSON instead of doing it manually. This allowed us to easily parse JSON into JSON* objects as well as into StructuredData. llvm-svn: 241522
* [FaultMaps] Add statistic to count the # of implicit null checks.Sanjoy Das2015-07-061-0/+8
| | | | llvm-svn: 241521
* [WebAssembly] Create a CodeGen unittest directory.Dan Gohman2015-07-061-0/+2
| | | | llvm-svn: 241520
* MIR Serialization: Serialize the implicit register flag.Alex Lorenz2015-07-067-23/+119
| | | | | | | | | | | | | | This commit serializes the implicit flag for the register machine operands. It introduces two new keywords into the machine instruction syntax: 'implicit' and 'implicit-def'. The 'implicit' keyword is used for the implicit register operands, and the 'implicit-def' keyword is used for the register operands that have both the implicit and the define flags set. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10709 llvm-svn: 241519
OpenPOWER on IntegriCloud