Skip to content

Commit

Permalink
treewide: Fix formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
xlauko committed Sep 20, 2024
1 parent 0386e48 commit f110c61
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
6 changes: 3 additions & 3 deletions include/vast/CodeGen/ScopeContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,10 @@ namespace vast::cg

virtual ~module_scope() = default;

symbol_table_scope< string_ref, operation > functions;
symbol_table_scope< string_ref, operation > types;
symbol_table_scope< string_ref, operation > functions;
symbol_table_scope< string_ref, operation > types;
symbol_table_scope< string_ref, operation > globals;
symbol_table_scope< string_ref, operation > enum_constants;
symbol_table_scope< string_ref, operation > enum_constants;
};

// Scope of member names for structures and unions
Expand Down
3 changes: 0 additions & 3 deletions include/vast/Conversion/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def IRsToLLVM : Pass<"vast-irs-to-llvm", "mlir::ModuleOp"> {

def RefsToSSA : Pass<"vast-refs-to-ssa", "core::ModuleOp"> {
let summary = "Lower `hl.ref` into ssa-based `ll.cell`.";
let description = [{ TBD }];

let constructor = "vast::createRefsToSSAPass()";
let dependentDialects = [
Expand All @@ -78,7 +77,6 @@ def RefsToSSA : Pass<"vast-refs-to-ssa", "core::ModuleOp"> {

def StripParamLValues : Pass<"vast-strip-param-lvalues", "core::ModuleOp"> {
let summary = "Strip `hl.lvalue` from types in the module.";
let description = [{ TBD }];

let constructor = "vast::createStripParamLValuesPass()";
let dependentDialects = [
Expand All @@ -88,7 +86,6 @@ def StripParamLValues : Pass<"vast-strip-param-lvalues", "core::ModuleOp"> {

def VarsToCells : Pass<"vast-vars-to-cells", "core::ModuleOp"> {
let summary = "Lower `hl.var` into ssa-based `ll.cell`.";
let description = [{ TBD }];

let constructor = "vast::createVarsToCellsPass()";
let dependentDialects = [
Expand Down
11 changes: 4 additions & 7 deletions include/vast/Conversion/TypeConverters/TypeConverter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,19 @@ namespace vast::conv::tc {
using base::underlying;

// These can not be moved to the constructor, because we would be downcasting
// to the dervied class while it not yet exists, resulting in UB
// to the derived class while it not yet exists, resulting in UB
// Calling this in the derived class constructor should be safe
void init() {
underlying().addConversion([&](core_function_type t) -> maybe_type_t {
auto [sig, results] = std::make_tuple(
underlying().signature_conversion(t.getInputs()),
underlying().convert_types_to_types(t.getResults())
);
auto sig = underlying().signature_conversion(t.getInputs());
auto results = underlying().convert_types_to_types(t.getResults());

if (!sig || !results) {
return std::nullopt;
}

return core_function_type::get(
t.getContext(), sig->getConvertedTypes(), *results,
t.isVarArg()
t.getContext(), sig->getConvertedTypes(), *results, t.isVarArg()
);
});
}
Expand Down

0 comments on commit f110c61

Please sign in to comment.