r244193 - [ObjC] Circular containers: add support of subclasses

2015-08-05 Thread Alex Denisov
Author: alexdenisov
Date: Wed Aug  5 23:51:14 2015
New Revision: 244193

URL: http://llvm.org/viewvc/llvm-project?rev=244193&view=rev
Log:
[ObjC] Circular containers: add support of subclasses


Modified:
cfe/trunk/include/clang/AST/NSAPI.h
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/lib/AST/NSAPI.cpp
cfe/trunk/lib/Sema/SemaChecking.cpp
cfe/trunk/test/SemaObjC/circular-container.m

Modified: cfe/trunk/include/clang/AST/NSAPI.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/NSAPI.h?rev=244193&r1=244192&r2=244193&view=diff
==
--- cfe/trunk/include/clang/AST/NSAPI.h (original)
+++ cfe/trunk/include/clang/AST/NSAPI.h Wed Aug  5 23:51:14 2015
@@ -16,6 +16,7 @@
 
 namespace clang {
   class ASTContext;
+  class ObjCInterfaceDecl;
   class QualType;
   class Expr;
 
@@ -35,11 +36,10 @@ public:
 ClassId_NSMutableDictionary,
 ClassId_NSNumber,
 ClassId_NSMutableSet,
-ClassId_NSCountedSet,
 ClassId_NSMutableOrderedSet,
 ClassId_NSValue
   };
