Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gcc compilation and CI integration. #307

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
build_linux:
strategy:
matrix:
compiler: [gcc, clang-16]
compiler: [ {c: gcc, cpp: g++}, {c: clang-16, cpp: clang++-16} ]
runs-on: ubuntu-22.04
timeout-minutes: 32

Expand All @@ -40,7 +40,8 @@ jobs:
uses: devcontainers/[email protected]
with:
runCmd: |
export CC=${{ matrix.compiler }}
export CC=${{ matrix.compiler.c }}
export CXX=${{ matrix.compiler.cpp }}

export TOOLCHAIN=$(pwd)/cmake/lld.toolchain.cmake

Expand Down
3 changes: 2 additions & 1 deletion include/vast/Util/Warnings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
#define VAST_GCC_RELAX_WARNINGS \
_Pragma( "GCC diagnostic ignored \"-Wuseless-cast\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wnull-dereference\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wmaybe-uninitialized\"" )
_Pragma( "GCC diagnostic ignored \"-Wmaybe-uninitialized\"" ) \
_Pragma( "GCC diagnostic ignored \"-Wduplicated-branches\"" )

#ifdef __clang__
#define VAST_RELAX_WARNINGS \
Expand Down
2 changes: 1 addition & 1 deletion include/vast/repl/command.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ namespace vast::repl
} else {
using current = typename std::tuple_element< 0, params_storage >::type;

if constexpr (current::param_name == name) {
if constexpr (std::string_view(current::param_name) == name) {
return util::head(params).value;
} else {
return get_param< name >(util::tail(params));
Expand Down
2 changes: 1 addition & 1 deletion lib/vast/Dialect/HighLevel/HighLevelLinkage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ namespace vast::hl {
auto &actx = decl->getASTContext();
auto linkage = actx.GetGVALinkageForFunction(decl);

if (const auto *dtor = clang::dyn_cast< clang::CXXDestructorDecl >(decl)) {
if (/*const auto *dtor =*/ clang::dyn_cast< clang::CXXDestructorDecl >(decl)) {
VAST_UNIMPLEMENTED;
}

Expand Down
1 change: 1 addition & 0 deletions lib/vast/Frontend/GenAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ namespace vast::cc {
case target_dialect::low_level: return "low_level";
case target_dialect::llvm: return "llvm";
}
VAST_UNREACHABLE("Unknown target dialect to string.");
}

void compile_via_vast(auto mod, mcontext_t *mctx)
Expand Down
2 changes: 1 addition & 1 deletion lib/vast/Translation/CodeGenDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ namespace vast::cg
VAST_UNIMPLEMENTED_MSG("codegen for multi version function");
}

if (const auto *method = llvm::dyn_cast< clang::CXXMethodDecl >(decl)) {
if (/*const auto *method =*/ llvm::dyn_cast< clang::CXXMethodDecl >(decl)) {
VAST_UNIMPLEMENTED_MSG("cxx methods");
}

Expand Down
2 changes: 1 addition & 1 deletion lib/vast/Translation/CodeGenFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace vast::cg
bool codegen_driver::may_drop_function_return(qual_type rty) const {
// We can't just disard the return value for a record type with a complex
// destructor or a non-trivially copyable type.
if (const auto *recorrd_type = rty.getCanonicalType()->getAs< clang::RecordType >()) {
if (/*const auto *record_type =*/ rty.getCanonicalType()->getAs< clang::RecordType >()) {
VAST_UNIMPLEMENTED;
}

Expand Down
1 change: 1 addition & 0 deletions lib/vast/Translation/CodeGenStmtVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ namespace vast::hl
case clang::PredefinedExpr::IdentKind::PrettyFunctionNoVirtual :
return IdentKind::PrettyFunctionNoVirtual;
}
VAST_UNREACHABLE( "unsupported ident kind" );
}

} // namespace vast::hl
2 changes: 1 addition & 1 deletion lib/vast/Translation/Mangler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace vast::cg

// Some ABIs don't have constructor variants. Make sure that base and complete
// constructors get mangled the same.
if (const auto *ctor = clang::dyn_cast< clang::CXXConstructorDecl >(canonical.getDecl())) {
if (/*const auto *ctor =*/ clang::dyn_cast< clang::CXXConstructorDecl >(canonical.getDecl())) {
VAST_UNIMPLEMENTED_IF(!target_info.getCXXABI().hasConstructorVariants());
}

Expand Down
2 changes: 1 addition & 1 deletion tools/vast-repl/vast-repl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace vast::repl

while (!cli.exit()) {
std::string cmd;
if (auto quit = linenoise::Readline("> ", cmd)) {
if (linenoise::Readline("> ", cmd)) {
break;
}

Expand Down