<div dir="ltr">Is it possible to give a short motivation in your CL descriptions?</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 28, 2014 at 11:28 AM, Fariborz Jahanian <span dir="ltr"><<a href="mailto:fjahanian@apple.com" target="_blank">fjahanian@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: fjahanian<br>
Date: Tue Oct 28 13:28:16 2014<br>
New Revision: 220812<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=220812&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=220812&view=rev</a><br>
Log:<br>
Objective-C. revert patch for rdar://17554063.<br>
<br>
<br>
Modified:<br>
cfe/trunk/include/clang/AST/ExprObjC.h<br>
cfe/trunk/include/clang/AST/NSAPI.h<br>
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br>
cfe/trunk/include/clang/Sema/Sema.h<br>
cfe/trunk/lib/AST/Expr.cpp<br>
cfe/trunk/lib/AST/NSAPI.cpp<br>
cfe/trunk/lib/CodeGen/CGObjC.cpp<br>
cfe/trunk/lib/CodeGen/CodeGenFunction.h<br>
cfe/trunk/lib/Sema/Sema.cpp<br>
cfe/trunk/lib/Sema/SemaExprObjC.cpp<br>
cfe/trunk/lib/Serialization/ASTReaderStmt.cpp<br>
cfe/trunk/lib/Serialization/ASTWriterStmt.cpp<br>
cfe/trunk/test/CodeGenObjC/Inputs/literal-support.h<br>
cfe/trunk/test/CodeGenObjC/arc-literals.m<br>
cfe/trunk/test/CodeGenObjCXX/Inputs/literal-support.h<br>
cfe/trunk/test/CodeGenObjCXX/<a href="http://literals.mm" target="_blank">literals.mm</a><br>
cfe/trunk/test/SemaObjC/arc.m<br>
cfe/trunk/test/SemaObjC/objc-literal-comparison.m<br>
cfe/trunk/tools/libclang/IndexBody.cpp<br>
<br>
Modified: cfe/trunk/include/clang/AST/ExprObjC.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprObjC.h?rev=220812&r1=220811&r2=220812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprObjC.h?rev=220812&r1=220811&r2=220812&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/AST/ExprObjC.h (original)<br>
+++ cfe/trunk/include/clang/AST/ExprObjC.h Tue Oct 28 13:28:16 2014<br>
@@ -134,13 +134,9 @@ class ObjCArrayLiteral : public Expr {<br>
unsigned NumElements;<br>
SourceRange Range;<br>
ObjCMethodDecl *ArrayWithObjectsMethod;<br>
- /// \brief in arc mode, this field holds array allocation method declaration.<br>
- /// In MRR mode, it is null<br>
- ObjCMethodDecl *ArrayAllocMethod;<br>
<br>
ObjCArrayLiteral(ArrayRef<Expr *> Elements,<br>
QualType T, ObjCMethodDecl * Method,<br>
- ObjCMethodDecl *allocMethod,<br>
SourceRange SR);<br>
<br>
explicit ObjCArrayLiteral(EmptyShell Empty, unsigned NumElements)<br>
@@ -150,7 +146,6 @@ public:<br>
static ObjCArrayLiteral *Create(const ASTContext &C,<br>
ArrayRef<Expr *> Elements,<br>
QualType T, ObjCMethodDecl * Method,<br>
- ObjCMethodDecl *allocMethod,<br>
SourceRange SR);<br>
<br>
static ObjCArrayLiteral *CreateEmpty(const ASTContext &C,<br>
@@ -189,10 +184,6 @@ public:<br>
return ArrayWithObjectsMethod;<br>
}<br>
<br>
- ObjCMethodDecl *getArrayAllocMethod() const {<br>
- return ArrayAllocMethod;<br>
- }<br>
-<br>
// Iterators<br>
child_range children() {<br>
return child_range((Stmt **)getElements(),<br>
@@ -265,15 +256,10 @@ class ObjCDictionaryLiteral : public Exp<br>
<br>
SourceRange Range;<br>
ObjCMethodDecl *DictWithObjectsMethod;<br>
-<br>
- /// \brief for arc-specific dictionary literals, this field is used to store<br>
- /// NSDictionary allocation method declaration. It is null for MRR mode.<br>
- ObjCMethodDecl *DictAllocMethod;<br>
<br>
ObjCDictionaryLiteral(ArrayRef<ObjCDictionaryElement> VK,<br>
bool HasPackExpansions,<br>
QualType T, ObjCMethodDecl *method,<br>
- ObjCMethodDecl *allocMethod,<br>
SourceRange SR);<br>
<br>
explicit ObjCDictionaryLiteral(EmptyShell Empty, unsigned NumElements,<br>
@@ -308,7 +294,6 @@ public:<br>
ArrayRef<ObjCDictionaryElement> VK,<br>
bool HasPackExpansions,<br>
QualType T, ObjCMethodDecl *method,<br>
- ObjCMethodDecl *allocMethod,<br>
SourceRange SR);<br>
<br>
static ObjCDictionaryLiteral *CreateEmpty(const ASTContext &C,<br>
@@ -335,9 +320,6 @@ public:<br>
ObjCMethodDecl *getDictWithObjectsMethod() const<br>
{ return DictWithObjectsMethod; }<br>
<br>
- ObjCMethodDecl *getDictAllocMethod() const<br>
- { return DictAllocMethod; }<br>
-<br>
SourceLocation getLocStart() const LLVM_READONLY { return Range.getBegin(); }<br>
SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); }<br>
SourceRange getSourceRange() const LLVM_READONLY { return Range; }<br>
<br>
Modified: cfe/trunk/include/clang/AST/NSAPI.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/NSAPI.h?rev=220812&r1=220811&r2=220812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/NSAPI.h?rev=220812&r1=220811&r2=220812&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/AST/NSAPI.h (original)<br>
+++ cfe/trunk/include/clang/AST/NSAPI.h Tue Oct 28 13:28:16 2014<br>
@@ -77,10 +77,9 @@ public:<br>
NSArr_initWithArray,<br>
NSArr_initWithObjects,<br>
NSArr_objectAtIndex,<br>
- NSMutableArr_replaceObjectAtIndex,<br>
- NSArr_initWithObjectsCount<br>
+ NSMutableArr_replaceObjectAtIndex<br>
};<br>
- static const unsigned NumNSArrayMethods = 10;<br>
+ static const unsigned NumNSArrayMethods = 9;<br>
<br>
/// \brief The Objective-C NSArray selectors.<br>
Selector getNSArraySelector(NSArrayMethodKind MK) const;<br>
<br>
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=220812&r1=220811&r2=220812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=220812&r1=220811&r2=220812&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)<br>
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Tue Oct 28 13:28:16 2014<br>
@@ -2046,8 +2046,6 @@ def err_undeclared_nsarray : Error<<br>
def err_undeclared_nsdictionary : Error<<br>
"NSDictionary must be available to use Objective-C dictionary "<br>
"literals">;<br>
-def err_undeclared_alloc : Error<<br>
- "alloc must be available to use Objective-C literals">;<br>
def err_undeclared_boxing_method : Error<<br>
"declaration of %0 is missing in %1 class">;<br>
def err_objc_literal_method_sig : Error<<br>
<br>
Modified: cfe/trunk/include/clang/Sema/Sema.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=220812&r1=220811&r2=220812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=220812&r1=220811&r2=220812&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Sema/Sema.h (original)<br>
+++ cfe/trunk/include/clang/Sema/Sema.h Tue Oct 28 13:28:16 2014<br>
@@ -681,24 +681,12 @@ public:<br>
<br>
/// \brief The declaration of the arrayWithObjects:count: method.<br>
ObjCMethodDecl *ArrayWithObjectsMethod;<br>
-<br>
- /// \brief The declaration of the initWithObjects:count: method.<br>
- ObjCMethodDecl *InitArrayWithObjectsMethod;<br>
<br>
/// \brief The declaration of the Objective-C NSDictionary class.<br>
ObjCInterfaceDecl *NSDictionaryDecl;<br>
<br>
/// \brief The declaration of the dictionaryWithObjects:forKeys:count: method.<br>
ObjCMethodDecl *DictionaryWithObjectsMethod;<br>
-<br>
- /// \brief The declaration of the initWithObjects:forKeys:count: method.<br>
- ObjCMethodDecl *InitDictionaryWithObjectsMethod;<br>
-<br>
- /// \brief The declaration for + (id) alloc method used in [NSArray alloc]<br>
- ObjCMethodDecl *ArrayAllocObjectsMethod;<br>
-<br>
- /// \brief The declaration for + (id) alloc method used in [NSDictionary alloc]<br>
- ObjCMethodDecl *DictAllocObjectsMethod;<br>
<br>
/// \brief id<NSCopying> type.<br>
QualType QIDNSCopying;<br>
<br>
Modified: cfe/trunk/lib/AST/Expr.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=220812&r1=220811&r2=220812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=220812&r1=220811&r2=220812&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/Expr.cpp (original)<br>
+++ cfe/trunk/lib/AST/Expr.cpp Tue Oct 28 13:28:16 2014<br>
@@ -4082,12 +4082,10 @@ Stmt::child_range ObjCMessageExpr::child<br>
<br>
ObjCArrayLiteral::ObjCArrayLiteral(ArrayRef<Expr *> Elements,<br>
QualType T, ObjCMethodDecl *Method,<br>
- ObjCMethodDecl *AllocMethod,<br>
SourceRange SR)<br>
: Expr(ObjCArrayLiteralClass, T, VK_RValue, OK_Ordinary,<br>
false, false, false, false),<br>
- NumElements(Elements.size()), Range(SR), ArrayWithObjectsMethod(Method),<br>
- ArrayAllocMethod(AllocMethod)<br>
+ NumElements(Elements.size()), Range(SR), ArrayWithObjectsMethod(Method)<br>
{<br>
Expr **SaveElements = getElements();<br>
for (unsigned I = 0, N = Elements.size(); I != N; ++I) {<br>
@@ -4105,11 +4103,10 @@ ObjCArrayLiteral::ObjCArrayLiteral(Array<br>
ObjCArrayLiteral *ObjCArrayLiteral::Create(const ASTContext &C,<br>
ArrayRef<Expr *> Elements,<br>
QualType T, ObjCMethodDecl * Method,<br>
- ObjCMethodDecl *allocMethod,<br>
SourceRange SR) {<br>
void *Mem = C.Allocate(sizeof(ObjCArrayLiteral)<br>
+ Elements.size() * sizeof(Expr *));<br>
- return new (Mem) ObjCArrayLiteral(Elements, T, Method, allocMethod, SR);<br>
+ return new (Mem) ObjCArrayLiteral(Elements, T, Method, SR);<br>
}<br>
<br>
ObjCArrayLiteral *ObjCArrayLiteral::CreateEmpty(const ASTContext &C,<br>
@@ -4124,13 +4121,11 @@ ObjCDictionaryLiteral::ObjCDictionaryLit<br>
ArrayRef<ObjCDictionaryElement> VK,<br>
bool HasPackExpansions,<br>
QualType T, ObjCMethodDecl *method,<br>
- ObjCMethodDecl *allocMethod,<br>
SourceRange SR)<br>
: Expr(ObjCDictionaryLiteralClass, T, VK_RValue, OK_Ordinary, false, false,<br>
false, false),<br>
NumElements(VK.size()), HasPackExpansions(HasPackExpansions), Range(SR),<br>
- DictWithObjectsMethod(method),<br>
- DictAllocMethod(allocMethod)<br>
+ DictWithObjectsMethod(method)<br>
{<br>
KeyValuePair *KeyValues = getKeyValues();<br>
ExpansionData *Expansions = getExpansionData();<br>
@@ -4163,7 +4158,6 @@ ObjCDictionaryLiteral::Create(const ASTC<br>
ArrayRef<ObjCDictionaryElement> VK,<br>
bool HasPackExpansions,<br>
QualType T, ObjCMethodDecl *method,<br>
- ObjCMethodDecl *allocMethod,<br>
SourceRange SR) {<br>
unsigned ExpansionsSize = 0;<br>
if (HasPackExpansions)<br>
@@ -4171,8 +4165,7 @@ ObjCDictionaryLiteral::Create(const ASTC<br>
<br>
void *Mem = C.Allocate(sizeof(ObjCDictionaryLiteral) +<br>
sizeof(KeyValuePair) * VK.size() + ExpansionsSize);<br>
- return new (Mem) ObjCDictionaryLiteral(VK, HasPackExpansions, T,<br>
- method, allocMethod, SR);<br>
+ return new (Mem) ObjCDictionaryLiteral(VK, HasPackExpansions, T, method, SR);<br>
}<br>
<br>
ObjCDictionaryLiteral *<br>
<br>
Modified: cfe/trunk/lib/AST/NSAPI.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/NSAPI.cpp?rev=220812&r1=220811&r2=220812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/NSAPI.cpp?rev=220812&r1=220811&r2=220812&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/NSAPI.cpp (original)<br>
+++ cfe/trunk/lib/AST/NSAPI.cpp Tue Oct 28 13:28:16 2014<br>
@@ -124,14 +124,6 @@ Selector NSAPI::getNSArraySelector(NSArr<br>
Sel = Ctx.Selectors.getSelector(2, KeyIdents);<br>
break;<br>
}<br>
- case NSArr_initWithObjectsCount: {<br>
- IdentifierInfo *KeyIdents[] = {<br>
- &Ctx.Idents.get("initWithObjects"),<br>
- &Ctx.Idents.get("count")<br>
- };<br>
- Sel = Ctx.Selectors.getSelector(2, KeyIdents);<br>
- break;<br>
- }<br>
}<br>
return (NSArraySelectors[MK] = Sel);<br>
}<br>
@@ -217,15 +209,6 @@ Selector NSAPI::getNSDictionarySelector(<br>
Sel = Ctx.Selectors.getSelector(2, KeyIdents);<br>
break;<br>
}<br>
- case NSDict_initWithObjectsForKeysCount: {<br>
- IdentifierInfo *KeyIdents[] = {<br>
- &Ctx.Idents.get("initWithObjects"),<br>
- &Ctx.Idents.get("forKeys"),<br>
- &Ctx.Idents.get("count")<br>
- };<br>
- Sel = Ctx.Selectors.getSelector(3, KeyIdents);<br>
- break;<br>
- }<br>
}<br>
return (NSDictionarySelectors[MK] = Sel);<br>
}<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGObjC.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=220812&r1=220811&r2=220812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=220812&r1=220811&r2=220812&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGObjC.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGObjC.cpp Tue Oct 28 13:28:16 2014<br>
@@ -88,8 +88,7 @@ CodeGenFunction::EmitObjCBoxedExpr(const<br>
}<br>
<br>
llvm::Value *CodeGenFunction::EmitObjCCollectionLiteral(const Expr *E,<br>
- const ObjCMethodDecl *MethodWithObjects,<br>
- const ObjCMethodDecl *AllocMethod) {<br>
+ const ObjCMethodDecl *MethodWithObjects) {<br>
ASTContext &Context = CGM.getContext();<br>
const ObjCDictionaryLiteral *DLE = nullptr;<br>
const ObjCArrayLiteral *ALE = dyn_cast<ObjCArrayLiteral>(E);<br>
@@ -185,15 +184,6 @@ llvm::Value *CodeGenFunction::EmitObjCCo<br>
= InterfacePointerType->getObjectType()->getInterface();<br>
CGObjCRuntime &Runtime = CGM.getObjCRuntime();<br>
llvm::Value *Receiver = Runtime.GetClass(*this, Class);<br>
- if (AllocMethod) {<br>
- // Generate the "alloc" message send.<br>
- CallArgList Args;<br>
- Selector AllocMethodSel = AllocMethod->getSelector();<br>
- RValue result = Runtime.GenerateMessageSend(<br>
- *this, ReturnValueSlot(), AllocMethod->getReturnType(), AllocMethodSel,<br>
- Receiver, Args, Class, AllocMethod);<br>
- Receiver = result.getScalarVal();<br>
- }<br>
<br>
// Generate the message send.<br>
RValue result = Runtime.GenerateMessageSend(<br>
@@ -213,14 +203,12 @@ llvm::Value *CodeGenFunction::EmitObjCCo<br>
}<br>
<br>
llvm::Value *CodeGenFunction::EmitObjCArrayLiteral(const ObjCArrayLiteral *E) {<br>
- return EmitObjCCollectionLiteral(E, E->getArrayWithObjectsMethod(),<br>
- E->getArrayAllocMethod());<br>
+ return EmitObjCCollectionLiteral(E, E->getArrayWithObjectsMethod());<br>
}<br>
<br>
llvm::Value *CodeGenFunction::EmitObjCDictionaryLiteral(<br>
const ObjCDictionaryLiteral *E) {<br>
- return EmitObjCCollectionLiteral(E, E->getDictWithObjectsMethod(),<br>
- E->getDictAllocMethod());<br>
+ return EmitObjCCollectionLiteral(E, E->getDictWithObjectsMethod());<br>
}<br>
<br>
/// Emit a selector.<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=220812&r1=220811&r2=220812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=220812&r1=220811&r2=220812&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)<br>
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Tue Oct 28 13:28:16 2014<br>
@@ -2392,8 +2392,7 @@ public:<br>
llvm::Value *EmitObjCArrayLiteral(const ObjCArrayLiteral *E);<br>
llvm::Value *EmitObjCDictionaryLiteral(const ObjCDictionaryLiteral *E);<br>
llvm::Value *EmitObjCCollectionLiteral(const Expr *E,<br>
- const ObjCMethodDecl *MethodWithObjects,<br>
- const ObjCMethodDecl *AllocMethod);<br>
+ const ObjCMethodDecl *MethodWithObjects);<br>
llvm::Value *EmitObjCSelectorExpr(const ObjCSelectorExpr *E);<br>
RValue EmitObjCMessageExpr(const ObjCMessageExpr *E,<br>
ReturnValueSlot Return = ReturnValueSlot());<br>
<br>
Modified: cfe/trunk/lib/Sema/Sema.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=220812&r1=220811&r2=220812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=220812&r1=220811&r2=220812&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/Sema.cpp (original)<br>
+++ cfe/trunk/lib/Sema/Sema.cpp Tue Oct 28 13:28:16 2014<br>
@@ -94,11 +94,7 @@ Sema::Sema(Preprocessor &pp, ASTContext<br>
NSNumberDecl(nullptr),<br>
NSStringDecl(nullptr), StringWithUTF8StringMethod(nullptr),<br>
NSArrayDecl(nullptr), ArrayWithObjectsMethod(nullptr),<br>
- InitArrayWithObjectsMethod(nullptr),<br>
NSDictionaryDecl(nullptr), DictionaryWithObjectsMethod(nullptr),<br>
- InitDictionaryWithObjectsMethod(nullptr),<br>
- ArrayAllocObjectsMethod(nullptr),<br>
- DictAllocObjectsMethod(nullptr),<br>
MSAsmLabelNameCounter(0),<br>
GlobalNewDeleteDeclared(false),<br>
TUKind(TUKind),<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaExprObjC.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=220812&r1=220811&r2=220812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=220812&r1=220811&r2=220812&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaExprObjC.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaExprObjC.cpp Tue Oct 28 13:28:16 2014<br>
@@ -597,31 +597,6 @@ ExprResult Sema::BuildObjCBoxedExpr(Sour<br>
return MaybeBindToTemporary(BoxedExpr);<br>
}<br>
<br>
-static ObjCMethodDecl *FindAllocMethod(Sema &S, ObjCInterfaceDecl *NSClass) {<br>
- ObjCMethodDecl *Method = nullptr;<br>
- ASTContext &Context = S.Context;<br>
-<br>
- // Find +[NSClass alloc] method.<br>
- IdentifierInfo *II = &Context.Idents.get("alloc");<br>
- Selector AllocSel = Context.Selectors.getSelector(0, &II);<br>
- Method = NSClass->lookupClassMethod(AllocSel);<br>
- if (!Method && S.getLangOpts().DebuggerObjCLiteral) {<br>
- Method = ObjCMethodDecl::Create(Context,<br>
- SourceLocation(), SourceLocation(), AllocSel,<br>
- Context.getObjCIdType(),<br>
- nullptr /*TypeSourceInfo */,<br>
- Context.getTranslationUnitDecl(),<br>
- false /*Instance*/, false/*isVariadic*/,<br>
- /*isPropertyAccessor=*/false,<br>
- /*isImplicitlyDeclared=*/true, /*isDefined=*/false,<br>
- ObjCMethodDecl::Required,<br>
- false);<br>
- SmallVector<ParmVarDecl *, 1> Params;<br>
- Method->setMethodParams(Context, Params, None);<br>
- }<br>
- return Method;<br>
-}<br>
-<br>
/// Build an ObjC subscript pseudo-object expression, given that<br>
/// that's supported by the runtime.<br>
ExprResult Sema::BuildObjCSubscriptExpression(SourceLocation RB, Expr *BaseExpr,<br>
@@ -655,7 +630,6 @@ ExprResult Sema::BuildObjCSubscriptExpre<br>
}<br>
<br>
ExprResult Sema::BuildObjCArrayLiteral(SourceRange SR, MultiExprArg Elements) {<br>
- bool Arc = getLangOpts().ObjCAutoRefCount;<br>
// Look up the NSArray class, if we haven't done so already.<br>
if (!NSArrayDecl) {<br>
NamedDecl *IF = LookupSingleName(TUScope,<br>
@@ -675,29 +649,18 @@ ExprResult Sema::BuildObjCArrayLiteral(S<br>
return ExprError();<br>
}<br>
}<br>
- if (Arc && !ArrayAllocObjectsMethod) {<br>
- // Find +[NSArray alloc] method.<br>
- ArrayAllocObjectsMethod = FindAllocMethod(*this, NSArrayDecl);<br>
- if (!ArrayAllocObjectsMethod) {<br>
- Diag(SR.getBegin(), diag::err_undeclared_alloc);<br>
- return ExprError();<br>
- }<br>
- }<br>
+<br>
// Find the arrayWithObjects:count: method, if we haven't done so already.<br>
QualType IdT = Context.getObjCIdType();<br>
if (!ArrayWithObjectsMethod) {<br>
Selector<br>
- Sel = NSAPIObj->getNSArraySelector(<br>
- Arc? NSAPI::NSArr_initWithObjectsCount : NSAPI::NSArr_arrayWithObjectsCount);<br>
- ObjCMethodDecl *Method =<br>
- Arc? NSArrayDecl->lookupInstanceMethod(Sel)<br>
- : NSArrayDecl->lookupClassMethod(Sel);<br>
+ Sel = NSAPIObj->getNSArraySelector(NSAPI::NSArr_arrayWithObjectsCount);<br>
+ ObjCMethodDecl *Method = NSArrayDecl->lookupClassMethod(Sel);<br>
if (!Method && getLangOpts().DebuggerObjCLiteral) {<br>
TypeSourceInfo *ReturnTInfo = nullptr;<br>
Method = ObjCMethodDecl::Create(<br>
Context, SourceLocation(), SourceLocation(), Sel, IdT, ReturnTInfo,<br>
- Context.getTranslationUnitDecl(),<br>
- Arc /*Instance for Arc, Class for MRR*/,<br>
+ Context.getTranslationUnitDecl(), false /*Instance*/,<br>
false /*isVariadic*/,<br>
/*isPropertyAccessor=*/false,<br>
/*isImplicitlyDeclared=*/true, /*isDefined=*/false,<br>
@@ -777,14 +740,12 @@ ExprResult Sema::BuildObjCArrayLiteral(S<br>
<br>
return MaybeBindToTemporary(<br>
ObjCArrayLiteral::Create(Context, Elements, Ty,<br>
- ArrayWithObjectsMethod,<br>
- ArrayAllocObjectsMethod, SR));<br>
+ ArrayWithObjectsMethod, SR));<br>
}<br>
<br>
ExprResult Sema::BuildObjCDictionaryLiteral(SourceRange SR,<br>
ObjCDictionaryElement *Elements,<br>
unsigned NumElements) {<br>
- bool Arc = getLangOpts().ObjCAutoRefCount;<br>
// Look up the NSDictionary class, if we haven't done so already.<br>
if (!NSDictionaryDecl) {<br>
NamedDecl *IF = LookupSingleName(TUScope,<br>
@@ -804,32 +765,20 @@ ExprResult Sema::BuildObjCDictionaryLite<br>
}<br>
}<br>
<br>
- if (Arc && !DictAllocObjectsMethod) {<br>
- // Find +[NSDictionary alloc] method.<br>
- DictAllocObjectsMethod = FindAllocMethod(*this, NSDictionaryDecl);<br>
- if (!DictAllocObjectsMethod) {<br>
- Diag(SR.getBegin(), diag::err_undeclared_alloc);<br>
- return ExprError();<br>
- }<br>
- }<br>
-<br>
- // Find the dictionaryWithObjects:forKeys:count: or initWithObjects:forKeys:count:<br>
- // (for arc) method, if we haven't done so already.<br>
+ // Find the dictionaryWithObjects:forKeys:count: method, if we haven't done<br>
+ // so already.<br>
QualType IdT = Context.getObjCIdType();<br>
if (!DictionaryWithObjectsMethod) {<br>
- Selector Sel =<br>
- NSAPIObj->getNSDictionarySelector(Arc? NSAPI::NSDict_initWithObjectsForKeysCount<br>
- : NSAPI::NSDict_dictionaryWithObjectsForKeysCount);<br>
- ObjCMethodDecl *Method =<br>
- Arc ? NSDictionaryDecl->lookupInstanceMethod(Sel)<br>
- : NSDictionaryDecl->lookupClassMethod(Sel);<br>
+ Selector Sel = NSAPIObj->getNSDictionarySelector(<br>
+ NSAPI::NSDict_dictionaryWithObjectsForKeysCount);<br>
+ ObjCMethodDecl *Method = NSDictionaryDecl->lookupClassMethod(Sel);<br>
if (!Method && getLangOpts().DebuggerObjCLiteral) {<br>
Method = ObjCMethodDecl::Create(Context,<br>
SourceLocation(), SourceLocation(), Sel,<br>
IdT,<br>
nullptr /*TypeSourceInfo */,<br>
Context.getTranslationUnitDecl(),<br>
- Arc /*Instance for Arc, Class for MRR*/, false/*isVariadic*/,<br>
+ false /*Instance*/, false/*isVariadic*/,<br>
/*isPropertyAccessor=*/false,<br>
/*isImplicitlyDeclared=*/true, /*isDefined=*/false,<br>
ObjCMethodDecl::Required,<br>
@@ -976,7 +925,7 @@ ExprResult Sema::BuildObjCDictionaryLite<br>
Context.getObjCInterfaceType(NSDictionaryDecl));<br>
return MaybeBindToTemporary(ObjCDictionaryLiteral::Create(<br>
Context, makeArrayRef(Elements, NumElements), HasPackExpansions, Ty,<br>
- DictionaryWithObjectsMethod, DictAllocObjectsMethod, SR));<br>
+ DictionaryWithObjectsMethod, SR));<br>
}<br>
<br>
ExprResult Sema::BuildObjCEncodeExpression(SourceLocation AtLoc,<br>
<br>
Modified: cfe/trunk/lib/Serialization/ASTReaderStmt.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderStmt.cpp?rev=220812&r1=220811&r2=220812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderStmt.cpp?rev=220812&r1=220811&r2=220812&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Serialization/ASTReaderStmt.cpp (original)<br>
+++ cfe/trunk/lib/Serialization/ASTReaderStmt.cpp Tue Oct 28 13:28:16 2014<br>
@@ -936,7 +936,6 @@ void ASTStmtReader::VisitObjCArrayLitera<br>
for (unsigned I = 0, N = NumElements; I != N; ++I)<br>
Elements[I] = Reader.ReadSubExpr();<br>
E->ArrayWithObjectsMethod = ReadDeclAs<ObjCMethodDecl>(Record, Idx);<br>
- E->ArrayAllocMethod = ReadDeclAs<ObjCMethodDecl>(Record, Idx);<br>
E->Range = ReadSourceRange(Record, Idx);<br>
}<br>
<br>
@@ -957,7 +956,6 @@ void ASTStmtReader::VisitObjCDictionaryL<br>
}<br>
}<br>
E->DictWithObjectsMethod = ReadDeclAs<ObjCMethodDecl>(Record, Idx);<br>
- E->DictAllocMethod = ReadDeclAs<ObjCMethodDecl>(Record, Idx);<br>
E->Range = ReadSourceRange(Record, Idx);<br>
}<br>
<br>
<br>
Modified: cfe/trunk/lib/Serialization/ASTWriterStmt.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterStmt.cpp?rev=220812&r1=220811&r2=220812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterStmt.cpp?rev=220812&r1=220811&r2=220812&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Serialization/ASTWriterStmt.cpp (original)<br>
+++ cfe/trunk/lib/Serialization/ASTWriterStmt.cpp Tue Oct 28 13:28:16 2014<br>
@@ -879,7 +879,6 @@ void ASTStmtWriter::VisitObjCArrayLitera<br>
for (unsigned i = 0; i < E->getNumElements(); i++)<br>
Writer.AddStmt(E->getElement(i));<br>
Writer.AddDeclRef(E->getArrayWithObjectsMethod(), Record);<br>
- Writer.AddDeclRef(E->getArrayAllocMethod(), Record);<br>
Writer.AddSourceRange(E->getSourceRange(), Record);<br>
Code = serialization::EXPR_OBJC_ARRAY_LITERAL;<br>
}<br>
@@ -902,7 +901,6 @@ void ASTStmtWriter::VisitObjCDictionaryL<br>
}<br>
<br>
Writer.AddDeclRef(E->getDictWithObjectsMethod(), Record);<br>
- Writer.AddDeclRef(E->getDictAllocMethod(), Record);<br>
Writer.AddSourceRange(E->getSourceRange(), Record);<br>
Code = serialization::EXPR_OBJC_DICTIONARY_LITERAL;<br>
}<br>
<br>
Modified: cfe/trunk/test/CodeGenObjC/Inputs/literal-support.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/Inputs/literal-support.h?rev=220812&r1=220811&r2=220812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/Inputs/literal-support.h?rev=220812&r1=220811&r2=220812&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGenObjC/Inputs/literal-support.h (original)<br>
+++ cfe/trunk/test/CodeGenObjC/Inputs/literal-support.h Tue Oct 28 13:28:16 2014<br>
@@ -3,10 +3,6 @@<br>
<br>
typedef unsigned char BOOL;<br>
<br>
-@interface NSObject<br>
-+ (id)alloc;<br>
-@end<br>
-<br>
@interface NSNumber @end<br>
<br>
@interface NSNumber (NSNumberCreation)<br>
@@ -25,17 +21,15 @@ typedef unsigned char BOOL;<br>
+ (NSNumber *)numberWithBool:(BOOL)value;<br>
@end<br>
<br>
-@interface NSArray : NSObject<br>
+@interface NSArray<br>
@end<br>
<br>
@interface NSArray (NSArrayCreation)<br>
+ (id)arrayWithObjects:(const id [])objects count:(unsigned long)cnt;<br>
-- (id)initWithObjects:(const id [])objects count:(unsigned long)cnt;<br>
@end<br>
<br>
-@interface NSDictionary : NSObject<br>
+@interface NSDictionary<br>
+ (id)dictionaryWithObjects:(const id [])objects forKeys:(const id [])keys count:(unsigned long)cnt;<br>
-- (instancetype)initWithObjects:(const id [])objects forKeys:(const id [])keys count:(unsigned long)cnt;<br>
@end<br>
<br>
#endif // OBJC_LITERAL_SUPPORT_H<br>
<br>
Modified: cfe/trunk/test/CodeGenObjC/arc-literals.m<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc-literals.m?rev=220812&r1=220811&r2=220812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/arc-literals.m?rev=220812&r1=220811&r2=220812&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGenObjC/arc-literals.m (original)<br>
+++ cfe/trunk/test/CodeGenObjC/arc-literals.m Tue Oct 28 13:28:16 2014<br>
@@ -8,8 +8,8 @@<br>
// CHECK: c"numberWithUnsignedInt:\00"<br>
// CHECK: c"numberWithUnsignedLongLong:\00"<br>
// CHECK: c"numberWithChar:\00"<br>
-// CHECK: c"initWithObjects:count:\00"<br>
-// CHECK: c"initWithObjects:forKeys:count:\00"<br>
+// CHECK: c"arrayWithObjects:count:\00"<br>
+// CHECK: c"dictionaryWithObjects:forKeys:count:\00"<br>
// CHECK: c"prop\00"<br>
<br>
// CHECK-LABEL: define void @test_numeric()<br>
@@ -53,12 +53,10 @@ void test_array(id a, id b) {<br>
// CHECK-NEXT: [[T0:%.*]] = load [[CLASS_T:%.*]]** @"\01L_OBJC_CLASSLIST<br>
// CHECK-NEXT: [[SEL:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES<br>
// CHECK-NEXT: [[T1:%.*]] = bitcast [[CLASS_T]]* [[T0]] to i8*<br>
-<br>
- // CHECK-NEXT: [[ALLOC:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* [[T1]], i8* [[SEL]])<br>
- // CHECK-NEXT: [[T9:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES<br>
- // CHECK-NEXT: [[T10:%.*]] = bitcast [2 x i8*]* [[OBJECTS]] to i8**<br>
- // CHECK-NEXT: [[ARRAYINIT:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*, i8**, i64)*)(i8* [[ALLOC]], i8* [[T9]], i8** [[T10]], i64 2)<br>
- // CHECK-NEXT: call void (...)* @clang.arc.use(i8* [[V0]], i8* [[V1]])<br>
+ // CHECK-NEXT: [[T2:%.*]] = bitcast [2 x i8*]* [[OBJECTS]] to i8**<br>
+ // CHECK-NEXT: [[T3:%.*]] = call i8* bitcast ({{.*@objc_msgSend.*}})(i8* [[T1]], i8* [[SEL]], i8** [[T2]], i64 2)<br>
+ // CHECK-NEXT: [[T4:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T3]])<br>
+ // CHECK: call void (...)* @clang.arc.use(i8* [[V0]], i8* [[V1]])<br>
id arr = @[a, b];<br>
<br>
// CHECK: call void @objc_release<br>
@@ -98,12 +96,10 @@ void test_dictionary(id k1, id o1, id k2<br>
// CHECK-NEXT: [[T0:%.*]] = load [[CLASS_T:%.*]]** @"\01L_OBJC_CLASSLIST<br>
// CHECK-NEXT: [[SEL:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES<br>
// CHECK-NEXT: [[T1:%.*]] = bitcast [[CLASS_T]]* [[T0]] to i8*<br>
-<br>
- // CHECK-NEXT: [[ALLOC:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* [[T1]], i8* [[SEL]])<br>
- // CHECK-NEXT: [[T15:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES<br>
- // CHECK-NEXT: [[T16:%.*]] = bitcast [2 x i8*]* [[OBJECTS]] to i8**<br>
- // CHECK-NEXT: [[T17:%.*]] = bitcast [2 x i8*]* [[KEYS]] to i8**<br>
- // CHECK-NEXT: [[INIT:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*, i8**, i8**, i64)*)(i8* [[ALLOC]], i8* [[T15]], i8** [[T16]], i8** [[T17]], i64 2)<br>
+ // CHECK-NEXT: [[T2:%.*]] = bitcast [2 x i8*]* [[OBJECTS]] to i8**<br>
+ // CHECK-NEXT: [[T3:%.*]] = bitcast [2 x i8*]* [[KEYS]] to i8**<br>
+ // CHECK-NEXT: [[T4:%.*]] = call i8* bitcast ({{.*@objc_msgSend.*}})(i8* [[T1]], i8* [[SEL]], i8** [[T2]], i8** [[T3]], i64 2)<br>
+ // CHECK-NEXT: [[T5:%.*]] = call i8* @objc_retainAutoreleasedReturnValue(i8* [[T4]])<br>
// CHECK-NEXT: call void (...)* @clang.arc.use(i8* [[V0]], i8* [[V1]], i8* [[V2]], i8* [[V3]])<br>
<br>
id dict = @{ k1 : o1, k2 : o2 };<br>
@@ -142,15 +138,13 @@ void test_property(B *b) {<br>
// Store to array.<br>
// CHECK-NEXT: store i8* [[V1]], i8** [[T0]]<br>
<br>
- // Invoke initWithObjects:count:<br>
+ // Invoke arrayWithObjects:count:<br>
// CHECK-NEXT: [[T0:%.*]] = load [[CLASS_T]]** @"\01L_OBJC_CLASSLIST<br>
// CHECK-NEXT: [[SEL:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES<br>
// CHECK-NEXT: [[T1:%.*]] = bitcast [[CLASS_T]]* [[T0]] to i8*<br>
-<br>
- // CHECK-NEXT: [[ALLOC:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* [[T1]], i8* [[SEL]])<br>
- // CHECK-NEXT: [[T9:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES<br>
- // CHECK-NEXT: [[T10:%.*]] = bitcast [1 x i8*]* [[OBJECTS]] to i8**<br>
- // CHECK-NEXT: [[INIT:%.*]] = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*, i8**, i64)*)(i8* [[ALLOC]], i8* [[T9]], i8** [[T10]], i64 1)<br>
+ // CHECK-NEXT: [[T2:%.*]] = bitcast [1 x i8*]* [[OBJECTS]] to i8**<br>
+ // CHECK-NEXT: [[T3:%.*]] = call i8* bitcast ({{.*}} @objc_msgSend to {{.*}}(i8* [[T1]], i8* [[SEL]], i8** [[T2]], i64 1)<br>
+ // CHECK-NEXT: call i8* @objc_retainAutoreleasedReturnValue(i8* [[T3]])<br>
// CHECK-NEXT: call void (...)* @clang.arc.use(i8* [[V1]])<br>
// CHECK-NEXT: bitcast<br>
// CHECK-NEXT: bitcast<br>
<br>
Modified: cfe/trunk/test/CodeGenObjCXX/Inputs/literal-support.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/Inputs/literal-support.h?rev=220812&r1=220811&r2=220812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/Inputs/literal-support.h?rev=220812&r1=220811&r2=220812&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGenObjCXX/Inputs/literal-support.h (original)<br>
+++ cfe/trunk/test/CodeGenObjCXX/Inputs/literal-support.h Tue Oct 28 13:28:16 2014<br>
@@ -3,10 +3,6 @@<br>
<br>
typedef unsigned char BOOL;<br>
<br>
-@interface NSObject<br>
-+ (id)alloc;<br>
-@end<br>
-<br>
@interface NSNumber @end<br>
<br>
@interface NSNumber (NSNumberCreation)<br>
@@ -25,15 +21,14 @@ typedef unsigned char BOOL;<br>
+ (NSNumber *)numberWithBool:(BOOL)value;<br>
@end<br>
<br>
-@interface NSArray : NSObject<br>
+@interface NSArray<br>
@end<br>
<br>
@interface NSArray (NSArrayCreation)<br>
+ (id)arrayWithObjects:(const id [])objects count:(unsigned long)cnt;<br>
-- (id)initWithObjects:(const id [])objects count:(unsigned long)cnt;<br>
@end<br>
<br>
-@interface NSDictionary : NSObject<br>
+@interface NSDictionary<br>
+ (id)dictionaryWithObjects:(const id [])objects forKeys:(const id [])keys count:(unsigned long)cnt;<br>
@end<br>
<br>
<br>
Modified: cfe/trunk/test/CodeGenObjCXX/<a href="http://literals.mm" target="_blank">literals.mm</a><br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/literals.mm?rev=220812&r1=220811&r2=220812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/literals.mm?rev=220812&r1=220811&r2=220812&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGenObjCXX/<a href="http://literals.mm" target="_blank">literals.mm</a> (original)<br>
+++ cfe/trunk/test/CodeGenObjCXX/<a href="http://literals.mm" target="_blank">literals.mm</a> Tue Oct 28 13:28:16 2014<br>
@@ -33,15 +33,8 @@ void test_array() {<br>
// CHECK: store i8* [[RET1]], i8** [[ELEMENT1]]<br>
<br>
// Build the array<br>
- // CHECK: [[T4:%.*]] = load [[CLASS:%.*]]** @"\01L_OBJC_CLASSLIST_REFERENCES_$_"<br>
- // CHECK-NEXT: [[T5:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_<br>
- // CHECK-NEXT: [[T6:%.*]] = bitcast [[CLASS]]* [[T4]] to i8*<br>
- // CHECK-NEXT: [[ALLOC:%.*]] = {{invoke.*@objc_msgSend}}<br>
-<br>
- // CHECK: [[T7:%.*]] = load i8** @"\01L_OBJC_SELECTOR_REFERENCES_<br>
- // CHECK-NEXT: [[T8:%.*]] = bitcast [2 x i8*]* [[OBJECTS]] to i8**<br>
- // CHECK-NEXT: [[INIT:%.*]] = {{invoke.*@objc_msgSend}}<br>
-<br>
+ // CHECK: {{invoke.*@objc_msgSend}}<br>
+ // CHECK: call i8* @objc_retainAutoreleasedReturnValue<br>
id arr = @[ X(), Y() ];<br>
<br>
// Destroy temporaries<br>
@@ -88,7 +81,7 @@ void test_array_instantiation() {<br>
<br>
// Build the array<br>
// CHECK: {{invoke.*@objc_msgSend}}<br>
-<br>
+ // CHECK: call i8* @objc_retainAutoreleasedReturnValue<br>
id arr = @[ X(), Y() ];<br>
<br>
// Destroy temporaries<br>
<br>
Modified: cfe/trunk/test/SemaObjC/arc.m<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/arc.m?rev=220812&r1=220811&r2=220812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/arc.m?rev=220812&r1=220811&r2=220812&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/SemaObjC/arc.m (original)<br>
+++ cfe/trunk/test/SemaObjC/arc.m Tue Oct 28 13:28:16 2014<br>
@@ -5,14 +5,9 @@ typedef const void * CFTypeRef;<br>
CFTypeRef CFBridgingRetain(id X);<br>
id CFBridgingRelease(CFTypeRef);<br>
@protocol NSCopying @end<br>
-@interface NSObject<br>
-+ (id)alloc;<br>
-@end<br>
-<br>
-@interface NSDictionary : NSObject<br>
+@interface NSDictionary<br>
+ (id)dictionaryWithObjects:(const id [])objects forKeys:(const id <NSCopying> [])keys count:(NSUInteger)cnt;<br>
- (void)setObject:(id)object forKeyedSubscript:(id)key;<br>
-- (instancetype)initWithObjects:(const id [])objects forKeys:(const id <NSCopying> [])keys count:(NSUInteger)cnt;<br>
@end<br>
@class NSFastEnumerationState;<br>
@protocol NSFastEnumeration<br>
@@ -21,9 +16,8 @@ id CFBridgingRelease(CFTypeRef);<br>
@interface NSNumber<br>
+ (NSNumber *)numberWithInt:(int)value;<br>
@end<br>
-@interface NSArray : NSObject <NSFastEnumeration><br>
+@interface NSArray <NSFastEnumeration><br>
+ (id)arrayWithObjects:(const id [])objects count:(NSUInteger)cnt;<br>
-- (id)initWithObjects:(const id [])objects count:(NSUInteger)cnt;<br>
@end<br>
<br>
void test0(void (*fn)(int), int val) {<br>
@@ -748,16 +742,16 @@ void _NSCalcBeze(NSColor* color, NSColor<br>
void rdar12569201(id key, id value) {<br>
// Declarations.<br>
__weak id x = @"foo"; // no-warning<br>
- __weak id y = @{ key : value }; // expected-warning {{assigning retained object to weak variable; object will be released after assignment}}<br>
- __weak id z = @[ value ]; // expected-warning {{assigning retained object to weak variable; object will be released after assignment}}<br>
+ __weak id y = @{ key : value }; // expected-warning {{assigning dictionary literal to a weak variable; object will be released after assignment}}<br>
+ __weak id z = @[ value ]; // expected-warning {{assigning array literal to a weak variable; object will be released after assignment}}<br>
__weak id b = ^() {}; // expected-warning {{assigning block literal to a weak variable; object will be released after assignment}}<br>
__weak id n = @42; // expected-warning {{assigning numeric literal to a weak variable; object will be released after assignment}}<br>
__weak id e = @(42); // expected-warning {{assigning numeric literal to a weak variable; object will be released after assignment}}<br>
__weak id m = @(41 + 1); // expected-warning {{assigning boxed expression to a weak variable; object will be released after assignment}}<br>
<br>
// Assignments.<br>
- y = @{ key : value }; // expected-warning {{assigning retained object to weak variable; object will be released after assignment}}<br>
- z = @[ value ]; // expected-warning {{assigning retained object to weak variable; object will be released after assignment}}<br>
+ y = @{ key : value }; // expected-warning {{assigning dictionary literal to a weak variable; object will be released after assignment}}<br>
+ z = @[ value ]; // expected-warning {{assigning array literal to a weak variable; object will be released after assignment}}<br>
b = ^() {}; // expected-warning {{assigning block literal to a weak variable; object will be released after assignment}}<br>
n = @42; // expected-warning {{assigning numeric literal to a weak variable; object will be released after assignment}}<br>
e = @(42); // expected-warning {{assigning numeric literal to a weak variable; object will be released after assignment}}<br>
<br>
Modified: cfe/trunk/test/SemaObjC/objc-literal-comparison.m<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/objc-literal-comparison.m?rev=220812&r1=220811&r2=220812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/objc-literal-comparison.m?rev=220812&r1=220811&r2=220812&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/SemaObjC/objc-literal-comparison.m (original)<br>
+++ cfe/trunk/test/SemaObjC/objc-literal-comparison.m Tue Oct 28 13:28:16 2014<br>
@@ -10,15 +10,12 @@<br>
<br>
typedef signed char BOOL;<br>
<br>
-@protocol NSCopying @end<br>
-<br>
@interface BaseObject<br>
+ (instancetype)new;<br>
@end<br>
<br>
@interface NSObject : BaseObject<br>
- (BOOL)isEqual:(id)other;<br>
-+ (id)alloc;<br>
@end<br>
<br>
@interface NSNumber : NSObject<br>
@@ -29,12 +26,10 @@ typedef signed char BOOL;<br>
<br>
@interface NSArray : NSObject<br>
+ (id)arrayWithObjects:(const id [])objects count:(unsigned long)cnt;<br>
-- (id)initWithObjects:(const id [])objects count:(unsigned long)cnt;<br>
@end<br>
<br>
@interface NSDictionary : NSObject<br>
+ (id)dictionaryWithObjects:(const id [])objects forKeys:(const id [])keys count:(unsigned long)cnt;<br>
-- (instancetype)initWithObjects:(const id [])objects forKeys:(const id <NSCopying> [])keys count:(unsigned long)cnt;<br>
@end<br>
<br>
@interface NSString : NSObject<br>
<br>
Modified: cfe/trunk/tools/libclang/IndexBody.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/IndexBody.cpp?rev=220812&r1=220811&r2=220812&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/IndexBody.cpp?rev=220812&r1=220811&r2=220812&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/tools/libclang/IndexBody.cpp (original)<br>
+++ cfe/trunk/tools/libclang/IndexBody.cpp Tue Oct 28 13:28:16 2014<br>
@@ -109,9 +109,6 @@ public:<br>
if (ObjCMethodDecl *MD = E->getDictWithObjectsMethod())<br>
IndexCtx.handleReference(MD, E->getLocStart(),<br>
Parent, ParentDC, E, CXIdxEntityRef_Implicit);<br>
- if (ObjCMethodDecl *MD = E->getDictAllocMethod())<br>
- IndexCtx.handleReference(MD, E->getLocStart(),<br>
- Parent, ParentDC, E, CXIdxEntityRef_Implicit);<br>
return true;<br>
}<br>
<br>
@@ -119,9 +116,6 @@ public:<br>
if (ObjCMethodDecl *MD = E->getArrayWithObjectsMethod())<br>
IndexCtx.handleReference(MD, E->getLocStart(),<br>
Parent, ParentDC, E, CXIdxEntityRef_Implicit);<br>
- if (ObjCMethodDecl *MD = E->getArrayAllocMethod())<br>
- IndexCtx.handleReference(MD, E->getLocStart(),<br>
- Parent, ParentDC, E, CXIdxEntityRef_Implicit);<br>
return true;<br>
}<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>