Skip to content

Commit

Permalink
conv:tc: Add converter for paren type to HLToStd.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jezurko committed Nov 9, 2023
1 parent 64ceaca commit 203d70d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/vast/Conversion/TypeConverters/HLToStd.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright (c) 2021-present, Trail of Bits, Inc.

#include "vast/Util/Warnings.hpp"

VAST_RELAX_WARNINGS
#include <mlir/Analysis/DataLayoutAnalysis.h>
#include <mlir/IR/BuiltinAttributeInterfaces.h>
Expand Down Expand Up @@ -40,6 +42,7 @@ namespace vast::conv::tc {
self().addConversion(convert_lvalue_type());
self().addConversion(convert_pointer_type());
self().addConversion(convert_elaborated_type());
self().addConversion(convert_paren_type());
}

auto convert_decayed_type() {
Expand Down Expand Up @@ -85,6 +88,15 @@ namespace vast::conv::tc {
};
}

auto convert_paren_type() {
return [&](hl::ParenType type) {
return Maybe(type.getElementType())
.and_then(self().convert_type_to_type())
.unwrap()
.template take_wrapped< maybe_type_t >();
};
}

protected:
auto convert_pointer_element_type() {
return [&](auto t) -> maybe_type_t {
Expand Down

0 comments on commit 203d70d

Please sign in to comment.