Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0037f62
Added CMake for examples
ravil-mobile Jun 1, 2021
5224f0b
Added LLVM jit engine
ravil-mobile Jun 1, 2021
adfb691
added compileLayer in the engine.
ravil-mobile Jun 1, 2021
13ce309
Re-ordered a file structure and generation mechanism
ravil-mobile Jun 2, 2021
0b01ec2
Added LLVM code generation (except external math functions)
ravil-mobile Jun 2, 2021
f8abae8
Added a simple symbol table
ravil-mobile Jun 3, 2021
f94b9b7
Applied symbol table. Handle returns with llvm::isa
Jun 4, 2021
92bf619
Fixed external linking
ravil-mobile Jun 4, 2021
b38677a
Added a factory method for toolboxes
ravil-mobile Jun 4, 2021
cff6c15
applied formating for some files
ravil-mobile Jun 4, 2021
d908899
Switched to google tests
ravil-mobile Jun 4, 2021
34522be
Added visitors
Jun 5, 2021
5725c62
Added compile options to JIT
ravil-mobile Jun 5, 2021
aa2cf56
Removed legacy code generator
ravil-mobile Jun 5, 2021
1f0a953
Added missing header files
ravil-mobile Jun 5, 2021
94aed5f
Added CI (#1)
Jun 6, 2021
60dd99f
Added format.sh for clang-format
Jun 6, 2021
7a7f440
added formating to the CI workflow (#2)
Jun 6, 2021
c1b0f8d
Ravil/install (#3)
Jun 9, 2021
6fb35ed
Update README.md
Jun 9, 2021
90e92aa
Update README.md
Jun 9, 2021
a63ca4b
Ravil/bug fixes (#4)
Jun 10, 2021
83d0c21
Update README.md
Jun 10, 2021
d3cd53b
Ravil/cmake (#5)
Jun 11, 2021
8eb49f7
Added a linkage option (weak is default b/c compatibility with SeisSo…
Jun 12, 2021
c29f385
Ravil/opt (#7)
Jun 13, 2021
d449b7b
Added selected opt. passes (#8)
Jun 14, 2021
cacc7d1
Ravil/cmake (#9)
Jun 15, 2021
55786f9
Improved CMake based on SeisSol PR
ravil-mobile Jun 17, 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
135 changes: 135 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
- Regex: '.*'
Priority: 1
SortPriority: 0
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Latest
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseCRLF: false
UseTab: Never
34 changes: 34 additions & 0 deletions .dev/format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#! /usr/bin/env sh

# NOTE: This script was taken from PointCloudLibrary/pcl and adapted for ImpalaJIT

# sample command line usage: $0 clang-format(version >= 6.0) $IMPALA_SOURCE_DIR
# $ sh ./.dev/format.sh `which clang-format` ./
# $ sh format.sh `which clang-format` ../

format() {
# don't use a directory with whitespace
local whitelist="compiler/engine compiler/code-gen"

local IMPALA_DIR="${2}"
local formatter="${1}"

if [ ! -f "${formatter}" ]; then
echo "Could not find a clang-format. Please specify one as the first argument"
exit 166
fi

# check for self
if [ ! -f "${IMPALA_DIR}/.dev/format.sh" ]; then
echo "Please ensure that IMPALA_SOURCE_DIR is passed as the second argument"
exit 166
fi

for dir in ${whitelist}; do
path=${IMPALA_DIR}/${dir}
find ${path} -type f -iname *.[ch] -o -iname *.[ch]pp -o -iname *.[ch]xx \
-iname *.cu | xargs -n1 ${formatter} -i -style=file
done
}

format $@
82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: CMake

on: push

env:
BUILD_TYPE: Release

jobs:
testing:
runs-on: ubuntu-18.04
strategy:
matrix:
llvm_version: [10, 11]

steps:
- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v1.9
with:
cmake-version: '3.16.x'

- name: Install GTest
run: |
sudo apt-get install libgtest-dev
cd /usr/src/gtest
sudo cmake CMakeLists.txt -Dgtest_disable_pthreads=ON
sudo make
sudo make install

- name: Install LLVM ${{ matrix.llvm_version }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{ matrix.llvm_version }}
sudo apt-get -y install zlib1g-dev

- uses: actions/checkout@v2

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DTESTS=ON

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j2

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}

- name: Test Installed
run: |
cd ${{github.workspace}}/build
sudo make install
cd ${{github.workspace}}/tests/install_test
mkdir build && cd build
cmake ..
make
./install_test

format:
runs-on: ubuntu-18.04
env:
CLANG_FORMAT_VERSION: 10
steps:
- name: Install Clang Format ${{env.CLANG_FORMAT_VERSION}}
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{env.CLANG_FORMAT_VERSION}}
sudo apt-get remove clang-format*
sudo apt-get -y install clang-format-${{env.CLANG_FORMAT_VERSION}} zlib1g-dev
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-${{env.CLANG_FORMAT_VERSION}} 10

- name: Show Clang Format Version
run: clang-format --version

- uses: actions/checkout@v2

- name: Check Formating
run: |
./.dev/format.sh $(which clang-format) .
git diff > formatting.patch
cat formatting.patch
if [ -s ./formatting.patch ]; then (exit 166); fi
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
minilua
build
lib/*
cmake-build-*
.vscode
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "3rd_party/LuaJIT"]
path = 3rd_party/LuaJIT
url = https://github.com/LuaJIT/LuaJIT.git
1 change: 0 additions & 1 deletion 3rd_party/LuaJIT
Submodule LuaJIT deleted from bd7e42
11 changes: 0 additions & 11 deletions CMake/pkg-config.pc.in

This file was deleted.

Loading