Displaying 7 results from an estimated 7 matches for "allocinst".
Did you mean:
allocainst
2012 Sep 21
0
[LLVMdev] How To Get The Name of the type the popinter is pointing to
i am using llvm ,
i did this
if ( AllocaInst *allocInst =
dyn_cast<AllocaInst>(&*bbit)){
PointerType *p = allocInst->getType();
if ( p->getElementType()->isPointerTy()){
StringRef name =
allocInst->getName();...
2012 Sep 20
5
[LLVMdev] How To Get The Name of the type the popinter is pointing to
I want to know the type of pointer .
for example
if we have
int *p,
struct node *w
char *q
then i want int for p,char for q , struct node for w.
any help would be appreciated.
--
View this message in context: http://llvm.1065342.n5.nabble.com/How-To-Get-The-Name-of-the-type-the-popinter-is-pointing-to-tp49121.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.
2009 Nov 11
4
[LLVMdev] Adding function call in LLVM IR using IRBuilder causes assertion error
...n is supposed to add a call to f in bb at pos):
void addCallSite(Function *f, BasicBlock *bb, BasicBlock::iterator pos) {
std::vector<Value*> args;
IRBuilder<> builder(bb,pos);
for(Function::arg_iterator argit =
f->arg_begin();argit!=f->arg_end();argit++){
AllocaInst* allocInst = builder.CreateAlloca(argit->getType());
args.push_back(allocInst);
}
builder.CreateCall(f,args.begin(),args.end());
}
This seems to work for functions without parameters (eg. int foo()), but
once a function has a parameter I get the following assertion error:
<llvmpath>/lib/V...
2009 Nov 11
0
[LLVMdev] Adding function call in LLVM IR using IRBuilder causes assertion error
...ll to f in bb at pos):
> void addCallSite(Function *f, BasicBlock *bb, BasicBlock::iterator pos) {
> std::vector<Value*> args;
> IRBuilder<> builder(bb,pos);
> for(Function::arg_iterator argit =
> f->arg_begin();argit!=f->arg_end();argit++){
> AllocaInst* allocInst = builder.CreateAlloca(argit->getType());
> args.push_back(allocInst);
> }
> builder.CreateCall(f,args.begin(),args.end());
> }
>
> This seems to work for functions without parameters (eg. int foo()), but
> once a function has a parameter I get the following assertion...
2011 Nov 21
0
[LLVMdev] A way to pass const char* arg without creating a GlobalVariable
What memory would the pointer argument point to?
― Gordon
On Nov 20, 2011, at 16:58, "Dmitry N. Mikushin" <maemarcus at gmail.com> wrote:
> Hi,
>
> Is it possible to make up a ConstantArray containing a "const char*"
> string and pass it directly to the function "char*" argument *without*
> creating a GlobalVaribable?
> I looked around and
2011 Nov 21
2
[LLVMdev] A way to pass const char* arg without creating a GlobalVariable
Hi,
Is it possible to make up a ConstantArray containing a "const char*"
string and pass it directly to the function "char*" argument *without*
creating a GlobalVaribable?
I looked around and found the usual implementation is
array->globalVar->gep. If we omit globalVar & gep, then the argument
type would be [ i8 x N ], where N is set to the exact string length,
and
2006 May 17
0
[LLVMdev] Obfuscation with LLVM
...rPass::ReduceTempVarsLifetime( Function& function )
{
BasicBlock* entryBB = &function.getEntryBlock();
typedef std::vector< Instruction * > InstList;
// Collect all instructions (temporary variables) that have result used
outside
// their parent basic block. Skip the AllocInst instructions because it
will be
// handled separately during creation of new entry basic block.
InstList insts;
for( inst_iterator i = inst_begin( function ); i != inst_end( function
); i++ )
{
Instruction* inst = &*i;
if( IsUsedOutsideParentBlock( inst ) &&...