<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <br>
    <div class="moz-cite-prefix">On 15.08.2017 10:33, Alex L wrote:<br>
    </div>
    <blockquote
cite="mid:CAKS3GBuXUp1tnj6gPKuUiLijJixo27OXyk_Rmz-Tz=vxrYfjQw@mail.gmail.com"
      type="cite">
      <div dir="ltr"><br>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On 15 August 2017 at 07:57, Vladimir
            Voskresensky via cfe-dev <span dir="ltr"><<a
                moz-do-not-send="true"
                href="mailto:cfe-dev@lists.llvm.org" target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a></a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
              <div bgcolor="#FFFFFF"><span class="gmail-"> <br>
                  <br>
                  <div class="gmail-m_22774614354463919moz-cite-prefix">On
                    14.08.2017 11:06, Ilya Biryukov wrote:<br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">
                      <div class="gmail_extra">
                        <div class="gmail_quote">
                          <blockquote class="gmail_quote"
                            style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
                            <div bgcolor="#FFFFFF">Could you provide
                              more info, please.<br>
                              Are USRs different for same named
                              file-local entries (i.e. static
                              functions)?<br>
                            </div>
                          </blockquote>
                          <div><br>
                          </div>
                          <div>Looking at USRGenerator::VisitVarDecl, it
                            seems they will be the same across different
                            translation units.</div>
                          <div>For local entities, "location" is part of
                            the USR.  ("Location" is a filename + an
                            offset from the start of that file).</div>
                        </div>
                      </div>
                    </div>
                  </blockquote>
                </span> That was my point, U in USRs are not so Unified,
                so can not be used as universal keys for queries in DB.<br>
                Adding location to USR makes them less usable in index
                if fast incremental re-index is going to be implemented
                vs. full reparse on each change.<br>
                <br>
                Vladimir.</div>
            </blockquote>
            <div><br>
            </div>
            <div>U is meant to be unique. USRs file-local declarations
              like static functions will include the filename only. USRs
              for function-local declarations will also include the
              offset in the file, but they're not actually indexed.
              There are a couple of global declarations that include
              file + offset in the USR as well - ObjC class extensions,
              some embedded tag decls (not that common), template
              parameter names (not actually indexed) & macros (not
              indexed).</div>
            <div><br>
            </div>
            <div>What exactly prevents unique strings from being used as
              keys for queries?</div>
          </div>
        </div>
      </div>
    </blockquote>
    Keys have to be Unique.<br>
    And previously (in 3.6?) we observed that different entries had same
    USRs. Good to known it is fixed now.<br>
    <blockquote
cite="mid:CAKS3GBuXUp1tnj6gPKuUiLijJixo27OXyk_Rmz-Tz=vxrYfjQw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div><br>
            </div>
            <div>Are filenames are a problem for the incremental
              re-indexing? If they aren't, then there are probably way
              to work around the file offsets in USRs for the
              incremental re-indexing, especially given how uncommon
              they actually are.</div>
          </div>
        </div>
      </div>
    </blockquote>
    I just wanted to share our experience, that offsets added to unique
    strings are not good. They add extra complexity to invalidation
    phase during incremental re-indexing and not stable, i.e. during
    simple re-format of file or adding comments.<br>
    May be integral index per-file would be enough vs offset.<br>
    <br>
    Vladimir.<br>
    <br>
    <blockquote
cite="mid:CAKS3GBuXUp1tnj6gPKuUiLijJixo27OXyk_Rmz-Tz=vxrYfjQw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div><br>
            </div>
            <div>Alex</div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
              <div bgcolor="#FFFFFF">
                <blockquote type="cite">
                  <div dir="ltr">
                    <div class="gmail_extra">
                      <div class="gmail_quote">
                        <div><br>
                          <span class="gmail-HOEnZb"><font
                              color="#888888"> </font></span></div>
                        <span class="gmail-HOEnZb"><font color="#888888">
                          </font></span></div>
                      <span class="gmail-HOEnZb"><font color="#888888">
                          -- <br>
                          <div
                            class="gmail-m_22774614354463919gmail_signature">
                            <div dir="ltr">
                              <div>
                                <div dir="ltr">
                                  <div>Regards,</div>
                                  <div>Ilya Biryukov</div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </font></span></div>
                  </div>
                </blockquote>
                <br>
              </div>
              <br>
              ______________________________<wbr>_________________<br>
              cfe-dev mailing list<br>
              <a moz-do-not-send="true"
                href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
              <a moz-do-not-send="true"
                href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev"
                rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
              <br>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>