[llvm-dev] Link Struct to Metadata

Hong Hu via llvm-dev llvm-dev at lists.llvm.org
Fri Jan 6 02:25:25 PST 2017


Given one structure type, is there any method to get the metadata that
describes the structure information?

For example:

%2 = getelementptr inbounds %"class.std::thread", %"class.std::thread"*
%this, i64 0, i32 0, i32 0, !dbg !2748

then I know the pointer operand type is class.std::thread. I want to find
the associated metadata of this type:

!217 = !DICompositeType(tag: DW_TAG_class_type, name: "thread", scope: !34,
file: !218, line: 60, size: 64, align: 64, elements: !219, identifier:

The challenge is that the structure name is different in the IR
instruction, from the one in the metadata. One is  class.std::thread, while
another is _ZTSSt6thread.

Hu Hong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170106/4370ae6b/attachment.html>

More information about the llvm-dev mailing list