Howto get the dimension expression for a given ConstantArrayType

Hello, List,

is there an easy way to get the expression that is used to specify the
dimension for a given ConstantArrayType.

int Array[sizeof(int) + 2];

My code:

void Analyze (QualType qt) {
if (qt->isArrayType()) {
  if (isa<ConstantArrayType>(qt)) {
     const ConstantArrayType * cat(dyn_cast<ConstantArrayType>(qt));

     // Here I want to get the expression that was used to specify
     // the dimension.


That information isn't stored in the ConstantArrayType; you need the TypeSourceInfo for the type in question.