Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
57d2b91
Added target skeleton
Sep 6, 2019
9de93fa
A bit more fleshed out and broken into more files
Sep 6, 2019
c25c544
Initial change to use cpability levels
Sep 13, 2019
dd68081
Added more leveling infrastructure. The real work is still TBD.
Sep 18, 2019
fb14448
Lots more plumbing, getting close to gluing it all together
Sep 19, 2019
3ff24c4
Dependency tracking is done for now. Next step is to figure out level…
Sep 20, 2019
22ad658
Started on actual levels
Sep 27, 2019
9feb55b
Couple of changes. Next step is to figure out how to handle quantum-n…
Sep 27, 2019
beef94d
WIP: Working on expression checking for if statements.
Oct 3, 2019
71a4968
Basic checks in place. Time to start thinking about tests...
Oct 4, 2019
8476dd7
WIP -- restructuring to work on a syntax tree, and starting to add un…
Oct 15, 2019
8e47f07
The transformations are restructured and cleaned up, and no more hidd…
Oct 16, 2019
06e457b
WIP -- tests crashing
Nov 1, 2019
6aaba49
First test case passes!!
Nov 1, 2019
2f8fe9d
Almost all test cases working
Nov 1, 2019
5da4013
TRying to get the Level attribute recognized...
Nov 2, 2019
9608598
Got the attribute working with help from Bettina, now all tests pass!
Nov 4, 2019
d1cb523
FIxed test name and comments
Nov 5, 2019
5958c02
Initial versions of walkers, compiling cleanly
Nov 5, 2019
b6f8163
Stole a transformation test to use as a walker test
Nov 5, 2019
efa2f80
Refactored into the leveler (a transformation) and a call graph build…
Nov 5, 2019
5721a45
Refactored to make the leveler more efficient by walking the implemen…
Nov 6, 2019
9e3b10d
Removing a file that's not needed yet
Nov 6, 2019
f460a42
Cleaned up some refactoring cruft
Nov 6, 2019
2ffa3d8
Removed deleted file from project file
Nov 7, 2019
87065e5
Removed an obsolete reference from the solution file
Nov 7, 2019
a4dd9b1
WIP, cleaning up
Nov 13, 2019
9abf5de
Removed CallGraph walker and CapabilityLeveler
ScottCarda-MS Nov 14, 2019
a99f5cb
Remove the files.
ScottCarda-MS Nov 14, 2019
8b3f4be
Addressed PR comments
ScottCarda-MS Nov 14, 2019
22a3662
Merge branch 'master' into ageller/targetValidation
ScottCarda-MS Nov 14, 2019
091fe8a
Merge branch 'master' into ageller/targetValidation
bettinaheim Nov 15, 2019
934e79c
Update src/QsCompiler/Core/TreeWalker.fs
bettinaheim Nov 15, 2019
7f4bfd6
Update src/QsCompiler/Core/TreeWalker.fs
bettinaheim Nov 15, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/QsCompiler/CompilationManager/CompilationUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,9 @@ internal void UpdateCallables(IEnumerable<QsCallable> updates)
if (header.Kind.IsTypeConstructor)
{
var specLocation = new QsLocation(header.Position, header.SymbolRange);
var defaultSpec = new QsSpecialization(QsSpecializationKind.QsBody, header.QualifiedName, header.Attributes, header.SourceFile, specLocation,
QsNullable<ImmutableArray<ResolvedType>>.Null, header.Signature, SpecializationImplementation.Intrinsic, ImmutableArray<string>.Empty, QsComments.Empty);
var defaultSpec = new QsSpecialization(QsSpecializationKind.QsBody, header.QualifiedName, header.Attributes,
header.SourceFile, specLocation, QsNullable<ImmutableArray<ResolvedType>>.Null, header.Signature, SpecializationImplementation.Intrinsic,
ImmutableArray<string>.Empty, QsComments.Empty);
this.CompiledCallables[fullName] = new QsCallable(header.Kind, header.QualifiedName, header.Attributes, header.SourceFile, specLocation,
header.Signature, header.ArgumentTuple, ImmutableArray.Create<QsSpecialization>(defaultSpec), header.Documentation, QsComments.Empty);
continue;
Expand All @@ -418,8 +419,9 @@ internal void UpdateCallables(IEnumerable<QsCallable> updates)

var compiledSpec = compiledSpecs.Single();
var specLocation = new QsLocation(specHeader.Position, specHeader.HeaderRange);
return new QsSpecialization(compiledSpec.Kind, compiledSpec.Parent, compiledSpec.Attributes, compiledSpec.SourceFile, specLocation,
compiledSpec.TypeArguments, compiledSpec.Signature, compiledSpec.Implementation, compiledSpec.Documentation, compiledSpec.Comments);
return new QsSpecialization(compiledSpec.Kind, compiledSpec.Parent, compiledSpec.Attributes,
compiledSpec.SourceFile, specLocation, compiledSpec.TypeArguments, compiledSpec.Signature, compiledSpec.Implementation,
compiledSpec.Documentation, compiledSpec.Comments);
})
.Where(spec => spec != null).ToImmutableArray();