-  static const unsigned NumClassIds = 11;
+  static const unsigned NumClassIds = 10;
 
   enum NSStringMethodKind {
 NSStr_stringWithString,
@@ -220,6 +220,10 @@ public:
   /// \brief Returns \c true if \p Id is currently defined as a macro.
   bool isMacroDefined(StringRef Id) const;
 
+  /// \brief Returns \c true if \p InterfaceDecl is subclass of \p NSClassKind
+  bool isSubclassOfNSClass(ObjCInterfaceDecl *InterfaceDecl,
+   NSClassIdKindKind NSClassKind) const;
+
 private:
   bool isObjCTypedef(QualType T, StringRef name, IdentifierInfo *&II) const;
   bool isObjCEnumerator(const Expr *E,

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=244193&r1=244192&r2=244193&view=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Wed Aug  5 23:51:14 
2015
@@ -5370,7 +5370,7 @@ def err_objc_object_catch : Error<
 def err_incomplete_type_objc_at_encode : Error<
   "'@encode' of incomplete type %0">;
 def warn_objc_circular_container : Warning<
-  "adding '%0' to '%0' might cause circular dependency in container">,
+  "adding '%0' to '%1' might cause circular dependency in container">,
   InGroup>;
 def note_objc_circular_container_declared_here : Note<"'%0' declared here">;
 

Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=244193&r1=244192&r2=244193&view=diff
==
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Wed Aug  5 23:51:14 2015
@@ -729,27 +729,12 @@ public:
   /// \brief The declaration of the Objective-C NSArray class.
   ObjCInterfaceDecl *NSArrayDecl;
 
-  /// \brief Pointer to NSMutableArray type (NSMutableArray *).
-  QualType NSMutableArrayPointer;
-
   /// \brief The declaration of the arrayWithObjects:count: method.
   ObjCMethodDecl *ArrayWithObjectsMethod;
 
   /// \brief The declaration of the Objective-C NSDictionary class.
   ObjCInterfaceDecl *NSDictionaryDecl;
 
-  /// \brief Pointer to NSMutableDictionary type (NSMutableDictionary *).
-  QualType NSMutableDictionaryPointer;
-
-  /// \brief Pointer to NSMutableSet type (NSMutableSet *).
-  QualType NSMutableSetPointer;
-
-  /// \brief Pointer to NSCountedSet type (NSCountedSet *).
-  QualType NSCountedSetPointer;
-
-  /// \brief Pointer to NSMutableOrderedSet type (NSMutableOrderedSet *).
-  QualType NSMutableOrderedSetPointer;
-
   /// \brief The declaration of the dictionaryWithObjects:forKeys:count: 
method.
   ObjCMethodDecl *DictionaryWithObjectsMethod;
 

Modified: cfe/trunk/lib/AST/NSAPI.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/NSAPI.cpp?rev=244193&r1=244192&r2=244193&view=diff
==
--- cfe/trunk/lib/AST/NSAPI.cpp (original)
+++ cfe/trunk/lib/AST/NSAPI.cpp Wed Aug  5 23:51:14 2015
@@ -9,6 +9,7 @@
 
 #include "clang/AST/NSAPI.h"
 #include "clang/AST/ASTContext.h"
+#include "clang/AST/DeclObjC.h"
 #include "clang/AST/Expr.h"
 #include "llvm/ADT/StringSwitch.h"
 
@@ -29,7 +30,6 @@ IdentifierInfo *NSAPI::getNSClassId(NSCl
 "NSMutableDictionary",
 "NSNumber",
 "NSMutableSet",
-"NSCountedSet",
 "NSMutableOrderedSet",
 "NSValue"
   };
@@ -511,6 +511,26 @@ bool NSAPI::isMacroDefined(StringRef Id)
   return Ctx.Idents.get(Id).hasMacroDefinition();
 }
 
+bool NSAPI::isSubclassOfNSClass(ObjCInterfaceDecl *InterfaceDecl,
+NSClassIdKindKind NSClassKind) const {
+  if (!InterfaceDecl

r245731 - [SemaObjC] Remove unused code from test.

2015-08-21 Thread Alex Denisov via cfe-commits
Author: alexdenisov
Date: Fri Aug 21 15:28:16 2015
New Revision: 245731

URL: http://llvm.org/viewvc/llvm-project?rev=245731&view=rev
Log:
[SemaObjC] Remove unused code from test.
Patch by modocache (Brian Gesiak).


Modified:
cfe/trunk/test/SemaObjC/access-property-getter.m

Modified: cfe/trunk/test/SemaObjC/access-property-getter.m
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/access-property-getter.m?rev=245731&r1=245730&r2=245731&view=diff
==
--- cfe/trunk/test/SemaObjC/access-property-getter.m (original)
+++ cfe/trunk/test/SemaObjC/access-property-getter.m Fri Aug 21 15:28:16 2015
@@ -1,53 +1,17 @@
 // RUN: %clang_cc1 -verify %s
 
-@protocol NSObject
-- (oneway void)release;
+@protocol Protocol
+- (oneway void) method;
 @end
 
-@protocol XCOutputStreams 
-@end
-
-
-@interface XCWorkQueueCommandInvocation 
-{
-id  _outputStream;
-}
-@end
-
-@interface XCWorkQueueCommandSubprocessInvocation : 
XCWorkQueueCommandInvocation
-@end
-
-@interface XCWorkQueueCommandLocalSubprocessInvocation : 
XCWorkQueueCommandSubprocessInvocation
-@end
-
-@interface XCWorkQueueCommandDistributedSubprocessInvocation : 
XCWorkQueueCommandSubprocessInvocation
-@end
-
-@interface XCWorkQueueCommandCacheFetchInvocation : 
XCWorkQueueCommandSubprocessInvocation
-
-@end
-
-@implementation XCWorkQueueCommandCacheFetchInvocation
-- (id)harvestPredictivelyProcessedOutputFiles
-{
- _outputStream.release;// expected-warning {{property access result 
unused - getters should not be used for side effects}}
- return 0;
+void accessMethodViaPropertySyntaxAndTriggerWarning(id object) {
+object.method; // expected-warning {{property access result unused - 
getters should not be used for side effects}}
 }
-@end
 
 // rdar://19137815
 #pragma clang diagnostic ignored "-Wunused-getter-return-value"
 
-@interface NSObject @end
-
-@interface I : NSObject
-@property (copy) id window;
-@end
-
-@implementation I
-- (void) Meth {
-  [self window];
-  self.window;
+void 
accessMethodViaPropertySyntaxWhenWarningIsIgnoredDoesNotTriggerWarning(id
 object) {
+object.method;
 }
-@end
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] Add ObjCBoxable handling to ObjCMigrator

2016-02-14 Thread Alex Denisov via cfe-commits
Rebased against trunk:



objc_migrator_objc_boxable.patch
Description: Binary data


--
AlexDenisov
Software Engineer, http://lowlevelbits.org

> On 05 Dec 2015, at 22:19, John McCall  wrote:
> 
>> On Dec 5, 2015, at 7:58 AM, AlexDenisov <1101.deb...@gmail.com> wrote:
>> Extend ObjCMigrator to cover automatic migration from message sending to 
>> boxable literals, e.g.:
>> 
>> ```before
>> typedef struct __attribute__((objc_boxable)) CGRect CGRect;
>> /// ...
>> CGRect rect;
>> [NSValue valueWithBytes:&rect objCType:@encode(CGRect)];
>> [NSValue valueWithCGPoint:functionReturningCGPoint()];
>> ```
>> 
>> ```after
>> typedef struct __attribute__((objc_boxable)) CGRect CGRect;
>> /// ...
>> CGRect rect;
>> @(rect);
>> @(functionReturningCGPoint());
>> ```
>> 
>> I will appreciate any ideas how to improve it since the implementation is 
>> far from beautiful.
>> 
>> 
> 
> CC’ing Argyrios, who knows the migration code much better than I do.
> 
> John.



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r269559 - ModuleMap.h: Fix a \param. [-Wdocumentation]

