[LLVMdev] conversion from 'const llvm::Value*' to 'llvm::Constant*'

Anton Skvorts anton.skvorts at gmail.com
Fri Feb 11 21:07:48 PST 2011


Hi

Apolagize if this newbie question has some obvious answer. When running
something like

...
ExprAST *Init = GlobalNames[i].second;
const Value *InitVal;
InitVal = Init->Codegen();
GlobalVariable * globvar = new GlobalVariable(*TheModule,
InitVal->getType(), false, llvm::GlobalValue::ExternalLinkage, InitVal,
Twine(GlobalName));
...

I'm getting the following error

error: invalid conversion from `const llvm::Value*' to `llvm::Constant*'

How may I make this conversion? Any help would be much appreciated!

Anton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110212/cd5fbea8/attachment.html>


More information about the llvm-dev mailing list