Displaying 5 results from an estimated 5 matches for "countersize".
2011 May 18
0
[LLVMdev] access array problem
..., they are pointers. Also, you have
>> written them in some kind of C-style idiom. What are the declarations in
>> LLVM IR?
> const Type *IntTy = Type::getInt32Ty(M.getContext());
> const Type *ATyC = ArrayType::get(Type::getInt64Ty(M.getContext()), 1);
>
> GlobalVariable *CounterSize = new GlobalVariable(M, ATyC, false,
> GlobalValue::InternalLinkage,
> Constant::getNullValue(ATyC), "MemTraceCounterSize");
so CounterSize is an array of length 1, containing a single 64 bit integer.
Using an array seems rather pointless here.
>
> const Type *ATy = ArrayTyp...
2011 May 18
2
[LLVMdev] access array problem
...eaking 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 *IntTy = Type::getInt32Ty(M.getContext());
const Type *ATyC = ArrayType::get(Type::getInt64Ty(M.getContext()), 1);
GlobalVariable *CounterSize = new GlobalVariable(M, ATyC, false,
GlobalValue::InternalLinkage,
Constant::getNullValue(ATyC), "MemTraceCounterSize");
const Type *ATy = ArrayType::get(Type::getInt32Ty(M.getContext()), 3000);
GlobalVariable *Counters = new GlobalVariable(M, ATy, false,
GlobalValue::InternalLinkage,...
2011 May 18
2
[LLVMdev] access array problem
Thank you, Duncan.
I rewrote the code, please help check why it still does not work:
//declare global variable
const Type *IntTy = Type::getInt32Ty(M.getContext());
const Type *ATyC = ArrayType::get(Type::getInt64Ty(M.getContext()), 1);
GlobalVariable *CounterSize = new GlobalVariable(M, ATyC, false,
GlobalValue::InternalLinkage,
Constant::getNullValue(ATyC), "MemTraceCounterSize");
const Type *ATy = ArrayType::get(Type::getInt32Ty(M.getContext()), 3000);
GlobalVariable *Counters = new Glo...
2011 May 18
0
[LLVMdev] access array problem
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
written them in some kind of C-style idiom. What are the declarations
2011 May 18
3
[LLVMdev] access array problem
Hi,
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
//increase the counter if a load/store is performed
std::vector<Constant *>index(2);
index[0] = Constant::getNullvalue(Type:getInt32Ty(Context));
index[1] =