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

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 25 06:15:20 PDT 2017


            Bug ID: 33923
           Summary: getGlobalID() always returns 0
           Product: clang
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: me at tiferrei.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 18842
  --> https://bugs.llvm.org/attachment.cgi?id=18842&action=edit
Source file, output and test file

Hello there, 
I was trying to get some kind of ID for each node that Clang passes me, I
needed this to later detect if functions are repeatedly called, and I'd use the
ID to match functions.
So I decided to take a look at `getGlobalID()` (clang::Decl::getGlobalID) and
see if this would give me some unique identifiers. Oddly enough, this seems to
always return an ID of "0" for all functions. So after some googling I also
found this post:
which seems to get to this same conclusion.

I am a beginner in clang generally and so I don't know if this is just
something that I'm doing incorrectly or really a bug. I have attached the
specific source file and some example output.

PS: The ideal for me would be to actually get the hex code that is shown right
after each node's type (in "CompoundStmt 0x7f8c39807198 <col:12, line:21:1>"
I'd like to get "0x7f8c39807198")

Thank you,

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/20170725/c9b94dd5/attachment-0001.html>

More information about the llvm-bugs mailing list