[cfe-commits] r171604 - /cfe/trunk/test/CodeGenCXX/debug-info-method.cpp

David Blaikie dblaikie at gmail.com
Fri Jan 4 22:13:37 PST 2013


On Fri, Jan 4, 2013 at 10:05 PM, Chandler Carruth <chandlerc at google.com> wrote:
> On Fri, Jan 4, 2013 at 9:48 PM, David Blaikie <dblaikie at gmail.com> wrote:
>>
>> Author: dblaikie
>> Date: Fri Jan  4 23:48:08 2013
>> New Revision: 171604
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=171604&view=rev
>> Log:
>> Change test/CodeGenCXX/debug-info-method.cpp an IR (rather than asm) test.
>>
>> Referring back to the original commit (r115090) which was a frontend only
>> test
>> I adjusted this test to verify the frontend change that was made, to emit
>> the
>> protected access value in the flags metadata field.
>>
>> Modified:
>>     cfe/trunk/test/CodeGenCXX/debug-info-method.cpp
>>
>> Modified: cfe/trunk/test/CodeGenCXX/debug-info-method.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-method.cpp?rev=171604&r1=171603&r2=171604&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/test/CodeGenCXX/debug-info-method.cpp (original)
>> +++ cfe/trunk/test/CodeGenCXX/debug-info-method.cpp Fri Jan  4 23:48:08
>> 2013
>> @@ -1,5 +1,5 @@
>> -// RUN: %clang -fverbose-asm -g -S %s -o - | FileCheck %s
>> -// CHECK: DW_ACCESS_protected
>> +// RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s
>> +// CHECK: metadata !"_ZN1A3fooEv", {{.*}}, i32 258
>
>
> Oof, without your commit message, this test would be completely opaque... I
> mean, this isn't a problem with this commit clearly, but a problem with the
> way in which we handle debug info testing in IR tests that I've just never
> really noticed...

Agreed. The issue being (for more context) that the "protected" access
specifier is one of the values in the (i32 258) flag value in the
metadata, along with other values.

> Any ideas how we can make these types of debug info tests
> more understandable to future devs? My only idea is copious comments, but I
> feel like having some self-documenting system would be better and I just
> don't have any good ideas about what it would look like.

Yeah, I'm not sure what it would look like - essentially the test
would have to reference constants from LLVM to describe the flags
combined into the flags field. (&, better than that, the ability to
specify just some part of the flags value that is of interest to a
particular test)

Probably just adding comments of the form:

; test that the flags represent the 'protected' access modifier
; 258 (flags) = 42 (thing1) | 157 (thing2) | (protected) 8

(I haven't actually looked up what constants are combined into the
flags value in this case)

>
>>
>>  class A {
>>  protected:
>>    int foo();
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>



More information about the cfe-commits mailing list