-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ahueck/devel
Create first major version based on improvements of branch devel
- Loading branch information
Showing
123 changed files
with
2,660 additions
and
2,704 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
Language: Cpp | ||
# BasedOnStyle: Google | ||
AccessModifierOffset: -1 | ||
ConstructorInitializerIndentWidth: 4 | ||
AlignEscapedNewlinesLeft: true | ||
AlignTrailingComments: true | ||
AllowAllParametersOfDeclarationOnNextLine: true | ||
AllowShortIfStatementsOnASingleLine: false | ||
AllowShortLoopsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: None | ||
AlwaysBreakTemplateDeclarations: true | ||
AlwaysBreakBeforeMultilineStrings: true | ||
BreakBeforeBinaryOperators: false | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializersBeforeComma: false | ||
BinPackParameters: true | ||
ColumnLimit: 120 | ||
BreakConstructorInitializersBeforeComma: true | ||
DerivePointerBinding: true | ||
ExperimentalAutoDetectBinPacking: false | ||
IndentCaseLabels: true | ||
MaxEmptyLinesToKeep: 1 | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
NamespaceIndentation: None | ||
ObjCSpaceAfterProperty: false | ||
ObjCSpaceBeforeProtocolList: false | ||
PenaltyBreakBeforeFirstCallParameter: 1 | ||
PenaltyBreakComment: 300 | ||
PenaltyBreakString: 1000 | ||
PenaltyBreakFirstLessLess: 120 | ||
PenaltyExcessCharacter: 1000000 | ||
PenaltyReturnTypeOnItsOwnLine: 200 | ||
PointerBindsToType: true | ||
SpacesBeforeTrailingComments: 2 | ||
Cpp11BracedListStyle: true | ||
Standard: Auto | ||
IndentWidth: 2 | ||
TabWidth: 4 | ||
UseTab: Never | ||
BreakBeforeBraces: Attach | ||
MaxEmptyLinesToKeep: 1 | ||
IndentFunctionDeclarationAfterType: true | ||
SpacesInParentheses: false | ||
SpacesInAngles: false | ||
SpaceInEmptyParentheses: false | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInContainerLiterals: true | ||
SpaceBeforeAssignmentOperators: true | ||
ContinuationIndentWidth: 4 | ||
CommentPragmas: '^ IWYU pragma:' | ||
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] | ||
SpaceBeforeParens: ControlStatements | ||
... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,6 @@ | |
|
||
# Build folder | ||
build/* | ||
|
||
# bin folder | ||
bin/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,30 @@ | ||
language: C++ | ||
|
||
compiler: | ||
- gcc | ||
|
||
before_install: | ||
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y | ||
- wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add - | ||
- echo "deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.5 main" | sudo tee -a /etc/apt/sources.list | ||
- echo "deb-src http://llvm.org/apt/precise/ llvm-toolchain-precise-3.5 main" | sudo tee -a /etc/apt/sources.list | ||
- sudo apt-get update -qq | ||
|
||
install: | ||
- sudo apt-get install gcc-4.8 g++-4.8 | ||
- sudo apt-get install zlib1g-dev libxml2-dev libedit-dev clang-3.5 libclang-common-3.5-dev libclang-3.5-dev libclang1-3.5 libllvm-3.5-ocaml-dev libllvm3.5 llvm-3.5 llvm-3.5-dev llvm-3.5-runtime | ||
|
||
before_script: | ||
- mkdir build | ||
- cd build | ||
|
||
script: | ||
- 'echo "successfull build"' | ||
- cmake -DCMAKE_CXX_COMPILER=g++-4.8 -DMAKE_TEST=TRUE -DLOG_LEVEL=0 .. | ||
- make | ||
- cd .. && chmod +x unit_tests.sh | ||
- ./unit_tests.sh | ||
|
||
branches: | ||
only: | ||
- master | ||
- devel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,79 @@ | ||
## opovlint | ||
[![Build Status](https://travis-ci.org/ahueck/opovlint.svg?branch=master)](https://travis-ci.org/ahueck/opovlint) | ||
|
||
OO-Lint (opovlint) | ||
=========== | ||
|
||
This is a project for linting operator overloads in C++. It is implemented as | ||
a Clang-tool. | ||
a Clang tool. | ||
|
||
|
||
Disclaimer | ||
------------ | ||
|
||
## Disclaimer | ||
The status of this software is alpha level. | ||
|
||
The status of this software is pre-alpha level and not ready for public usage. | ||
|
||
## License | ||
License | ||
------------ | ||
|
||
Distributed under the MIT License. For details refer to file "LICENSE" | ||
Distributed under the MIT License. For details refer to the [LICENSE file](LICENSE) | ||
|
||
|
||
## Motivation | ||
Motivation | ||
------------ | ||
|
||
Operator Overloading allows for the semantic augmentation of existing codes | ||
The basic arithmetic type in a code is replaced by a user-defined type | ||
Type change (in theory this just works): | ||
typedef scalar double -> typedef scalar userdef_double | ||
Operator Overloading allows for the semantic augmentation of existing codes. | ||
The basic arithmetic type in a code is replaced by a user-defined type. | ||
|
||
*Type change* (in theory this just works): | ||
- typedef **double** scalar; -> typedef **userdef_double** scalar; | ||
|
||
However, several coding patterns are not compatible with user-defined classes | ||
and result in compile time errors | ||
- Implicit Conversions | ||
“At most one user-defined conversion [...] is implicitly | ||
applied to a single value.” – §12.3-4, C++03 Standard | ||
- “At most one user-defined conversion [...] is implicitly | ||
applied to a single value.” – [§12.3-4, C++03 Standard] | ||
- Subset: | ||
- Boolean Conversions: i.e., conditional statements | ||
- Unions | ||
Incompatible with complex data classes (§9.5-1, C++03 Standard) | ||
- Incompatible with complex data classes [§9.5-1, C++03 Standard] | ||
- Explicit Conversions | ||
Cast operation from a user-defined type to a built-in often not possible | ||
- Cast operation from a user-defined type to a built-in is often not possible | ||
- etc. | ||
|
||
|
||
## Goal | ||
Goal | ||
------------ | ||
|
||
Provide developers of (numerical) codes with static code analysis | ||
o avoid problematic coding patterns | ||
to avoid problematic coding patterns | ||
|
||
For legacy numerical codes: | ||
- Flag potential problematic code locations | ||
- Ideally autocorrect them | ||
- Flag potential problematic code locations | ||
- Ideally autocorrect them | ||
|
||
|
||
Installation | ||
------------ | ||
|
||
The tool is developed and tested on Linux. | ||
For Ubuntu/Dabian, refer to the [Travis CI file](.travis.yml) for guidance. | ||
|
||
### Prerequisites | ||
|
||
1. C++ Compiler with C++11 support (gcc version >= 4.8) | ||
2. Cmake (version >=2.8) | ||
3. Clang/LLVM in Version 3.5.0. Newer versions might not work due to the changing API. | ||
The build system relies on the presence of the **llvm-config**(-3.5 -3.6 -3.7) binary. | ||
If it can't be found, set the cmake variable ${LLVM_ROOT_DIR} to point to the | ||
respective bin/ folder where llvm-config is located. | ||
|
||
### Build the OO-Lint tool | ||
|
||
In the root folder of the project: | ||
|
||
## Installation | ||
mkdir build && cd build/ | ||
cmake -DCMAKE_BUILD_TYPE=Release .. | ||
make | ||
|
||
TBD | ||
The binary should be created in the project bin/ folder. |
Oops, something went wrong.