Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
763 views
in Technique[技术] by (71.8m points)

clang - How to get DICompositeType line numbers from LLVM IR code

struct Foo {
    int x;
};

Void bar() {
    struct Foo f;
    f.x = 1;
}

!12 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", file: !8, line: 1, size: 32, flags: DIFlagTypePassByValue, elements: !13, identifier: "abc")

!14 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !12, file: !8, line: 2, baseType: !15, size: 32)

!15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)

Trying to extract line 1 for Struct Foo and line 2 for member variable x from Function or Module handle.

question from:https://stackoverflow.com/questions/65928179/how-to-get-dicompositetype-line-numbers-from-llvm-ir-code

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...