[llvm-bugs] [Bug 33923] getGlobalID() always returns 0

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 12 12:23:00 PDT 2017


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

Michael Haidl <michael.haidl at uni-muenster.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
                 CC|                            |michael.haidl at uni-muenster.
                   |                            |de
             Status|NEW                         |RESOLVED

--- Comment #1 from Michael Haidl <michael.haidl at uni-muenster.de> ---

  683   /// \brief Retrieve the global declaration ID associated with this
  684   /// declaration, which specifies where this Decl was loaded from.
  685   unsigned getGlobalID() const {
  686     if (isFromASTFile())
  687       return *((const unsigned*)this - 1);
  688     return 0;
  689   }

getGlobalID is not intend to be used with a generated AST. To identify a Decl
uniquely use the address of the Decl, which is the hex value in the AST dump.

-- 
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/20170912/a738caf9/attachment.html>


More information about the llvm-bugs mailing list