linrongbin
linrongbin

Reputation: 3371

How to define a LLVM GlobalValue variable in C++ with llvm-10 library?

In LLVM-10 library, I didn't find any C++ API to define a LLVM GlobalValue, please help me.

Here's document of LLVM-10 GlobalValue. But the constructor of GlobalValue is protected, not public.

Upvotes: 1

Views: 160

Answers (1)

arrowd
arrowd

Reputation: 34411

GlobalValue is a common base class for Function and GlobalVariable. It is not intended to be used directly, so you most probably want GlobalVariable, which does have public constructor: https://llvm.org/doxygen/GlobalVariable_8h_source.html#l00050

Upvotes: 2

Related Questions