bcc 一个编译警告:过期的函数 llvm::PointerType::getElementType()

Posted rtoax

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了bcc 一个编译警告:过期的函数 llvm::PointerType::getElementType()相关的知识,希望对你有一定的参考价值。


[ 79%] Building CXX object src/cc/CMakeFiles/bcc-static.dir/usdt/usdt.cc.o
/home/rongtao/Git/rtoax/bcc/src/cc/bpf_module_rw_engine.cc: In member function ‘int ebpf::BPFModule::annotate()’:
/home/rongtao/Git/rtoax/bcc/src/cc/bpf_module_rw_engine.cc:419:63: warning: ‘llvm::Type* llvm::PointerType::getElementType() const’ is deprecated: Pointer element types are deprecated. You can *temporarily* use Type::getPointerElementType() instead [-Wdeprecated-declarations]
  419 |       StructType *st = dyn_cast<StructType>(pt->getElementType());
      |                                             ~~~~~~~~~~~~~~~~~~^~
In file included from /usr/include/llvm/IR/DataLayout.h:27,
                 from /usr/include/llvm/ExecutionEngine/ExecutionEngine.h:24,
                 from /usr/include/llvm/ExecutionEngine/MCJIT.h:17,
                 from /home/rongtao/Git/rtoax/bcc/src/cc/bpf_module_rw_engine.cc:20:
/usr/include/llvm/IR/DerivedTypes.h:675:9: note: declared here
  675 |   Type *getElementType() const 
      |         ^~~~~~~~~~~~~~
/home/rongtao/Git/rtoax/bcc/src/cc/bpf_module_rw_engine.cc: In member function ‘int ebpf::BPFModule::annotate()’:
/home/rongtao/Git/rtoax/bcc/src/cc/bpf_module_rw_engine.cc:419:63: warning: ‘llvm::Type* llvm::PointerType::getElementType() const’ is deprecated: Pointer element types are deprecated. You can *temporarily* use Type::getPointerElementType() instead [-Wdeprecated-declarations]
  419 |       StructType *st = dyn_cast<StructType>(pt->getElementType());
      |                                             ~~~~~~~~~~~~~~~~~~^~
In file included from /usr/include/llvm/IR/DataLayout.h:27,
                 from /usr/include/llvm/ExecutionEngine/ExecutionEngine.h:24,
                 from /usr/include/llvm/ExecutionEngine/MCJIT.h:17,
                 from /home/rongtao/Git/rtoax/bcc/src/cc/bpf_module_rw_engine.cc:20:
/usr/include/llvm/IR/DerivedTypes.h:675:9: note: declared here
  675 |   Type *getElementType() const 
      |         ^~~~~~~~~~~~~~

[IR] Remove deprecated PointerType::getElementType()
d593cf79458a59d37e75c886a4fc3ac6a02b484d Mon Feb 14 08:49:01 2022 +0100

release/14.x 没有 b950bd2ce7ff79b203b2acba02e1c468836989ae Tue May 24 20:31:48 2022 -0700

release/13.x 没有 75e33f71c2dae584b13a7d1186ae0a038ba98838 Mon Sep 27 10:39:28 2021 +0100

以上是关于bcc 一个编译警告:过期的函数 llvm::PointerType::getElementType()的主要内容,如果未能解决你的问题,请参考以下文章

一个 bcc 在 f37 上的编译错误

一个 bcc 在 f37 上的编译错误

一个 bcc 在 f37 上的编译错误

bcc3.1和gcc编译同样程序的对比

使用bcc32做在windowXP上qt3.2.1编译环境的配置

使用history.back()出现"警告: 网页已过期的解决办法"