r198715 - Re-applying r198699 after reverting r198461.
Eric Christopher
echristo at gmail.com
Tue Jan 7 14:30:29 PST 2014
Sweet. That's what I was thinking the patch should look like.
Thanks Adrian. :)
-eric
On Tue Jan 07 2014 at 2:12:29 PM, Adrian Prantl <aprantl at apple.com> wrote:
> Author: adrian
> Date: Tue Jan 7 16:05:55 2014
> New Revision: 198715
>
> URL: http://llvm.org/viewvc/llvm-project?rev=198715&view=rev
> Log:
> Re-applying r198699 after reverting r198461.
> 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.
>
> Modified:
> cfe/trunk/lib/CodeGen/CGObjC.cpp
> cfe/trunk/test/CodeGenCXX/linetable-cleanup.cpp
> cfe/trunk/test/CodeGenObjC/arc-linetable-autorelease.m
> cfe/trunk/test/CodeGenObjC/arc-linetable.m
>
> Modified: cfe/trunk/lib/CodeGen/CGObjC.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/
> CGObjC.cpp?rev=198715&r1=198714&r2=198715&view=diff
> ============================================================
> ==================
> --- cfe/trunk/lib/CodeGen/CGObjC.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGObjC.cpp Tue Jan 7 16:05:55 2014
> @@ -506,7 +506,8 @@ static llvm::Value *emitARCRetainLoadOfS
> /// its pointer, name, and types registered in the class struture.
> void CodeGenFunction::GenerateObjCMethod(const ObjCMethodDecl *OMD) {
> StartObjCMethod(OMD, OMD->getClassInterface(), OMD->getLocStart());
> - EmitStmt(OMD->getBody());
> + assert(isa<CompoundStmt>(OMD->getBody()));
> + EmitCompoundStmtWithoutScope(*cast<CompoundStmt>(OMD->getBody()));
> FinishFunction(OMD->getBodyRBrace());
> }
>
>
> Modified: cfe/trunk/test/CodeGenCXX/linetable-cleanup.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/
> CodeGenCXX/linetable-cleanup.cpp?rev=198715&r1=198714&r2=198715&view=diff
> ============================================================
> ==================
> --- cfe/trunk/test/CodeGenCXX/linetable-cleanup.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/linetable-cleanup.cpp Tue Jan 7 16:05:55
> 2014
> @@ -46,12 +46,14 @@ void bar()
> void baz()
> {
> if (!foo())
> - // CHECK: {{.*}} = metadata !{i32 [[@LINE+1]], i32 0, metadata
> !{{.*}}, null}
> + // CHECK: ![[SCOPE1:.*]] = metadata !{{{.*}}, i32 [[@LINE-1]],
> {{.*}}} ; [ DW_TAG_lexical_block ]
> + // CHECK: {{.*}} = metadata !{i32 [[@LINE+1]], i32 0, metadata
> ![[SCOPE1]], null}
> return;
>
> if (foo()) {
> // no cleanup
> - // CHECK: {{.*}} = metadata !{i32 [[@LINE+1]], i32 0, metadata
> !{{.*}}, null}
> + // CHECK: {{.*}} = metadata !{i32 [[@LINE+2]], i32 0, metadata
> ![[SCOPE2:.*]], null}
> + // CHECK: ![[SCOPE2]] = metadata !{{{.*}}, i32 [[@LINE-3]], {{.*}}} ;
> [ DW_TAG_lexical_block ]
> return;
> }
> // CHECK: ![[RETBAZ]] = metadata !{i32 [[@LINE+1]], i32 0, metadata
> !{{.*}}, null}
>
> Modified: cfe/trunk/test/CodeGenObjC/arc-linetable-autorelease.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/
> CodeGenObjC/arc-linetable-autorelease.m?rev=198715&r1=
> 198714&r2=198715&view=diff
> ============================================================
> ==================
> --- cfe/trunk/test/CodeGenObjC/arc-linetable-autorelease.m (original)
> +++ cfe/trunk/test/CodeGenObjC/arc-linetable-autorelease.m Tue Jan 7
> 16:05:55 2014
> @@ -29,12 +29,11 @@ NSRect NSMakeRect(CGFloat x, CGFloat y,
> CGFloat pattern[2];
> // CHECK: define {{.*}}_createBezierPathWithWidth
> // CHECK: load {{.*}} %path, align {{.*}}, !dbg ![[RET:[0-9]+]]
> - // CHECK: call void @objc_storeStrong{{.*}} !dbg ![[ARC1:[0-9]+]]
> - // CHECK: call {{.*}} @objc_autoreleaseReturnValue{{.*}} !dbg
> ![[ARC2:[0-9]+]]
> - // CHECK: ret {{.*}} !dbg ![[ARC2]]
> + // CHECK: call void @objc_storeStrong{{.*}} !dbg ![[ARC:[0-9]+]]
> + // CHECK: call {{.*}} @objc_autoreleaseReturnValue{{.*}} !dbg ![[ARC]]
> + // CHECK: ret {{.*}} !dbg ![[ARC]]
> // CHECK: ![[RET]] = metadata !{i32 [[@LINE+1]], i32 0, metadata
> !{{.*}}, null}
> return path;
> - // CHECK: ![[ARC1]] = metadata !{i32 [[@LINE+2]], i32 0, metadata
> !{{.*}}, null}
> - // CHECK: ![[ARC2]] = metadata !{i32 [[@LINE+1]], i32 0, metadata
> !{{.*}}, null}
> + // CHECK: ![[ARC]] = metadata !{i32 [[@LINE+1]], i32 0, metadata
> !{{.*}}, null}
> }
> @end
>
> Modified: cfe/trunk/test/CodeGenObjC/arc-linetable.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/
> CodeGenObjC/arc-linetable.m?rev=198715&r1=198714&r2=198715&view=diff
> ============================================================
> ==================
> --- cfe/trunk/test/CodeGenObjC/arc-linetable.m (original)
> +++ cfe/trunk/test/CodeGenObjC/arc-linetable.m Tue Jan 7 16:05:55 2014
> @@ -47,8 +47,10 @@
>
> @implementation AppDelegate : NSObject
>
> +// CHECK: ![[TESTNOSIDEEFFECT:.*]] = {{.*}}[ DW_TAG_subprogram ] [line
> [[@LINE+1]]] [local] [def] [-[AppDelegate testNoSideEffect:]]
> - (int)testNoSideEffect:(NSString *)foo {
> - // CHECK: ![[ARC1]] = metadata !{i32 [[@LINE+1]], i32 0, metadata
> !{{.*}}, null}
> + int x = 1;
> + // CHECK: ![[ARC1]] = metadata !{i32 [[@LINE+1]], i32 0, metadata
> ![[TESTNOSIDEEFFECT]], null}
> return 1; // Return expression
> // CHECK: ![[RET1]] = metadata !{i32 [[@LINE+1]], i32 0, metadata
> !{{.*}}, null}
> } // Cleanup + Ret
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140107/7284006d/attachment.html>
More information about the cfe-commits
mailing list