Displaying 4 results from an estimated 4 matches for "oldcountersize".
2011 May 18
2
[LLVMdev] access array problem
...IndicesC(2);
IndicesC[0] = Constant::getNullValue(Type::getInt32Ty(Context));
IndicesC[1] = ConstantInt::get(Type::getInt32Ty(Context),0);
Constant *ElementPtrC =  
ConstantExpr::getGetElementPtr(CounterSize,&IndicesC[0],IndicesC.size());
                                                  Value *OldCounterSize 
=new LoadInst(ElementPtrC, "OldCounterSize", InsertPos);
Value *OldCounterSize =new LoadInst(ElementPtrC, "", InsertPos);
//create a getelementptr instruction: we want get &Counters[OldCounterSize]
  std::vector<Value*>new_idx;
new_idx.push_back(OldCounterSize); // E...
2011 May 18
0
[LLVMdev] access array problem
Hi Guangming Tan,
> I rewrote the code, please help check why it still does not work:
next time please be more explicit about exactly what goes wrong.
> //create a getelementptr instruction: we want get &Counters[OldCounterSize]
> std::vector<Value*>new_idx;
> new_idx.push_back(OldCounterSize); // ERROR?
> Value *nextaddr = GetElementPtrInst::Create(Counters, new_idx.begin(),
> new_idx.end(), "", InsertPos);
You need to push an index of zero before pushing the OldCounterSize index.
Ciao, Dunc...
2011 May 18
0
[LLVMdev] access array problem
Hi Guangming Tan,
>>> GlobalVariable:
>>> int *counter; //counter the number of load/store operations in run-time
>>> int *counterArray; //record the load/store addresses
>> strictly speaking these are not arrays, they are pointers.  Also, you have
>> written them in some kind of C-style idiom.  What are the declarations in
>> LLVM IR?
> const Type
2011 May 18
2
[LLVMdev] access array problem
δΊ 2011/5/18 14:29, Duncan Sands ει:
> Hi Tan Guangming,
>
>> I want to access an array in my instrumentation code. For example:
>>
>> GlobalVariable:
>> int *counter; //counter the number of load/store operations in run-time
>> int *counterArray; //record the load/store addresses
> strictly speaking these are not arrays, they are pointers.  Also, you have