Expand Down Expand Up @@ -452,8 +454,9 @@ private QsCallable GetImportedCallable(CallableDeclarationHeader header)
var specSignature = specHeader.Kind.IsQsControlled || specHeader.Kind.IsQsControlledAdjoint
? SyntaxGenerator.BuildControlled(header.Signature)
: header.Signature;
return new QsSpecialization(specHeader.Kind, header.QualifiedName, specHeader.Attributes, specHeader.SourceFile, specLocation,
specHeader.TypeArguments, specSignature, implementation, specHeader.Documentation, QsComments.Empty);
return new QsSpecialization(specHeader.Kind, header.QualifiedName, specHeader.Attributes,
specHeader.SourceFile, specLocation, specHeader.TypeArguments, specSignature,
implementation, specHeader.Documentation, QsComments.Empty);
})
.ToImmutableArray();
var location = new QsLocation(header.Position, header.SymbolRange);
Expand Down
4 changes: 2 additions & 2 deletions src/QsCompiler/CompilationManager/TypeChecking.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1226,8 +1226,8 @@ private static ImmutableArray<QsSpecialization> BuildSpecializations

QsSpecialization GetSpecialization(SpecializationDeclarationHeader spec, ResolvedSignature signature,
SpecializationImplementation implementation, QsComments comments = null) =>
new QsSpecialization(spec.Kind, spec.Parent, spec.Attributes, spec.SourceFile, null,
spec.TypeArguments, SyntaxGenerator.WithoutRangeInfo(signature), implementation, spec.Documentation, comments ?? QsComments.Empty);
new QsSpecialization(spec.Kind, spec.Parent, spec.Attributes, spec.SourceFile, null,
spec.TypeArguments, SyntaxGenerator.WithoutRangeInfo(signature), implementation, spec.Documentation, comments ?? QsComments.Empty);

QsSpecialization BuildSpecialization(QsSpecializationKind kind, ResolvedSignature signature, QsSpecializationGeneratorKind<QsSymbol> gen, FragmentTree.TreeNode root,
Func<QsSymbol, Tuple<QsTuple<LocalVariableDeclaration<QsLocalSymbol>>, QsCompilerDiagnostic[]>> buildArg, QsComments comments = null)
Expand Down
3 changes: 3 additions & 0 deletions src/QsCompiler/Core/Core.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
<Compile Include="ExpressionTransformation.fs" />
<Compile Include="StatementTransformation.fs" />
<Compile Include="TreeTransformation.fs" />
<Compile Include="ExpressionWalker.fs" />
<Compile Include="StatementWalker.fs" />
<Compile Include="TreeWalker.fs" />
<Compile Include="Dependencies.fs" />
<Compile Include="SyntaxGenerator.fs" />
<Compile Include="DeclarationHeaders.fs" />
Expand Down
3 changes: 2 additions & 1 deletion src/QsCompiler/Core/ExpressionTransformation.fs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ type ExpressionKindTransformation(?enable) =
| ExpressionType.Operation _ -> this.onOperationCall (method, arg)
| _ -> this.onFunctionCall (method, arg)

member this.Transform kind =
abstract member Transform : ExpressionKind -> ExpressionKind
default this.Transform kind =
if not enable then kind else
match kind with
| Identifier (sym, tArgs) -> this.onIdentifier (sym, tArgs)
Expand Down
Loading