2016-05-14 Thread Alex Denisov via cfe-commits

> On 14 May 2016, at 14:37, NAKAMURA Takumi via cfe-commits 
>  wrote:
> 
> -  /// \param Filename The umbreall header to collect.
> +  /// \param Header The umbreall header to collect.

s/Umbreall/Umbrella/


signature.asc
Description: Message signed with OpenPGP using GPGMail
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r266516 - Replace hardcoded comment at 'lit.site.cfg.in'

2016-04-16 Thread Alex Denisov via cfe-commits
Author: alexdenisov
Date: Sat Apr 16 01:54:46 2016
New Revision: 266516

URL: http://llvm.org/viewvc/llvm-project?rev=266516&view=rev
Log:
Replace hardcoded comment at 'lit.site.cfg.in'

At the moment almost every lit.site.cfg.in contains two lines comment:

  ## Autogenerated by LLVM/Clang configuration.
  # Do not edit!

The patch adds variable LIT_SITE_CFG_IN_HEADER, that is replaced from
configure_lit_site_cfg with the note and some useful information.


Modified:
cfe/trunk/test/Unit/lit.site.cfg.in
cfe/trunk/test/lit.site.cfg.in
cfe/trunk/utils/perf-training/lit.site.cfg.in
cfe/trunk/utils/perf-training/order-files.lit.site.cfg.in

Modified: cfe/trunk/test/Unit/lit.site.cfg.in
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Unit/lit.site.cfg.in?rev=266516&r1=266515&r2=266516&view=diff
==
--- cfe/trunk/test/Unit/lit.site.cfg.in (original)
+++ cfe/trunk/test/Unit/lit.site.cfg.in Sat Apr 16 01:54:46 2016
@@ -1,7 +1,7 @@
+@LIT_SITE_CFG_IN_HEADER@
+
 import sys
 
-## Autogenerated by LLVM/Clang configuration.
-# Do not edit!
 config.llvm_src_root = "@LLVM_SOURCE_DIR@"
 config.llvm_obj_root = "@LLVM_BINARY_DIR@"
 config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"

Modified: cfe/trunk/test/lit.site.cfg.in
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/lit.site.cfg.in?rev=266516&r1=266515&r2=266516&view=diff
==
--- cfe/trunk/test/lit.site.cfg.in (original)
+++ cfe/trunk/test/lit.site.cfg.in Sat Apr 16 01:54:46 2016
@@ -1,7 +1,7 @@
+@LIT_SITE_CFG_IN_HEADER@
+
 import sys
 
-## Autogenerated by LLVM/Clang configuration.
-# Do not edit!
 config.llvm_src_root = "@LLVM_SOURCE_DIR@"
 config.llvm_obj_root = "@LLVM_BINARY_DIR@"
 config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"

Modified: cfe/trunk/utils/perf-training/lit.site.cfg.in
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/perf-training/lit.site.cfg.in?rev=266516&r1=266515&r2=266516&view=diff
==
--- cfe/trunk/utils/perf-training/lit.site.cfg.in (original)
+++ cfe/trunk/utils/perf-training/lit.site.cfg.in Sat Apr 16 01:54:46 2016
@@ -1,7 +1,7 @@
+@LIT_SITE_CFG_IN_HEADER@
+
 import sys
 
-## Autogenerated by LLVM/Clang configuration.
-# Do not edit!
 config.clang_tools_dir = "@CLANG_TOOLS_DIR@"
 config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
 config.test_source_root = "@CMAKE_CURRENT_SOURCE_DIR@"

Modified: cfe/trunk/utils/perf-training/order-files.lit.site.cfg.in
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/perf-training/order-files.lit.site.cfg.in?rev=266516&r1=266515&r2=266516&view=diff
==
--- cfe/trunk/utils/perf-training/order-files.lit.site.cfg.in (original)
+++ cfe/trunk/utils/perf-training/order-files.lit.site.cfg.in Sat Apr 16 
01:54:46 2016
@@ -1,7 +1,7 @@
+@LIT_SITE_CFG_IN_HEADER@
+
 import sys
 
