Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit c3d82f0

Browse files
authored
QAT v. 0.1 (#1230)
1 parent 790813e commit c3d82f0

File tree

155 files changed

+25051
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+25051
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ paket-files/
306306
__pycache__/
307307
*.pyc
308308

309+
# Python Virtual environments
310+
*__venv/
311+
309312
# Cake - Uncomment if you are using it
310313
# tools/**
311314
# !tools/packages.config

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "src/Passes/vendors/googletest"]
2+
path = src/Passes/vendors/googletest
3+
url = https://github.com/google/googletest.git
4+
shallow = true

build/ci.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,27 @@ schedules:
2626
- main
2727
always: true
2828

29-
pool:
30-
vmImage: windows-latest
3129

3230
jobs:
3331
- job: Build
3432
steps:
3533
- template: init.yml
3634
- template: steps.yml
3735
- template: wrap-up.yml
36+
pool:
37+
vmImage: windows-latest
38+
39+
- job: LinuxBuild
40+
steps:
41+
- template: passes-linux.yml
42+
pool:
43+
vmImage: ubuntu-20.04
44+
45+
- job: MacOSBuild
46+
steps:
47+
- template: passes-mac.yml
48+
pool:
49+
vmImage: macOS-latest
3850

3951
- job: Style
4052
steps:
@@ -43,3 +55,5 @@ jobs:
4355

4456
- script: dotnet tool run fantomas -- --check --recurse .
4557
displayName: Fantomas
58+
pool:
59+
vmImage: windows-latest

build/passes-linux.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
steps:
3+
- script: |
4+
export DEBIAN_FRONTEND=noninteractive
5+
sudo apt-get update -y
6+
sudo apt-get install -y
7+
sudo apt-get remove -y llvm-12
8+
sudo apt-get install -y curl pkg-config findutils wget
9+
sudo apt install -y clang-11 cmake clang-format-11 clang-tidy-11
10+
sudo apt-get install -y llvm-11 lldb-11 llvm-11-dev libllvm11 llvm-11-runtime
11+
sudo apt install -y python3 python3-pip
12+
sudo apt-get remove -y llvm-10
13+
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 0
14+
git submodule update --init --recursive
15+
cd src/Passes/
16+
pip install -r requirements.txt
17+
chmod +x manage
18+
export PYTHONUNBUFFERED=1
19+
export PYTHON_BIN_PATH=/usr/bin/python3
20+
export CC=clang-11
21+
export CXX=clang++-11
22+
./manage runci
23+
24+
displayName: Linux build and CI for passes

build/passes-mac.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
steps:
3+
- script: |
4+
rm '/usr/local/bin/2to3'
5+
brew install llvm@11
6+
brew install cmake
7+
brew install [email protected]
8+
brew unlink [email protected]
9+
10+
11+
# Updating paths
12+
export PATH="/usr/local/opt/python/libexec/bin:$PATH"
13+
export PATH="/usr/local/opt/llvm@11/bin:$PATH"
14+
export LDFLAGS="${LDFLAGS} -L/usr/local/opt/llvm@11/lib"
15+
export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/llvm@11/include"
16+
17+
git submodule update --init --recursive
18+
cd src/Passes/
19+
pip3 install --user -r requirements.txt
20+
chmod +x manage
21+
./manage --loglevel info runci
22+

build/steps.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
steps:
2+
23
- pwsh: ./build.ps1
34
displayName: "Build all"
45
workingDirectory: $(System.DefaultWorkingDirectory)/build

build/test.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ function Test-One {
3838
}
3939
}
4040

41+
4142
Test-One '../QsCompiler.sln'
4243
Test-One '../QsFmt.sln'
4344

src/Passes/.clang-format

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
2+
3+
---
4+
Language: Cpp
5+
BasedOnStyle: Microsoft
6+
7+
# page width
8+
ColumnLimit: 120
9+
ReflowComments: true
10+
11+
# tabs and indents
12+
UseTab: Never
13+
IndentWidth: 4
14+
TabWidth: 4
15+
AccessModifierOffset: -2
16+
NamespaceIndentation: Inner
17+
18+
# line and statements layout
19+
BreakBeforeBraces: Allman
20+
BinPackParameters: false
21+
AlignAfterOpenBracket: AlwaysBreak
22+
AllowShortIfStatementsOnASingleLine: WithoutElse
23+
AllowShortFunctionsOnASingleLine: Empty
24+
AllowAllConstructorInitializersOnNextLine: false
25+
AllowAllArgumentsOnNextLine: true
26+
AllowAllParametersOfDeclarationOnNextLine: false
27+
BreakBeforeTernaryOperators: true
28+
BreakConstructorInitializers: BeforeComma
29+
30+
# misc
31+
Cpp11BracedListStyle: true
32+
FixNamespaceComments: true
33+
IncludeBlocks: Preserve
34+
SpaceBeforeInheritanceColon : true
35+
SpaceBeforeParens: ControlStatements
36+
DerivePointerAlignment: false
37+
PointerAlignment: Left
38+
39+
# Suggestions
40+
Standard: Cpp11
41+
AlignConsecutiveAssignments: true
42+
AlignConsecutiveDeclarations: true
43+
AlignTrailingComments: true
44+
45+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
46+
ConstructorInitializerIndentWidth: 2
47+
48+
IndentCaseLabels: false
49+
# NamespaceIndentation: None
50+
51+
# Ensures include compleness
52+
IncludeBlocks: Regroup
53+
IncludeCategories:
54+
- Regex: '.*\.\..*'
55+
Priority: 1
56+
- Regex: '^<.*\.h.*>$'
57+
Priority: 5
58+
- Regex: '^<.*>$'
59+
Priority: 6
60+
- Regex: '^"(llvm)/.*"$'
61+
Priority: 4
62+
- Regex: '.*/.*'
63+
Priority: 3
64+
- Regex: '.*'
65+
Priority: 2
66+
IncludeIsMainRegex: ''
67+
SortIncludes: true
68+
SortUsingDeclarations: true
69+
SpaceInEmptyParentheses: false

