首页 > 解决方案 > make 'new GlobalVariable' 时参数是什么意思?在“llvm FunctionPass”中

问题描述

GlobalVariable(Module &M, Type *Ty, bool isConstant,
                 LinkageTypes Linkage, Constant *Initializer,
                 const Twine &Name = "", GlobalVariable *InsertBefore = nullptr,
                 ThreadLocalMode = NotThreadLocal, unsigned AddressSpace = 0,
                 bool isExternallyInitialized = false);

我能理解这些东西(Module &M / Type *Ty / bool isConstant / Constant *Initializer)。

但我无法理解这些。(LinkageTypes Linkage / GlobalVariable *InsertBefore / ThreadLocalMode / unsigned AddressSpace / bool isExternallyInitialized)

你能解释一下吗?请!或者请告诉我如何参考这些。

我希望您对 Covid19 保持谨慎。谢谢你。

-------- 示例代码 --------

这是示例代码

      GlobalVariable *SomeGV = new GlobalVariable(
                                                        *(SomeGV->getParent()), SomeConst->getType(), false,
                                                        SomeGV->getLinkage(), SomeConst, "HelloString", nullptr,
                                                        SomeGV->getThreadLocalMode(), SomeGV->getType()->getAddressSpace());

标签: c++llvmllvm-ir

解决方案


推荐阅读