forv_Vec(FnSymbol, fn, gFnSymbols) { if (!fn->hasFlag(FLAG_EXTERN)) continue; FnSymbol* fcopy = NULL; std::set<int> replaced_args; int current_formal = 0; for_formals(formal, fn) { UnresolvedSymExpr* eltType = NULL; if (checkIsArray(formal, eltType)) { if (!fcopy) { SET_LINENO(fn); fcopy = fn->copy(); } replaced_args.insert(current_formal); if (eltType) { // replace '[] foo' with 'c_ptr(foo)' SET_LINENO(formal); formal->typeExpr->replace( new BlockStmt( new CallExpr("c_ptr", eltType->remove()))); } else { // generic arrays are replaced with 'c_void_ptr' SET_LINENO(formal); formal->typeExpr->replace( new BlockStmt( new UnresolvedSymExpr("c_void_ptr"))); } } current_formal++; }
void RTTIField::checkIsPlain(bool array) { if(!isPlainType()) { BS_EXCEPT(InternalErrorException, "Invalid field type. Needed: Plain type. Got: " + toString(mIsVectorType) + ", " + toString(isPlainType()) + ", " + toString(isReflectableType()) + ", " + toString(isDataBlockType()) + ", " + toString(isReflectablePtrType())); } checkIsArray(array); }