<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 23, 2010, at 11:13 AM, Murat B wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><table cellspacing="0" cellpadding="0" border="0" style="position: static; z-index: auto; "><tbody><tr><td valign="top" style="font: inherit;">Thanks. I still have a problem.<br><br>I modified the field processing in this way:<br>void AAPConsumer::HandleRecordFields(const RecordDecl *RD)<br>{<br> Type *T;<br> for (RecordDecl::field_iterator I = RD->field_begin(),<br> E = RD->field_end(); I != E; I++) {<br> T = ((*I)->getType()).getTypePtr();<br> if (ArrayType::classof(T)) {<br> llvm::errs() << "Field: "; (*I)->dump(); T->dump();<br> llvm::errs() << " ";
(*I)->dump();<br> (*I)->getTypeSourceInfo()->getTypeLoc().getTypePtr()->dump();<br> }<br> }<br>}<br><br>For the field bitcounter, I get following output:<br>Field: int bitcounter[8]: int identifier[8]<br> int bitcounter[8]: int identifier[8]<br><br>In both cases the array size is shown as 8 and the type is ConstantArrayType. I still don't get size MAX_BITCOUNTER_MB. Am I doing something wrong?<br></td></tr></tbody></table></blockquote></div><br><div>You need to actually walk the structure returned by getTypeLoc(), not jump down immediately to the underlying type. ConstantArrayTypeLoc has the information you're looking for.</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>- Doug</div></body></html>