Displaying 5 results from an estimated 5 matches for "globval".
Did you mean:
global
2011 Feb 13
2
[LLVMdev] conversion from 'const llvm::Value*' to 'llvm::Constant*'
...lobal double 0x3FE14A280FB5068C ; <double*> [#uses=0]
@b = global double 2.000000e+000 ; <double*> [#uses=0]
define double @0() {
entry:
ret double 0x3FE14A280FB5068C
}
The relevant code is
...
Value *InitVal;
InitVal = Init->Codegen();
GlobalVariable * globval = *new* *GlobalVariable*(*TheModule,
InitVal->getType(), *false*,
llvm::GlobalValue::*ExternalLinkage*, cast<Constant>(InitVal),
Twine(GlobalName) );
Any help, as always, would be really much appreciated!
Anton Skvorts
2011/2/12 Duncan Sands <baldrick at free.fr>
> Hi An...
2011 Feb 12
2
[LLVMdev] conversion from 'const llvm::Value*' to 'llvm::Constant*'
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
2011 Feb 12
0
[LLVMdev] conversion from 'const llvm::Value*' to 'llvm::Constant*'
Hi Anton,
> 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!
cast<Constant>(whatever)
Ciao, Duncan.
2011 Feb 13
0
[LLVMdev] conversion from 'const llvm::Value*' to 'llvm::Constant*'
Hi Anton,
> But there are still some details I must be missing. I'm getting an assertion
> when I try the following assignment in my script:
> global c = cos(1);
> Assertion failed: isa<X>(Val) && "cast<Ty>() argument of incompatible type!",
I think this is telling you that cos(1) is not a constant.
Ciao, Duncan.
2011 Feb 13
3
[LLVMdev] conversion from 'const llvm::Value*' to 'llvm::Constant*'
...ST::Codegen() {
for (unsigned i = 0, e = GlobalNames.size(); i != e; ++i) {
const std::string &GlobalName = GlobalNames[i].first;
ExprAST *Init = GlobalNames[i].second;
Constant *InitVal;
InitVal = cast<Constant>(Init->Codegen());
if (InitVal == 0) return 0;
GlobalVariable * globval = new GlobalVariable(*TheModule,
InitVal->getType(), false, llvm::GlobalValue::ExternalLinkage,
InitVal, Twine(GlobalName) );
}
}
Thank you very much for our help
Anton
2011/2/13 Duncan Sands <baldrick at free.fr>:
> Hi Anton,
>
>> But there are still some details I must be m...