src/Passes/.clang-tidy

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
Checks: "-*,bugprone-*,\
2+
-readability-*,\
3+
readability-identifier-*,\
4+
readability-redundant-member-init,\
5+
readability-braces-around-statements,\
6+
cert-dcl*,\
7+
cert-env*,\
8+
cert-err52-cpp,\
9+
cert-err60-cpp,\
10+
cert-flp30-c,\
11+
clang-analyzer-*,\
12+
clang-analyzer-security.FloatLoopCounter,\
13+
google-build-explicit-make-pair,\
14+
google-build-namespaces,\
15+
google-explicit-constructor,\
16+
google-readability-*,\
17+
google-runtime-operator,\
18+
hicpp-exception-baseclass,\
19+
hicpp-explicit-conversions,\
20+
hicpp-use-*,\
21+
modernize-avoid-bind,\
22+
modernize-loop-convert,\
23+
modernize-make-shared,\
24+
modernize-make-unique,\
25+
modernize-redundant-void-arg,\
26+
modernize-replace-random-shuffle,\
27+
modernize-shrink-to-fit,\
28+
modernize-use-bool-literals,\
29+
modernize-use-default-member-init,\
30+
modernize-use-emplace,\
31+
modernize-use-equals-default,\
32+
modernize-use-equals-delete,\
33+
modernize-use-noexcept,\
34+
modernize-use-nullptr,\
35+
modernize-use-override,\
36+
modernize-use-transparent-functors,\
37+
misc-*,\
38+
-misc-misplaced-widening-cast,\
39+
-misc-no-recursion,\
40+
performance-*"
41+
42+
WarningsAsErrors: '*'
43+
HeaderFilterRegex: '.*'
44+
45+
CheckOptions:
46+
# Configuration documentation: https://clang.llvm.org/extra/clang-tidy/checks/readability-identifier-naming.html
47+
# Namespaces
48+
- key: readability-identifier-naming.NamespaceCase
49+
value: 'lower_case'
50+
51+
# Classes and structs
52+
- key: readability-identifier-naming.AbstractClassPrefix
53+
value: 'I'
54+
- key: readability-identifier-naming.ClassCase
55+
value: 'CamelCase'
56+
- key: readability-identifier-naming.StructCase
57+
value: 'CamelCase'
58+
- key: readability-identifier-naming.UnionCase
59+
value: 'CamelCase'
60+
61+
# Class members
62+
- key: readability-identifier-naming.PrivateMemberCase
63+
value: 'lower_case'
64+
- key: readability-identifier-naming.PrivateMemberSuffix
65+
value: '_'
66+
- key: readability-identifier-naming.ProtectedMemberCase
67+
value: 'lower_case'
68+
- key: readability-identifier-naming.ProtectedMemberSuffix
69+
value: '_'
70+
71+
# Type Alias and Enum Types / constants
72+
- key: readability-identifier-naming.TypeAliasCase
73+
value: 'CamelCase'
74+
- key: readability-identifier-naming.TypedefCase
75+
value: 'CamelCase'
76+
- key: readability-identifier-naming.EnumCase
77+
value: 'CamelCase'
78+
- key: readability-identifier-naming.EnumConstantCase
79+
value: 'CamelCase'
80+
81+
# Globals, consts and enums
82+
- key: readability-identifier-naming.GlobalConstantCase
83+
value: 'UPPER_CASE'
84+
- key: readability-identifier-naming.GlobalConstantPrefix
85+
value: 'G_'
86+
- key: readability-identifier-naming.ConstantCase
87+
value: 'UPPER_CASE'
88+
89+
# Functions
90+
- key: readability-identifier-naming.FunctionCase
91+
value: 'camelBack'
92+
- key: readability-identifier-naming.IgnoreMainLikeFunctions
93+
value: true
94+
95+
# Variables and parameters
96+
- key: readability-identifier-naming.VariableCase
97+
value: 'lower_case'
98+
- key: readability-identifier-naming.LocalVariableCase
99+
value: 'lower_case'
100+
- key: readability-identifier-naming.ParameterCase
101+
value: 'lower_case'
102+
103+
# Macros
104+
- key: readability-identifier-naming.MacroDefinitionCase
105+
value: 'UPPER_CASE'

src/Passes/.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Debug/
2+
**_env/

0 commit comments

Comments
 (0)