コード例 #1
0
        protected bool PerformTransformation(
            Method.Builder builder,
            Rewriter <TypeLowering <TType> > rewriter)
        {
            var typeConverter = CreateLoweringConverter(builder);

            // Use a static rewriter phase
            bool canRewriteBody = rewriter.TryBeginRewrite(
                builder.Method.Blocks,
                builder,
                typeConverter,
                out var rewriting);

            // Update return type
            if (typeConverter.IsTypeDependent(builder.Method.ReturnType))
            {
                builder.UpdateReturnType(typeConverter);
            }

            // Update parameter types
            builder.UpdateParameterTypes(typeConverter);

            // Apply the lowering logic
            return(canRewriteBody && rewriting.Rewrite());
        }