[cfe-dev] r131701 and test/CodeGenObjC/debug-property-synth.m
Adrian Prantl
aprantl at apple.com
Tue Feb 11 14:47:37 PST 2014
On Feb 11, 2014, at 14:10, David Blaikie <dblaikie at gmail.com> wrote:
>
>
>
> On Tue, Feb 11, 2014 at 1:47 PM, Adrian Prantl <aprantl at apple.com> wrote:
>
> On Feb 10, 2014, at 23:15, David Blaikie <dblaikie at gmail.com> wrote:
>
> > So I'm trying to do some stuff that's affecting .loc directives and came across a couple of test cases in Clang that, as was the fashion at the time, test LLVM.
> >
> > One of them is CodeGenObjC/debug-property-synth.m - which tests a particular .loc directive. The corresponding change it's meant to test is r131701, which seems to actually contain two independent changes. http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?r1=131373&r2=131701&pathrev=131701&diff_format=h
>
> Wonderfully documented testcase :-p
>
> From looking at the radar, this test is supposed to test the location of synthesized getters and setters. We should not remove the testcase, but we should definitely make it more specific.
>
> It should be testing that the synthesized setter/getter function for
> 1 // RUN: %clang_cc1 -triple %itanium_abi_triple -masm-verbose -S -g %s -o - | FileCheck %s
> 2 // Radar 9468526
> 3 @interface I {
> 4 int _p1;
> 5 }
> 6 @property int p1;
> 7 @end
> 8
> 9 @implementation I
> 10 @synthesize p1 = _p1;
> 11 @end
> 12
> 13 int main() {
> 14 I *myi;
> 15 myi.p1 = 2;
> 16 return 0;
> 17 }
> 18
> 19 // FIXME: Make this test ir files.
> 20 // CHECK: .loc 2 6 0
>
> p1 are associated with line number 6.
>
> >
> > 1) is the change at line 142 (and most of the changes in this patch - to pass the parameter through) to pass StartLoc instead of OMD->getLocStart()
> >
> > 2) is the change at 492 to use PID instead of PD
> >
>
> What are the respective values for StartLoc versus OMD->getLocStart() for this example?
>
> That's the problem - the code has since change substantially. Mostly in r139468: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?r1=139466&r2=139468&diff_format=h
>
> When I attempted to possibly reproduce the failure (by finding the one place that r139468 kept a getLocStart call in GenerateObjCSetter, I think I was only able to get debuginfo-properties.m to fail)
>
> So my best guess is that this test became useless at some point (possibly at 139468) due to refactoring and that the issue is currently covered by debuginfo-properties.m.
AFAICT debuginfo-properties.m checks for the DW_AT_decl_line in the debug info, whereas this tests for a line table entry. I forgot to mention that the radar was about being able to set a breakpoint on the property.
-- adrian
More information about the cfe-dev
mailing list