diff --git a/src/QsCompiler/Compiler/RewriteSteps/SyntaxTreeTrimming.cs b/src/QsCompiler/Compiler/RewriteSteps/SyntaxTreeTrimming.cs
index 34100e4e47..bd9529099b 100644
--- a/src/QsCompiler/Compiler/RewriteSteps/SyntaxTreeTrimming.cs
+++ b/src/QsCompiler/Compiler/RewriteSteps/SyntaxTreeTrimming.cs
@@ -31,7 +31,7 @@ internal class SyntaxTreeTrimming : IRewriteStep
public bool ImplementsPostconditionVerification => false;
///
- /// Constructor for the SyntaxTreeTrimming Rewrite Step.
+ /// Initializes a new instance of the class.
///
/// When true, intrinsics will not be removed as part of the rewrite step.
public SyntaxTreeTrimming(bool keepAllIntrinsics = true, IEnumerable? dependencies = null)
diff --git a/src/QsCompiler/Transformations/MonomorphizationValidation.cs b/src/QsCompiler/Transformations/MonomorphizationValidation.cs
index deb45147ac..07f1e5fb40 100644
--- a/src/QsCompiler/Transformations/MonomorphizationValidation.cs
+++ b/src/QsCompiler/Transformations/MonomorphizationValidation.cs
@@ -10,8 +10,17 @@
namespace Microsoft.Quantum.QsCompiler.Transformations.Monomorphization.Validation
{
+ ///
+ /// Validates that the monomorphization transformation has removed all references to
+ /// generic objects.
+ ///
public class ValidateMonomorphization : SyntaxTreeTransformation
{
+ ///
+ /// Applies the transformation that walks through the syntax tree, checking to ensure
+ /// that all generic data has been removed. If allowTypeParametersForIntrinsics is true,
+ /// then generic data is allowed for type parameters of callables that have an intrinsic body.
+ ///
public static void Apply(QsCompilation compilation, bool allowTypeParametersForIntrinsics = true)
{
var intrinsicCallableSet = allowTypeParametersForIntrinsics
diff --git a/src/QsCompiler/Transformations/SyntaxTreeTrimming.cs b/src/QsCompiler/Transformations/SyntaxTreeTrimming.cs
index d2eff5d6c0..09fb31fce9 100644
--- a/src/QsCompiler/Transformations/SyntaxTreeTrimming.cs
+++ b/src/QsCompiler/Transformations/SyntaxTreeTrimming.cs
@@ -11,8 +11,20 @@
namespace Microsoft.Quantum.QsCompiler.Transformations.SyntaxTreeTrimming
{
+ ///
+ /// Removes unused callables from the syntax tree.
+ ///
public static class TrimSyntaxTree
{
+ ///
+ /// Applies the transformation that removes from the syntax tree all callables that
+ /// are unused, meaning they are not a descendant of at least one entry point in
+ /// the call graph. If keepAllIntrinsics is true, callables with an intrinsic body
+ /// will not be trimmed, regardless of usage. Any callables that later
+ /// transformations will depend on should be passed in and will not be trimmed,
+ /// regardless of usage. Note that unused type constructors will be subject to
+ /// trimming as any other callable.
+ ///
public static QsCompilation Apply(QsCompilation compilation, bool keepAllIntrinsics, IEnumerable? dependencies = null)
{
return TrimTree.Apply(compilation, keepAllIntrinsics, dependencies);
@@ -68,6 +80,9 @@ private static bool Filter(QsNamespaceElement elem, ImmutableHashSet
+ /// Class representing the state of the transformation.
+ ///
public class TransformationState
{
public Func NamespaceElementFilter { get; }