search for: int32typ

Displaying 14 results from an estimated 14 matches for "int32typ".

Did you mean: int32ty
2013 Jul 25
2
[LLVMdev] Error for AllocaInst and Instruction
Hi, For the following code const Type * Int32Type = IntegerType::getInt32Ty(getGlobalContext()); AllocaInst* newInst = new AllocaInst(Int32Type, 0, "flag", Bb); Bb->getInstList().push_back(newInst); It gives me the error " error: no matching constructor for initialization of 'llvm::AllocaInst'...
2013 Jul 31
1
[LLVMdev] Instruction insertion By Module Pass
Thank you for your help I tried Instruction* p=&( Bb->front()); Type * Int32Type = IntegerType::getInt32Ty(getGlobalContext()); AllocaInst* newInst = new AllocaInst(Int32Type,"flag", p); that works well but I need to store the value of the variable too. What's the method that could be used to store specific value?? On 30 July 2013 16:01, John Criswell &lt...
2013 Jul 30
2
[LLVMdev] Instruction insertion By Module Pass
Hi, I need to insert new instruction into every basic block like x=1 or while loop I tried this code, but it doesn't work Type * Int32Type = IntegerType::getInt32Ty(getGlobalContext()); AllocaInst* newInst = new AllocaInst(Int32Type,"flag", Bb); Bb->getInstList().push_back(newInst); the error: void llvm::SymbolTableListTraits<llvm::Instruction, llvm::BasicBlock>::addNodeToList(ValueSubClass *) [ValueSubClass = l...
2013 Jul 30
0
[LLVMdev] Instruction insertion By Module Pass
On 7/30/13 7:44 AM, Rasha Omar wrote: > Hi, > I need to insert new instruction into every basic block like x=1 > or while loop > I tried this code, but it doesn't work > > Type * Int32Type = IntegerType::getInt32Ty(getGlobalContext()); > AllocaInst* newInst = new AllocaInst(Int32Type,"flag", Bb); > Bb->getInstList().push_back(newInst); The problem is that you've inserted the AllocaInst into the basic block via the AllocaInst constructor (note the Bb at the...
2014 Jan 08
3
[LLVMdev] reference to non-static member function must be called
...on Pass ,and using the InstVistor template ), I wrote like this: void visitStoreInst(StoreInst &SI) { //Get the refference of the types Module *M = SI.getParent()->getParent()->getParent(); IntegerType* Int8Type = IntegerType::getInt8Ty(M->getContext()); IntegerType* Int32Type = IntegerType::getInt32Ty(M->getContext()); IntegerType* Int64Type = IntegerType::getInt64Ty(M->getContext()); PointerType* VoidPtrType = PointerType::getUnqual(Int8Type); Type* VoidType = Type::getVoidTy(M->getContext()); DataLayout *TD = &getAnalysis<DataLayout>();...
2014 Aug 31
2
[LLVMdev] Inserting Calls to var args Functions
...ntf("%d, ", val); } I can get recodedInt32 function in my Module using getOrInsert Function. Function* RecordInt32 = cast<Function>(M.getOrInsertFunction("recordInt32", VoidType, Int32Type, NULL)); and insert at desired instPoint using: CallInst::Create(RecordInt32, args, "", instPoint); What should be the similar instructions for recoedVarInsputValues below: void recordVarInputValues(int num, ...){ CODE } I am not able to...
2010 Jan 28
1
[LLVMdev] about pointer type
Dear all, In the early llvm version, we could use PointerType::get(Type::Int32Ty)) to get the pointer type. But in the latest llvm (version 2.6), it doesn't work. Compiler says "‘Int32Ty’ is not a member of ‘llvm::Type’". I've looked the doxygen document, however, I can't find an answer, would you please help me? Thanks! -Wink -- View this message in context:
2012 Nov 11
1
[LLVMdev] wrong value with getPointerToGlobal
...al. The resulting value is not what I am expecting. My assembly looks something like this: @gresult = global i32 undef define i32 @eval_expr() { entry: ... store i32 %3, i32* @gresult ret i32 %3 } Where "gresult" is created with: auto global = new llvm::GlobalVariable( *module, int32Type, /*constant*/false, llvm::GlobalValue::ExternalLinkage, /*init*/0, "gresult" ); I run the function and get the results with: llvm::GenericValue gv = ee->runFunction( funcPtr, args/*empty*/ ); void * gptr = ee->getPointerToGlobal( global ); gv.IntVal has the correct value, but *...
2014 Jan 09
2
[LLVMdev] reference to non-static member function must be called
I'm using LLVM 3.3 Release. From the Class Reference Page. CallInst has a member function : static CallInst * Create (Value *Func, ArrayRef< Value * > Args, const Twine &NameStr="", Instruction *InsertBefore=0) This is what I want to use! the default name is "" and I also use that . Thanks! ----- Kind Regards! -JinHuang -- View this message in context:
2017 Jun 05
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
.../ Print memory ctx.EmitCall1("debugPointer", ptr); // Set class pointer auto c = ctx.bld.CreateExtractValue(val, 0, "class"); auto cp = ctx.bld.CreateConstGEP2_32(ty, ptr, 0, 0); auto cx = ctx.bld.CreatePtrToInt(cp, ctx.Int32Type()); ctx.EmitCall1("debugInt", cx); ctx.bld.CreateStore(c, cp); // Set datum auto d = ctx.bld.CreateExtractValue(val, 1, "datum"); auto dp = ctx.bld.CreateConstGEP2_32(ty, ptr, 0, 1); auto dx = ctx.bld.Creat...
2017 Jun 06
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
...all1("debugPointer", ptr); >> // Set class pointer >> auto c = ctx.bld.CreateExtractValue(val, 0, "class"); >> auto cp = ctx.bld.CreateConstGEP2_32(ty, ptr, 0, 0); >> auto cx = ctx.bld.CreatePtrToInt(cp, ctx.Int32Type()); >> ctx.EmitCall1("debugInt", cx); >> ctx.bld.CreateStore(c, cp); >> // Set datum >> auto d = ctx.bld.CreateExtractValue(val, 1, "datum"); >> auto dp = ctx.bld.CreateConstGEP2_32(ty, pt...
2017 Jun 04
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
Emitting calls to these functions (written in an .ll file linked in) works fine, and does the right thing. %Any = type { i8*, i32 } define dllexport void @setGlobal(%Any* %ptr, %Any %value) { store %Any %value, %Any* %ptr ret void } define dllexport %Any @getGlobal(%Any* %ptr) { %val = load %Any, %Any* %ptr ret %Any %val } Trying to replace the setGlobal call with what should be
2017 Jun 06
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
...tr); >>>> // Set class pointer >>>> auto c = ctx.bld.CreateExtractValue(val, 0, "class"); >>>> auto cp = ctx.bld.CreateConstGEP2_32(ty, ptr, 0, 0); >>>> auto cx = ctx.bld.CreatePtrToInt(cp, ctx.Int32Type()); >>>> ctx.EmitCall1("debugInt", cx); >>>> ctx.bld.CreateStore(c, cp); >>>> // Set datum >>>> auto d = ctx.bld.CreateExtractValue(val, 1, "datum"); >>>> aut...
2017 Jun 07
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
...// Set class pointer >>>>>> auto c = ctx.bld.CreateExtractValue(val, 0, "class"); >>>>>> auto cp = ctx.bld.CreateConstGEP2_32(ty, ptr, 0, 0); >>>>>> auto cx = ctx.bld.CreatePtrToInt(cp, ctx.Int32Type()); >>>>>> ctx.EmitCall1("debugInt", cx); >>>>>> ctx.bld.CreateStore(c, cp); >>>>>> // Set datum >>>>>> auto d = ctx.bld.CreateExtractValue(val, 1, "datum");...