[PATCH] D23193: [clang-rename] fix bug with initializer lists

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 8 09:09:10 PDT 2016


alexfh added a comment.

In https://reviews.llvm.org/D23193#508563, @omtcyfz wrote:

> Do these symbolic pointers in test seem reasonable?


Yes, kind of. I'd change these to C-style comments, place them on the same line with the interesting identifier (probably, right after the identifier), and document a generic way of finding the offset using `grep -Ubo 'Foo.*'` or whatever grep flags are needed.

For example:

  $ cat /tmp/a.h 
  #include <string>
  
  struct Foo /* test 1 */ {
    Foo /* test 2 */ (const std::string &s);
    std::string s;
  };
  
  // Test 1.
  // RUN: ..... -offset=26 ...
  // Test2.
  // RUN: ..... -offset=47 ...
  
  // To find offsets after modifying the file, use:
  //   grep -Ubo 'Foo.*' <file>
  $ grep -Ubo 'Foo.*' /tmp/a.h 
  26:Foo /* test 1 */ {
  47:Foo /* test 2 */ (const std::string &s);
  255:Foo.*' <file>


https://reviews.llvm.org/D23193





More information about the cfe-commits mailing list