Skip to content

Commit

Permalink
Set right-alignment for qualifiers (#954)
Browse files Browse the repository at this point in the history
As suggested in
#936, this PR
sets the appropriate `clang-format` option to right-align qualifiers in
the backend (that is, writing `T const&` rather than `const T&`).

This PR is fully mechanical and introduces no manual changes to the
code.

---------

Co-authored-by: rv-jenkins <admin@runtimeverification.com>
  • Loading branch information
Baltoli and rv-jenkins authored Jan 17, 2024
1 parent 8bdf2a5 commit b02b982
Show file tree
Hide file tree
Showing 61 changed files with 409 additions and 407 deletions.
2 changes: 2 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ SpaceBeforeCpp11BracedList: false
DerivePointerAlignment: false
PointerAlignment: Right
ReflowComments: false
QualifierAlignment: Custom
QualifierOrder: ['static', 'constexpr', 'inline', 'friend', 'type', 'const', 'volatile', 'restrict']
...
2 changes: 1 addition & 1 deletion bindings/c/lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ struct kore_error {
return nullptr;
}

void set_error(const std::string &msg) {
void set_error(std::string const &msg) {
success_ = false;
message_ = msg;
}
Expand Down
4 changes: 2 additions & 2 deletions bindings/core/src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using namespace kllvm;
* through any header files, so we pull them in manually here.
*/
extern "C" {
void *constructInitialConfiguration(const KOREPattern *);
void *constructInitialConfiguration(KOREPattern const *);
}

namespace kllvm::bindings {
Expand Down Expand Up @@ -94,7 +94,7 @@ evaluate_function(std::shared_ptr<KORECompositePattern> const &term) {

auto label = ast_to_string(*term->getConstructor());
auto tag = getTagForSymbolName(label.c_str());
const auto *return_sort = getReturnSortForTag(tag);
auto const *return_sort = getReturnSortForTag(tag);
auto *result = evaluateFunctionSymbol(tag, term_args.data());

return sortedTermToKorePattern(static_cast<block *>(result), return_sort);
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extern "C" {
void initStaticObjects(void);
void freeAllKoreMem(void);
block *take_steps(int64_t, block *);
void *constructInitialConfiguration(const KOREPattern *initial);
void *constructInitialConfiguration(KOREPattern const *initial);
}

void bind_runtime(py::module_ &m) {
Expand Down
Loading

0 comments on commit b02b982

Please sign in to comment.