[llvm-bugs] [Bug 34971] New: [preamble] Skipped ranges vanish after reparse (#ifdef with #include)

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Oct 16 23:45:27 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=34971

            Bug ID: 34971
           Summary: [preamble] Skipped ranges vanish after reparse (#ifdef
                    with #include)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: libclang
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nikolai.kosjar at qt.io
                CC: klimek at google.com, llvm-bugs at lists.llvm.org

Source file is:

   % cat $FILE
   #ifdef SOMETHING
   #include <whatever>
   #endif

Parse and save the tokens/skipping ranges:

    % ./c-index-test -test-annotate-tokens=$FILE:1:1:4:1 $FILE > /tmp/1

Reparse and do the same:

    % CINDEXTEST_EDITING=1 ./c-index-test -test-annotate-tokens=$FILE:1:1:4:1
$FILE > /tmp/2

Compare:

    % diff -u /tmp/{1,2}
    --- /tmp/1  2017-10-17 08:31:36.391408230 +0200
    +++ /tmp/2  2017-10-17 08:32:01.215708503 +0200
    @@ -1,4 +1,3 @@
    -Skipping: [1:1 - 3:7]
     Punctuation: "#" [1:1 - 1:2] preprocessing directive=
     Identifier: "ifdef" [1:2 - 1:7] preprocessing directive=
     Identifier: "SOMETHING" [1:8 - 1:17] preprocessing directive=
    zsh: exit 1     colordiff -u /tmp/{1,2}
    % 

==> Ops, skipped ranges are removed after reparse.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171017/27584dd9/attachment.html>


More information about the llvm-bugs mailing list