Skip to content
Merged
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
16 changes: 16 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM ubuntu:24.10

RUN apt-get update && apt-get install -y \
bash-completion \
build-essential \
clang-format \
clangd \
cmake \
ninja-build \
python3-pip \
python3-venv \
wget

RUN wget -nd -P /tmp/ https://github.com/watchexec/watchexec/releases/download/v2.2.0/watchexec-2.2.0-$(uname -m)-unknown-linux-gnu.deb \
&& dpkg -i /tmp/watchexec-2.2.0-$(uname -m)-unknown-linux-gnu.deb \
&& rm -f /tmp/watchexec-2.2.0-$(uname -m)-unknown-linux-gnu.deb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Ubuntu 24.04",
"name": "Ubuntu 24.10",

"build": {
"dockerfile": "Dockerfile"
Expand All @@ -16,19 +16,23 @@
"postCreateCommand": "npm ci",

"features": {
"ghcr.io/devcontainers/features/common-utils": {},
"ghcr.io/devcontainers/features/github-cli": "latest",
"ghcr.io/devcontainers/features/node": "latest",
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
"ghcr.io/devcontainers/features/node": "latest"
},

"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint"
]
"llvm-vs-code-extensions.vscode-clangd",
"llvm-vs-code-extensions.lldb-dap"
],
"settings": {
"clangd.arguments": [
"--compile-commands-dir=build",
"--completion-style=bundled"
]
}
}
}
}
11 changes: 0 additions & 11 deletions .devcontainer/ubuntu/Dockerfile

This file was deleted.

