LLVM-'!NodePtr-> isKnownSentinel(),函数运算符*'是什么意思? [英] LLVM - What does '!NodePtr->isKnownSentinel(), function operator*' means?

查看:210
本文介绍了LLVM-'!NodePtr-> isKnownSentinel(),函数运算符*'是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我执行以下IR时:

declare void @_puts(i32, ...)

define void @main() {
entry:
  %name = alloca i32
  br i1 true, label %then, label %else

then:                                             ; preds = %entry
  call void (i32, ...) @_puts(i32 1, i32 1234)
  br label %end

else:                                             ; preds = %entry
  br label %end

end:                                              ; preds = %else, %then
  %if_val = phi i32 [ 1234, %then ], [ 0, %else ]

entry1:                                           ; No predecessors!
  store i32 %if_val, i32* %name
  %name2 = load i32, i32* %name
  call void (i32, ...) @_puts(i32 1, i32 %name2)
  ret void
}

我收到以下错误消息:

断言失败:(!NodePtr-> isKnownSentinel()),函数运算符*,文件/Users/Mac/llvm-source/llvm/include/llvm/ADT/ilist_iterator.h,第139行.

Assertion failed: (!NodePtr->isKnownSentinel()), function operator*, file /Users/Mac/llvm-source/llvm/include/llvm/ADT/ilist_iterator.h, line 139.

中止陷阱:6

此消息是什么意思?

有人可以帮我解释一下吗?

Can anyone explain this for me?

非常感谢.

推荐答案

该消息引用了前哨节点 /simple_ilist.h"rel =" nofollow noreferrer> simple_ilist ,它是一种数据结构,用于表示模块中的功能列表,功能中的基本块,基本块中的指令等.前哨节点表示列表的末尾,并且是此类列表的唯一数据成员-其余节点位于构成列表的对象内部("i"表示侵入式").

The message refers to a sentinel node of a simple_ilist, which is a data structure used for representing lists of functions in a module, basic blocks in a function, instructions in a basic blocks, and so on. A sentinel node represents the end of the list and is the only data member of such lists — the rest is inside the objects that constitute a list ("i" is for "intrusive").

我猜想这是由于在simple_ilist末尾进行迭代所引起的.最有可能将指令保存在end块中的那个,因为这是唯一格式错误的块.您可以通过添加终结符来解决它:

I would guess that this message is caused by iterating over the end of a simple_ilist. Most likely the one holding the instructions in the end block, because this is the only block that is malformed. You can fix it by adding a terminator:

end:                                              ; preds = %else, %then
  %if_val = phi i32 [ 1234, %then ], [ 0, %else ]
  br label %entry1

这篇关于LLVM-'!NodePtr-> isKnownSentinel(),函数运算符*'是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