-## Autogenerated by LLVM/Clang configuration.
-# Do not edit!
 config.clang_tools_dir = "@CLANG_TOOLS_DIR@"
 config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
 config.test_source_root = "@CMAKE_CURRENT_SOURCE_DIR@"


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] r266518 - Replace hardcoded comment at 'lit.site.cfg.in'

2016-04-16 Thread Alex Denisov via cfe-commits
Author: alexdenisov
Date: Sat Apr 16 02:01:42 2016
New Revision: 266518

URL: http://llvm.org/viewvc/llvm-project?rev=266518&view=rev
Log:
Replace hardcoded comment at 'lit.site.cfg.in'

At the moment almost every lit.site.cfg.in contains two lines comment:

  ## Autogenerated by LLVM/Clang configuration.
  # Do not edit!

The patch adds variable LIT_SITE_CFG_IN_HEADER, that is replaced from
configure_lit_site_cfg with the note and some useful information.


Modified:
clang-tools-extra/trunk/test/Unit/lit.site.cfg.in
clang-tools-extra/trunk/test/lit.site.cfg.in

Modified: clang-tools-extra/trunk/test/Unit/lit.site.cfg.in
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/Unit/lit.site.cfg.in?rev=266518&r1=266517&r2=266518&view=diff
==
--- clang-tools-extra/trunk/test/Unit/lit.site.cfg.in (original)
+++ clang-tools-extra/trunk/test/Unit/lit.site.cfg.in Sat Apr 16 02:01:42 2016
@@ -1,5 +1,5 @@
-## Autogenerated by LLVM/Clang configuration.
-# Do not edit!
+@LIT_SITE_CFG_IN_HEADER@
+
 config.extra_tools_obj_dir = "@CLANG_TOOLS_BINARY_DIR@/unittests"
 config.extra_tools_src_dir = "@CLANG_TOOLS_SOURCE_DIR@/unittests"
 config.llvm_libs_dir = "@LLVM_LIBS_DIR@"

Modified: clang-tools-extra/trunk/test/lit.site.cfg.in
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/lit.site.cfg.in?rev=266518&r1=266517&r2=266518&view=diff
==
--- clang-tools-extra/trunk/test/lit.site.cfg.in (original)
+++ clang-tools-extra/trunk/test/lit.site.cfg.in Sat Apr 16 02:01:42 2016
@@ -1,7 +1,7 @@
+@LIT_SITE_CFG_IN_HEADER@
+
 import sys
 
-## Autogenerated by LLVM/Clang configuration.
-# Do not edit!
 config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
 config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
 config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] [clang] Emit ObjC method and block annotation attributes to IR

2016-05-23 Thread Alex Denisov via cfe-commits
John McCall may know particular reasons why these annotations are not 
propagated to IR level.

> On 19 May 2016, at 19:37, Max Bazaliy via cfe-commits 
>  wrote:
> 
> Hey,
> 
> For some reason clang does not emit ObjC method and block annotations to IR. 
> Here is a fix for that.
> 
> --
> Max Bazaliy
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] Add ObjCBoxable handling to ObjCMigrator

2016-01-06 Thread Alex Denisov via cfe-commits
Any updates? :)
--
AlexDenisov
Software Engineer, http://lowlevelbits.org

> On 05 Dec 2015, at 22:19, John McCall  wrote:
> 
>> On Dec 5, 2015, at 7:58 AM, AlexDenisov <1101.deb...@gmail.com> wrote:
>> Extend ObjCMigrator to cover automatic migration from message sending to 
>> boxable literals, e.g.:
>> 
>> ```before
>> typedef struct __attribute__((objc_boxable)) CGRect CGRect;
>> /// ...
>> CGRect rect;
>> [NSValue valueWithBytes:&rect objCType:@encode(CGRect)];
>> [NSValue valueWithCGPoint:functionReturningCGPoint()];
>> ```
>> 
>> ```after
>> typedef struct __attribute__((objc_boxable)) CGRect CGRect;
>> /// ...
>> CGRect rect;
>> @(rect);
>> @(functionReturningCGPoint());
>> ```
>> 
>> I will appreciate any ideas how to improve it since the implementation is 
>> far from beautiful.
>> 
>> 
> 
> CC’ing Argyrios, who knows the migration code much better than I do.
> 
> John.



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits