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
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ ASALocalRun/
src/ProjectTemplates/Quantum.App1/Quantum.App1.csproj
src/ProjectTemplates/Quantum.Library1/Quantum.Library1.csproj
src/ProjectTemplates/Quantum.Test1/Quantum.Test1.csproj
src/QsCompiler/LanguageServer/TemporaryProject.cs
src/QuantumSdk/DefaultItems/DefaultItems.props
src/ProjectTemplates/Quantum.App1/.template.config/template.json
src/ProjectTemplates/Quantum.Library1/.template.config/template.json
Expand All @@ -366,3 +365,6 @@ src/ProjectTemplates/Quantum.Test1/.template.config/template.json
src/QsCompiler/QirGeneration/QirGeneration.nuspec
/examples/QIR/Development/qir/*
/examples/QIR/Development/build

# MSBuild logs
MSBuild_Logs/
47 changes: 47 additions & 0 deletions QsCompiler.sln
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Tests.CSharpGeneration", "s
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CodeGeneration", "CodeGeneration", "{160AABCE-2317-4695-815C-D3B3F88BE780}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Formatter", "Formatter", "{755A6971-AD80-4519-A64E-0333B89C1E9D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Parser", "src\QsFmt\Parser\Parser.csproj", "{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Formatter", "src\QsFmt\Formatter\Formatter.fsproj", "{4D1F507F-7382-4F5B-9923-58398A565D8B}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "App", "src\QsFmt\App\App.fsproj", "{AD350766-EE10-4DE3-A834-129D026487FB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -387,6 +395,42 @@ Global
{23020BC1-8D69-40E1-A6BB-DB5D28247A7F}.Release|x64.Build.0 = Release|Any CPU
{23020BC1-8D69-40E1-A6BB-DB5D28247A7F}.Release|x86.ActiveCfg = Release|Any CPU
{23020BC1-8D69-40E1-A6BB-DB5D28247A7F}.Release|x86.Build.0 = Release|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|x64.ActiveCfg = Debug|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|x64.Build.0 = Debug|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|x86.ActiveCfg = Debug|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|x86.Build.0 = Debug|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|Any CPU.Build.0 = Release|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|x64.ActiveCfg = Release|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|x64.Build.0 = Release|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|x86.ActiveCfg = Release|Any CPU
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|x86.Build.0 = Release|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|x64.ActiveCfg = Debug|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|x64.Build.0 = Debug|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|x86.ActiveCfg = Debug|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|x86.Build.0 = Debug|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|Any CPU.Build.0 = Release|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|x64.ActiveCfg = Release|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|x64.Build.0 = Release|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|x86.ActiveCfg = Release|Any CPU
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|x86.Build.0 = Release|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|x64.ActiveCfg = Debug|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|x64.Build.0 = Debug|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|x86.ActiveCfg = Debug|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|x86.Build.0 = Debug|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|Any CPU.Build.0 = Release|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|x64.ActiveCfg = Release|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|x64.Build.0 = Release|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|x86.ActiveCfg = Release|Any CPU
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -407,6 +451,9 @@ Global
{2BCE252C-DCE8-48A6-B08C-E5DDD753506C} = {160AABCE-2317-4695-815C-D3B3F88BE780}
{B08BB875-89AF-4194-AC13-D8FB8290B54E} = {B4A9484D-31FC-4A27-9E26-4C8DE3E02D77}
{23020BC1-8D69-40E1-A6BB-DB5D28247A7F} = {B4A9484D-31FC-4A27-9E26-4C8DE3E02D77}
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5} = {755A6971-AD80-4519-A64E-0333B89C1E9D}
{4D1F507F-7382-4F5B-9923-58398A565D8B} = {755A6971-AD80-4519-A64E-0333B89C1E9D}
{AD350766-EE10-4DE3-A834-129D026487FB} = {755A6971-AD80-4519-A64E-0333B89C1E9D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B921C36B-4574-4025-8FE3-E5BD2D3D2B81}
Expand Down
9 changes: 2 additions & 7 deletions QsFmt.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,9 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Formatter", "src\QsFmt\Form
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "App", "src\QsFmt\App\App.fsproj", "{68F54AEE-C852-4FFA-831D-5BA741BE893E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4399BDF1-685A-4373-8748-142C835A52D6}"
ProjectSection(SolutionItems) = preProject
README.md = src\QsFmt\README.md
EndProjectSection
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Formatter.Tests", "src\QsFmt\Formatter.Tests\Formatter.Tests.fsproj", "{FC9E2BEC-F15F-4818-B0E1-805EA554269E}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Formatter.Tests", "src\QsFmt\Formatter.Tests\Formatter.Tests.fsproj", "{FC9E2BEC-F15F-4818-B0E1-805EA554269E}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "App.Tests", "src\QsFmt\App.Tests\App.Tests.fsproj", "{E00FA726-F852-4D14-90F8-1B0E3E08D822}"
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "App.Tests", "src\QsFmt\App.Tests\App.Tests.fsproj", "{E00FA726-F852-4D14-90F8-1B0E3E08D822}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ If you edit the [Microsoft.Quantum.Sdk](./src/QuantumSdk) as part of your change
```
dotnet publish src/QuantumSdk/Tools/Tools.sln -c Debug
dotnet publish src/QsCompiler/CommandLineTool/CommandLineTool.csproj -c Debug
dotnet publish src/QsFmt/App/App.fsproj -c Debug
nuget.exe pack src/QuantumSdk/QuantumSdk.nuspec -Version 1.0.0 -Properties Configuration=Debug
```
Move the created .nupkg file into your [local NuGet folder](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds). You can now use the package to build any Q# project by opening the project file in a text editor, and editing the Sdk version number in the first line to be
Expand Down
1 change: 1 addition & 0 deletions build/manifest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ $artifacts = @{
".\src\QsCompiler\LlvmBindings\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.LlvmBindings.dll",
".\src\QsCompiler\Transformations\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.QsTransformations.dll",
".\src\QsCompiler\CommandLineTool\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\qsc.dll",
".\src\QsFmt\App\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\qsfmt.dll",
".\src\QuantumSdk\Tools\BuildConfiguration\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\Microsoft.Quantum.Sdk.BuildConfiguration.dll",
".\src\QuantumSdk\Tools\DefaultEntryPoint\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\Microsoft.Quantum.Sdk.DefaultEntryPoint.Generation.dll"
) | ForEach-Object { Join-Path $PSScriptRoot (Join-Path ".." $_) };
Expand Down
1 change: 1 addition & 0 deletions build/pack.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Publish-One '../src/QsCompiler/CommandLineTool/CommandLineTool.csproj'
Publish-One '../src/QsCompiler/LlvmBindings/LlvmBindings.csproj'
Publish-One '../src/QuantumSdk/Tools/BuildConfiguration/BuildConfiguration.csproj'
Publish-One '../src/QuantumSdk/Tools/DefaultEntryPoint/DefaultEntryPoint.csproj'
Publish-One '../src/QsFmt/App/App.fsproj'

Pack-One '../src/QsCompiler/Compiler/Compiler.csproj' '-IncludeReferencedProjects'
Pack-One '../src/QsCompiler/QirGeneration/QirGeneration.csproj'
Expand Down
27 changes: 12 additions & 15 deletions src/QsCompiler/CompilationManager/CompilationUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,18 +315,14 @@ public class CompilationUnit : IReaderWriterLock, IDisposable

internal NamespaceManager GlobalSymbols { get; private set; }

internal ProjectProperties BuildProperties { get; }

private readonly Dictionary<QsQualifiedName, QsCallable> compiledCallables;
private readonly Dictionary<QsQualifiedName, QsCustomType> compiledTypes;

private readonly ReaderWriterLockSlim syncRoot;
private readonly HashSet<ReaderWriterLockSlim> dependentLocks;

internal RuntimeCapability RuntimeCapability { get; }

internal bool IsExecutable { get; }

internal string ProcessorArchitecture { get; }

/// <inheritdoc/>
public void Dispose()
{
Expand All @@ -338,9 +334,7 @@ public void Dispose()
/// with <paramref name="dependentLocks"/> registered as dependent locks if not null.
/// </summary>
internal CompilationUnit(
RuntimeCapability capability,
bool isExecutable,
string processorArchitecture,
ProjectProperties projectProperties,
References? externals = null,
IEnumerable<ReaderWriterLockSlim>? dependentLocks = null)
{
Expand All @@ -350,16 +344,19 @@ internal CompilationUnit(
this.syncRoot = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
this.dependentLocks = new HashSet<ReaderWriterLockSlim>(dependentLocks);

this.RuntimeCapability = capability;
this.IsExecutable = isExecutable;
this.ProcessorArchitecture = processorArchitecture;

this.compiledCallables = new Dictionary<QsQualifiedName, QsCallable>();
this.compiledTypes = new Dictionary<QsQualifiedName, QsCustomType>();
this.Externals = externals;
this.BuildProperties = projectProperties;
this.GlobalSymbols = this.CreateGlobalSymbols();
}

/// <inheritdoc cref="CompilationUnit(ProjectProperties, References?, IEnumerable{ReaderWriterLockSlim}?)" />
internal CompilationUnit(CompilationUnit compilationUnit, IEnumerable<ReaderWriterLockSlim>? dependentLocks = null)
: this(compilationUnit.BuildProperties, compilationUnit.Externals, dependentLocks ?? compilationUnit.dependentLocks)
{
}

/// <summary>
/// Creates a new instance of the namespace manager for global symbols.
/// </summary>
Expand All @@ -369,8 +366,8 @@ internal CompilationUnit(
this.Externals.Declarations.Values.SelectMany(h =>
h.Specializations.Select(t => Tuple.Create(t.Item1, t.Item2))),
this.Externals.Declarations.Values.SelectMany(h => h.Types),
this.RuntimeCapability,
this.IsExecutable);
this.BuildProperties.RuntimeCapability,
this.BuildProperties.IsExecutable);

/// <summary>
/// Replaces <see cref="GlobalSymbols"/> to match <paramref name="externals"/>.
Expand Down
Loading