Displaying 2 results from an estimated 2 matches for "const_expr".
Did you mean:
cast_expr
2012 Nov 17
1
[LLVMdev] constant expression as initial value to global
How can I go about evaluating constant expressions and providing them as
the initial value to globals? I allow my globals to be initialized by
an expression. In C syntax this looks like:
int const global_val = const_expr( 1, 2, 3 );
I use the "const_expr" to indicate construction-time constant folding
will not be possible. The IR optimizers however will likely reduce this
to a single value.
My first approach is to simply call a startup function which assigns the
values (which is also kind of necessary i...
2013 Apr 07
1
[LLVMdev] How to get the Instruction where one function use the global variable.
...lt;llvm::Instruction>(*iter);
llvm::errs() << *instr << "\n";
}
else if ( llvm::isa<llvm::ConstantExpr>(user))
{
llvm::ConstantExpr *const_expr = llvm::dyn_cast<llvm::ConstantExpr>(*iter);
llvm::errs() <<*const_expr << "\n";
}
}
llvm::errs() << "\n";
}
by this method ,I want to get the instruction in the f...