Пример #1
0
     ffi_type *getFFIClassType(SgClassType *ct)
        {
          const StructLayoutInfo &sli = typeLayout(ct);
          ffi_type **fieldTypes = new ffi_type*[sli.fields.size()];
          allocatedTypeArrays.push_back(fieldTypes);
          for (size_t i = 0; i < sli.fields.size(); i++)
             {
               SgNode *decl = sli.fields[i].decl;
               if (SgInitializedName *in = isSgInitializedName(decl))
                  {
                    fieldTypes[i] = getFFIType(in->get_type());
                  }
               else if (SgBaseClass *bc = isSgBaseClass(decl))
                  {
                    fieldTypes[i] = getFFIType(bc->get_base_class()->get_type());
                  }
               else
                  {
                    throw InterpError("Encountered unsupported field decl: " + decl->class_name());
                  }
             }

          ffi_type *ctType = new ffi_type;
          allocatedTypes.push_back(ctType);
          ctType->elements = fieldTypes;
          return ctType;
        }
Пример #2
0
void
SgBaseClass::fixupCopy_symbols(SgNode* copy, SgCopyHelp & help) const
   {
#if DEBUG_FIXUP_COPY
     printf ("Inside of SgBaseClass::fixupCopy_symbols() for baseclass = %p = %s  copy = %p \n",this,this->class_name().c_str(),copy);
#endif

     SgBaseClass* baseClass_copy = isSgBaseClass(copy);
     ROSE_ASSERT(baseClass_copy != NULL);

     ROSE_ASSERT(this->get_base_class() != NULL);
     this->get_base_class()->fixupCopy_symbols(baseClass_copy->get_base_class(),help);
   }