[LLVMdev] access array problem

Guangming Tan guangming.tan at gmail.com
Wed May 18 03:41:19 PDT 2011


Hi, Duncan,
It does work! Thand you so much!
I'm sorry for my confusing description.
Thanks!

于 2011/5/18 17:20, Duncan Sands 写道:
> 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, Duncan.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list