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
20 commits
Select commit Hold shift + click to select a range
68835c8
added MSBuild_Logs to gitignore (#1171)
filipw Oct 12, 2021
233e3e8
Command Line Support for Project File Input (#1192)
ScottCarda-MS Oct 15, 2021
9dcd272
Change --inputs to --input (#1210)
ScottCarda-MS Oct 21, 2021
f31cfaf
Deprecate new array expression (#956)
bamarsha Oct 26, 2021
0dabca7
Removing temporary project (#1225)
bettinaheim Oct 27, 2021
9cdcb3e
Formatter Updates Deprecated Boolean Operator Syntax (#1214)
yjt98765 Oct 27, 2021
9c34c04
Update the documentation found in the Q# Formatter Project (#1203)
ScottCarda-MS Oct 29, 2021
8d9982d
Formatter Updates Deprecated Specialization Declaration Parameters (#…
yjt98765 Nov 3, 2021
790813e
Adding Sdk integration, and formatting support + code action for synt…
bettinaheim Nov 5, 2021
c3d82f0
QAT v. 0.1 (#1230)
troels-im Nov 8, 2021
487d31d
Sdk changes to support Qir targets (#1238)
bettinaheim Nov 9, 2021
2555a55
Quantum Development Kit Telemetry Library (#1199)
vxfield Nov 10, 2021
a02f79b
Allowing to use the LLVM intrinsic readcyclecounter from Q# (#1248)
bettinaheim Nov 10, 2021
5130928
Do case-insensitive comparisons for targets names (#1241)
ricardo-espinoza Nov 10, 2021
40494dd
Refactor language server code for extracting symbols from Q# fragment…
bamarsha Nov 11, 2021
19c6496
Statement Kinds Support (#1212)
ScottCarda-MS Nov 11, 2021
d77793c
Addressing last comments - QAT v0.1 (#1240)
troels-im Nov 11, 2021
5e38090
Updates for QIR validation (#1250)
troels-im Nov 11, 2021
dae2969
Complete NamespaceItem in qsfmt (#1239)
yjt98765 Nov 12, 2021
701e12a
Merge latest from main.
cesarzc Nov 16, 2021
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ paket-files/
__pycache__/
*.pyc

# Python Virtual environments
*__venv/

# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
Expand Down Expand Up @@ -365,6 +368,8 @@ src/ProjectTemplates/Quantum.Test1/.template.config/template.json
src/QsCompiler/QirGeneration/QirGeneration.nuspec
/examples/QIR/Development/qir/*
/examples/QIR/Development/build
src/Telemetry/Tests/coverage.json
src/Telemetry/.vscode/settings.json

# MSBuild logs
MSBuild_Logs/
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "src/Passes/vendors/googletest"]
path = src/Passes/vendors/googletest
url = https://github.com/google/googletest.git
shallow = true
1 change: 1 addition & 0 deletions build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ $all_ok = $True
Build-One '../QsCompiler.sln'
Build-One '../examples/QIR/QIR.sln'
Build-One '../src/QuantumSdk/Tools/Tools.sln'
Build-One '../src/Telemetry/Telemetry.sln'
Build-One '../QsFmt.sln'

if ($Env:ENABLE_VSIX -ne "false") {
Expand Down
18 changes: 16 additions & 2 deletions build/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,27 @@ schedules:
- main
always: true

pool:
vmImage: windows-latest

jobs:
- job: Build
steps:
- template: init.yml
- template: steps.yml
- template: wrap-up.yml
pool:
vmImage: windows-latest

- job: LinuxBuild
steps:
- template: passes-linux.yml
pool:
vmImage: ubuntu-20.04

- job: MacOSBuild
steps:
- template: passes-mac.yml
pool:
vmImage: macOS-latest

- job: Style
steps:
Expand All @@ -43,3 +55,5 @@ jobs:

- script: dotnet tool run fantomas -- --check --recurse .
displayName: Fantomas
pool:
vmImage: windows-latest
1 change: 1 addition & 0 deletions build/init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ steps:
inputs:
command: 'custom'
customCommand: 'install -g npm@latest'

24 changes: 24 additions & 0 deletions build/passes-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

steps:
- script: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update -y
sudo apt-get install -y
sudo apt-get remove -y llvm-12
sudo apt-get install -y curl pkg-config findutils wget
sudo apt install -y clang-11 cmake clang-format-11 clang-tidy-11
sudo apt-get install -y llvm-11 lldb-11 llvm-11-dev libllvm11 llvm-11-runtime
sudo apt install -y python3 python3-pip
sudo apt-get remove -y llvm-10
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 0
git submodule update --init --recursive
cd src/Passes/
pip install -r requirements.txt
chmod +x manage
export PYTHONUNBUFFERED=1
export PYTHON_BIN_PATH=/usr/bin/python3
export CC=clang-11
export CXX=clang++-11
./manage runci

displayName: Linux build and CI for passes
22 changes: 22 additions & 0 deletions build/passes-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

steps:
- script: |
rm '/usr/local/bin/2to3'
brew install llvm@11
brew install cmake
brew install [email protected]
brew unlink [email protected]
brew link [email protected]

# Updating paths
export PATH="/usr/local/opt/python/libexec/bin:$PATH"
export PATH="/usr/local/opt/llvm@11/bin:$PATH"
export LDFLAGS="${LDFLAGS} -L/usr/local/opt/llvm@11/lib"
export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/llvm@11/include"

git submodule update --init --recursive
cd src/Passes/
pip3 install --user -r requirements.txt
chmod +x manage
./manage --loglevel info runci

5 changes: 5 additions & 0 deletions build/set-env.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ $ErrorActionPreference = 'Stop'

Write-Host "Setting up build environment variables"

# Enable the QDK Telemetry Library to throw exceptions
# This is useful to capture unexpected unhandled exceptions as we
# test telemetry-related code
$env:ENABLE_QDK_TELEMETRY_EXCEPTIONS = "1"

If ($Env:BUILD_CONFIGURATION -eq $null) { $Env:BUILD_CONFIGURATION ="Debug" }
If ($Env:BUILD_VERBOSITY -eq $null) { $Env:BUILD_VERBOSITY ="m" }
If ($Env:ASSEMBLY_VERSION -eq $null) { $Env:ASSEMBLY_VERSION ="0.0.1.0" }
Expand Down
1 change: 1 addition & 0 deletions build/steps.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
steps:

- pwsh: ./build.ps1
displayName: "Build all"
workingDirectory: $(System.DefaultWorkingDirectory)/build
Expand Down
2 changes: 2 additions & 0 deletions build/test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ function Test-One {
}
}


Test-One '../QsCompiler.sln'
Test-One '../src/Telemetry/Telemetry.sln'
Test-One '../QsFmt.sln'

if (-not $all_ok) {
Expand Down
7 changes: 4 additions & 3 deletions examples/QIR/Development/Development.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.18.2107151063-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.20.2110171573">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand All @@ -20,8 +20,8 @@
<PackageReference Condition="$([MSBuild]::IsOsPlatform('Linux')) And '$(UbuntuVersion)' != '18.04'"
Include="libLLVM.runtime.ubuntu.20.04-x64" Version="11.0.0"
PrivateAssets="All" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.Quantum.Qir.Runtime" Version="0.18.2107151063-alpha" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.18.2107151063-beta" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.Quantum.Qir.Runtime" Version="0.20.2110171573-alpha" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.20.2110171573" GeneratePathProperty="true" />
</ItemGroup>

<PropertyGroup>
Expand Down Expand Up @@ -136,6 +136,7 @@
<ItemGroup>
<_QirRuntimeLibFiles Include="$(QirRuntimeLibs)/**/*.*" Exclude="$(QirRuntimeLibs)/**/*.exe" />
<_QirRuntimeHeaderFiles Include="$(QirRuntimeHeaders)/**/*.hpp" />
<_QirRuntimeHeaderFiles Include="$(QirRuntimeHeaders)/**/*.h" />
</ItemGroup>
<Copy SourceFiles="$(SimulatorRuntime)" DestinationFolder="$(BuildOutputPath)" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(_QirRuntimeLibFiles)" DestinationFolder="$(BuildOutputPath)\%(RecursiveDir)" SkipUnchangedFiles="true" />
Expand Down
2 changes: 1 addition & 1 deletion examples/QIR/Emission/Emission.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.18.2107151063-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.20.2110171573">

<PropertyGroup>
<QscVerbosity>Detailed</QscVerbosity>
Expand Down
69 changes: 69 additions & 0 deletions src/Passes/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html

---
Language: Cpp
BasedOnStyle: Microsoft

# page width
ColumnLimit: 120
ReflowComments: true

# tabs and indents
UseTab: Never
IndentWidth: 4
TabWidth: 4
AccessModifierOffset: -2
NamespaceIndentation: Inner

# line and statements layout
BreakBeforeBraces: Allman
BinPackParameters: false
AlignAfterOpenBracket: AlwaysBreak
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortFunctionsOnASingleLine: Empty
AllowAllConstructorInitializersOnNextLine: false
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma

# misc
Cpp11BracedListStyle: true
FixNamespaceComments: true
IncludeBlocks: Preserve
SpaceBeforeInheritanceColon : true
SpaceBeforeParens: ControlStatements
DerivePointerAlignment: false
PointerAlignment: Left

# Suggestions
Standard: Cpp11
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignTrailingComments: true

ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 2

IndentCaseLabels: false
# NamespaceIndentation: None

# Ensures include compleness
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '.*\.\..*'
Priority: 1
- Regex: '^<.*\.h.*>$'
Priority: 5
- Regex: '^<.*>$'
Priority: 6
- Regex: '^"(llvm)/.*"$'
Priority: 4
- Regex: '.*/.*'
Priority: 3
- Regex: '.*'
Priority: 2
IncludeIsMainRegex: ''
SortIncludes: true
SortUsingDeclarations: true
SpaceInEmptyParentheses: false
105 changes: 105 additions & 0 deletions src/Passes/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
Checks: "-*,bugprone-*,\
-readability-*,\
readability-identifier-*,\
readability-redundant-member-init,\
readability-braces-around-statements,\
cert-dcl*,\
cert-env*,\
cert-err52-cpp,\
cert-err60-cpp,\
cert-flp30-c,\
clang-analyzer-*,\
clang-analyzer-security.FloatLoopCounter,\
google-build-explicit-make-pair,\
google-build-namespaces,\
google-explicit-constructor,\
google-readability-*,\
google-runtime-operator,\
hicpp-exception-baseclass,\
hicpp-explicit-conversions,\
hicpp-use-*,\
modernize-avoid-bind,\
modernize-loop-convert,\
modernize-make-shared,\
modernize-make-unique,\
modernize-redundant-void-arg,\
modernize-replace-random-shuffle,\
modernize-shrink-to-fit,\
modernize-use-bool-literals,\
modernize-use-default-member-init,\
modernize-use-emplace,\
modernize-use-equals-default,\
modernize-use-equals-delete,\
modernize-use-noexcept,\
modernize-use-nullptr,\
modernize-use-override,\
modernize-use-transparent-functors,\
misc-*,\
-misc-misplaced-widening-cast,\
-misc-no-recursion,\
performance-*"

WarningsAsErrors: '*'
HeaderFilterRegex: '.*'

CheckOptions:
# Configuration documentation: https://clang.llvm.org/extra/clang-tidy/checks/readability-identifier-naming.html
# Namespaces
- key: readability-identifier-naming.NamespaceCase
value: 'lower_case'

# Classes and structs
- key: readability-identifier-naming.AbstractClassPrefix
value: 'I'
- key: readability-identifier-naming.ClassCase
value: 'CamelCase'
- key: readability-identifier-naming.StructCase
value: 'CamelCase'
- key: readability-identifier-naming.UnionCase
value: 'CamelCase'

# Class members
- key: readability-identifier-naming.PrivateMemberCase
value: 'lower_case'
- key: readability-identifier-naming.PrivateMemberSuffix
value: '_'
- key: readability-identifier-naming.ProtectedMemberCase
value: 'lower_case'
- key: readability-identifier-naming.ProtectedMemberSuffix
value: '_'

# Type Alias and Enum Types / constants
- key: readability-identifier-naming.TypeAliasCase
value: 'CamelCase'
- key: readability-identifier-naming.TypedefCase
value: 'CamelCase'
- key: readability-identifier-naming.EnumCase
value: 'CamelCase'
- key: readability-identifier-naming.EnumConstantCase
value: 'CamelCase'

# Globals, consts and enums
- key: readability-identifier-naming.GlobalConstantCase
value: 'UPPER_CASE'
- key: readability-identifier-naming.GlobalConstantPrefix
value: 'G_'
- key: readability-identifier-naming.ConstantCase
value: 'UPPER_CASE'

# Functions
- key: readability-identifier-naming.FunctionCase
value: 'camelBack'
- key: readability-identifier-naming.IgnoreMainLikeFunctions
value: true

# Variables and parameters
- key: readability-identifier-naming.VariableCase
value: 'lower_case'
- key: readability-identifier-naming.LocalVariableCase
value: 'lower_case'
- key: readability-identifier-naming.ParameterCase
value: 'lower_case'

# Macros
- key: readability-identifier-naming.MacroDefinitionCase
value: 'UPPER_CASE'
2 changes: 2 additions & 0 deletions src/Passes/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Debug/
**_env/
Loading