4 changes: 2 additions & 2 deletions src/frontend/cxx/cli.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct CLIOptionDescr {
std::string arg;
std::string help;
CLIOptionDescrKind kind;
bool CLI::*flag = nullptr;
bool CLI::* flag = nullptr;
CLIOptionVisibility visibility{CLIOptionVisibility::kDefault};

CLIOptionDescr(std::string option, std::string arg, std::string help,
Expand All @@ -88,7 +88,7 @@ struct CLIOptionDescr {
kind(kind),
visibility(visibility) {}

CLIOptionDescr(std::string option, std::string help, bool CLI::*flag,
CLIOptionDescr(std::string option, std::string help, bool CLI::* flag,
CLIOptionVisibility visibility = CLIOptionVisibility::kDefault)
: option(std::move(option)),
help(std::move(help)),
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/cxx/frontend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
namespace {
using namespace cxx;

auto readAll(const std::string& fileName,
std::istream& in) -> std::optional<std::string> {
auto readAll(const std::string& fileName, std::istream& in)
-> std::optional<std::string> {
std::string code;
char buffer[4 * 1024];
do {
Expand Down
26 changes: 14 additions & 12 deletions src/parser/cxx/control.cc
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ auto Control::getLongDoubleType() -> const LongDoubleType* {
return &d->longDoubleType;
}

auto Control::getQualType(const Type* elementType,
CvQualifiers cvQualifiers) -> const QualType* {
auto Control::getQualType(const Type* elementType, CvQualifiers cvQualifiers)
-> const QualType* {
return &*d->qualTypes.emplace(elementType, cvQualifiers).first;
}

Expand All @@ -360,8 +360,8 @@ auto Control::getConstVolatileType(const Type* elementType) -> const QualType* {
return getQualType(elementType, CvQualifiers::kConstVolatile);
}

auto Control::getBoundedArrayType(const Type* elementType,
std::size_t size) -> const BoundedArrayType* {
auto Control::getBoundedArrayType(const Type* elementType, std::size_t size)
-> const BoundedArrayType* {
return &*d->boundedArrayTypes.emplace(elementType, size).first;
}

Expand Down Expand Up @@ -392,8 +392,8 @@ auto Control::getOverloadSetType(OverloadSetSymbol* symbol)
auto Control::getFunctionType(const Type* returnType,
std::vector<const Type*> parameterTypes,
bool isVariadic, CvQualifiers cvQualifiers,
RefQualifier refQualifier,
bool isNoexcept) -> const FunctionType* {
RefQualifier refQualifier, bool isNoexcept)
-> const FunctionType* {
return &*d->functionTypes
.emplace(returnType, std::move(parameterTypes), isVariadic,
cvQualifiers, refQualifier, isNoexcept)
Expand Down Expand Up @@ -422,17 +422,19 @@ auto Control::getTemplateTypeParameterType(TemplateTypeParameterSymbol* symbol)
return &*d->templateTypeParameterTypes.emplace(symbol).first;
}

auto Control::getUnresolvedNameType(
TranslationUnit* unit, NestedNameSpecifierAST* nestedNameSpecifier,
UnqualifiedIdAST* unqualifiedId) -> const UnresolvedNameType* {
auto Control::getUnresolvedNameType(TranslationUnit* unit,
NestedNameSpecifierAST* nestedNameSpecifier,
UnqualifiedIdAST* unqualifiedId)
-> const UnresolvedNameType* {
return &*d->unresolvedNameTypes
.emplace(unit, nestedNameSpecifier, unqualifiedId)
.first;
}

auto Control::getUnresolvedBoundedArrayType(
TranslationUnit* unit, const Type* elementType,
ExpressionAST* sizeExpression) -> const UnresolvedBoundedArrayType* {
auto Control::getUnresolvedBoundedArrayType(TranslationUnit* unit,
const Type* elementType,
ExpressionAST* sizeExpression)
-> const UnresolvedBoundedArrayType* {
return &*d->unresolvedBoundedArrayTypes
.emplace(unit, elementType, sizeExpression)
.first;
Expand Down
13 changes: 7 additions & 6 deletions src/parser/cxx/control.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ class Control {
-> const QualType*;
[[nodiscard]] auto getConstVolatileType(const Type* elementType)
-> const QualType*;
[[nodiscard]] auto getBoundedArrayType(
const Type* elementType, std::size_t size) -> const BoundedArrayType*;
[[nodiscard]] auto getBoundedArrayType(const Type* elementType,
std::size_t size)
-> const BoundedArrayType*;
[[nodiscard]] auto getUnboundedArrayType(const Type* elementType)
-> const UnboundedArrayType*;
[[nodiscard]] auto getPointerType(const Type* elementType)
Expand All @@ -123,14 +124,14 @@ class Control {
[[nodiscard]] auto getFunctionType(
const Type* returnType, std::vector<const Type*> parameterTypes,
bool isVariadic = false, CvQualifiers cvQualifiers = CvQualifiers::kNone,
RefQualifier refQualifier = RefQualifier::kNone,
bool isNoexcept = false) -> const FunctionType*;
RefQualifier refQualifier = RefQualifier::kNone, bool isNoexcept = false)
-> const FunctionType*;
[[nodiscard]] auto getMemberObjectPointerType(const ClassType* classType,
const Type* elementType)
-> const MemberObjectPointerType*;
[[nodiscard]] auto getMemberFunctionPointerType(
const ClassType* classType,
const FunctionType* functionType) -> const MemberFunctionPointerType*;
const ClassType* classType, const FunctionType* functionType)
-> const MemberFunctionPointerType*;
[[nodiscard]] auto getTypeParameterType(TypeParameterSymbol* symbol)
-> const TypeParameterType*;
[[nodiscard]] auto getTemplateTypeParameterType(
Expand Down
58 changes: 32 additions & 26 deletions src/parser/cxx/flatbuffers/ast_decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ auto ASTDecoder::decodeUnit(const void* ptr, io::Unit type) -> UnitAST* {
} // switch
}

auto ASTDecoder::decodeDeclaration(const void* ptr,
io::Declaration type) -> DeclarationAST* {
auto ASTDecoder::decodeDeclaration(const void* ptr, io::Declaration type)
-> DeclarationAST* {
switch (type) {
case io::Declaration_SimpleDeclaration:
return decodeSimpleDeclaration(
Expand Down Expand Up @@ -150,8 +150,8 @@ auto ASTDecoder::decodeDeclaration(const void* ptr,
} // switch
}

auto ASTDecoder::decodeStatement(const void* ptr,
io::Statement type) -> StatementAST* {
auto ASTDecoder::decodeStatement(const void* ptr, io::Statement type)
-> StatementAST* {
switch (type) {
case io::Statement_LabeledStatement:
return decodeLabeledStatement(
Expand Down Expand Up @@ -212,8 +212,8 @@ auto ASTDecoder::decodeStatement(const void* ptr,
} // switch
}

auto ASTDecoder::decodeExpression(const void* ptr,
io::Expression type) -> ExpressionAST* {
auto ASTDecoder::decodeExpression(const void* ptr, io::Expression type)
-> ExpressionAST* {
switch (type) {
case io::Expression_GeneratedLiteralExpression:
return decodeGeneratedLiteralExpression(
Expand Down Expand Up @@ -390,8 +390,9 @@ auto ASTDecoder::decodeExpression(const void* ptr,
} // switch
}

auto ASTDecoder::decodeTemplateParameter(
const void* ptr, io::TemplateParameter type) -> TemplateParameterAST* {
auto ASTDecoder::decodeTemplateParameter(const void* ptr,
io::TemplateParameter type)
-> TemplateParameterAST* {
switch (type) {
case io::TemplateParameter_TemplateTypeParameter:
return decodeTemplateTypeParameter(
Expand All @@ -410,8 +411,8 @@ auto ASTDecoder::decodeTemplateParameter(
} // switch
}

auto ASTDecoder::decodeSpecifier(const void* ptr,
io::Specifier type) -> SpecifierAST* {
auto ASTDecoder::decodeSpecifier(const void* ptr, io::Specifier type)
-> SpecifierAST* {
switch (type) {
case io::Specifier_GeneratedTypeSpecifier:
return decodeGeneratedTypeSpecifier(
Expand Down Expand Up @@ -526,8 +527,8 @@ auto ASTDecoder::decodeSpecifier(const void* ptr,
} // switch
}

auto ASTDecoder::decodePtrOperator(const void* ptr,
io::PtrOperator type) -> PtrOperatorAST* {
auto ASTDecoder::decodePtrOperator(const void* ptr, io::PtrOperator type)
-> PtrOperatorAST* {
switch (type) {
case io::PtrOperator_PointerOperator:
return decodePointerOperator(
Expand Down Expand Up @@ -562,8 +563,9 @@ auto ASTDecoder::decodeCoreDeclarator(const void* ptr, io::CoreDeclarator type)
} // switch
}

auto ASTDecoder::decodeDeclaratorChunk(
const void* ptr, io::DeclaratorChunk type) -> DeclaratorChunkAST* {
auto ASTDecoder::decodeDeclaratorChunk(const void* ptr,
io::DeclaratorChunk type)
-> DeclaratorChunkAST* {
switch (type) {
case io::DeclaratorChunk_FunctionDeclaratorChunk:
return decodeFunctionDeclaratorChunk(
Expand Down Expand Up @@ -608,8 +610,9 @@ auto ASTDecoder::decodeUnqualifiedId(const void* ptr, io::UnqualifiedId type)
} // switch
}

auto ASTDecoder::decodeNestedNameSpecifier(
const void* ptr, io::NestedNameSpecifier type) -> NestedNameSpecifierAST* {
auto ASTDecoder::decodeNestedNameSpecifier(const void* ptr,
io::NestedNameSpecifier type)
-> NestedNameSpecifierAST* {
switch (type) {
case io::NestedNameSpecifier_GlobalNestedNameSpecifier:
return decodeGlobalNestedNameSpecifier(
Expand All @@ -628,8 +631,8 @@ auto ASTDecoder::decodeNestedNameSpecifier(
} // switch
}

auto ASTDecoder::decodeFunctionBody(const void* ptr,
io::FunctionBody type) -> FunctionBodyAST* {
auto ASTDecoder::decodeFunctionBody(const void* ptr, io::FunctionBody type)
-> FunctionBodyAST* {
switch (type) {
case io::FunctionBody_DefaultFunctionBody:
return decodeDefaultFunctionBody(
Expand All @@ -648,8 +651,9 @@ auto ASTDecoder::decodeFunctionBody(const void* ptr,
} // switch
}

auto ASTDecoder::decodeTemplateArgument(
const void* ptr, io::TemplateArgument type) -> TemplateArgumentAST* {
auto ASTDecoder::decodeTemplateArgument(const void* ptr,
io::TemplateArgument type)
-> TemplateArgumentAST* {
switch (type) {
case io::TemplateArgument_TypeTemplateArgument:
return decodeTypeTemplateArgument(
Expand All @@ -662,8 +666,9 @@ auto ASTDecoder::decodeTemplateArgument(
} // switch
}

auto ASTDecoder::decodeExceptionSpecifier(
const void* ptr, io::ExceptionSpecifier type) -> ExceptionSpecifierAST* {
auto ASTDecoder::decodeExceptionSpecifier(const void* ptr,
io::ExceptionSpecifier type)
-> ExceptionSpecifierAST* {
switch (type) {
case io::ExceptionSpecifier_ThrowExceptionSpecifier:
return decodeThrowExceptionSpecifier(
Expand All @@ -676,8 +681,8 @@ auto ASTDecoder::decodeExceptionSpecifier(
} // switch
}

auto ASTDecoder::decodeRequirement(const void* ptr,
io::Requirement type) -> RequirementAST* {
auto ASTDecoder::decodeRequirement(const void* ptr, io::Requirement type)
-> RequirementAST* {
switch (type) {
case io::Requirement_SimpleRequirement:
return decodeSimpleRequirement(
Expand Down Expand Up @@ -765,8 +770,9 @@ auto ASTDecoder::decodeExceptionDeclaration(const void* ptr,
} // switch
}

auto ASTDecoder::decodeAttributeSpecifier(
const void* ptr, io::AttributeSpecifier type) -> AttributeSpecifierAST* {
auto ASTDecoder::decodeAttributeSpecifier(const void* ptr,
io::AttributeSpecifier type)
-> AttributeSpecifierAST* {
switch (type) {
case io::AttributeSpecifier_CxxAttribute:
return decodeCxxAttribute(reinterpret_cast<const io::CxxAttribute*>(ptr));
Expand Down
20 changes: 12 additions & 8 deletions src/parser/cxx/literals.cc
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,9 @@ void IntegerLiteral::initialize() const {
components_ = Components::from(value(), nullptr);
}

auto IntegerLiteral::Components::from(
std::string_view text, DiagnosticsClient *diagnostics) -> Components {
auto IntegerLiteral::Components::from(std::string_view text,
DiagnosticsClient *diagnostics)
-> Components {
std::string integerPart;
integerPart.reserve(text.size());

Expand Down Expand Up @@ -576,8 +577,9 @@ void FloatLiteral::initialize() const {
components_ = Components::from(value());
}

auto FloatLiteral::Components::from(
std::string_view text, DiagnosticsClient *diagnostics) -> Components {
auto FloatLiteral::Components::from(std::string_view text,
DiagnosticsClient *diagnostics)
-> Components {
std::size_t pos = 0;

auto LA = [&](int n = 0) -> int {
Expand Down Expand Up @@ -730,8 +732,9 @@ auto FloatLiteral::Components::from(
return components;
}

auto StringLiteral::Components::from(
std::string_view text, DiagnosticsClient *diagnostics) -> Components {
auto StringLiteral::Components::from(std::string_view text,
DiagnosticsClient *diagnostics)
-> Components {
StringLiteralParser<std::string> parser(text, diagnostics);

parser.parseStringLiteral();
Expand All @@ -746,8 +749,9 @@ void StringLiteral::initialize() const {
components_ = Components::from(value());
}

auto CharLiteral::Components::from(
std::string_view text, DiagnosticsClient *diagnostics) -> Components {
auto CharLiteral::Components::from(std::string_view text,
DiagnosticsClient *diagnostics)
-> Components {
StringLiteralParser<std::string> parser(text, diagnostics);

parser.parseCharLiteral();
Expand Down
4 changes: 2 additions & 2 deletions src/parser/cxx/name_lookup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ auto Lookup::qualifiedLookup(Scope* scope, const Name* name) const -> Symbol* {
return lookupHelper(scope, name, cache);
}

auto Lookup::qualifiedLookup(Symbol* scopedSymbol,
const Name* name) const -> Symbol* {
auto Lookup::qualifiedLookup(Symbol* scopedSymbol, const Name* name) const
-> Symbol* {
if (!scopedSymbol) return nullptr;
switch (scopedSymbol->kind()) {
case SymbolKind::kNamespace:
Expand Down
Loading