@@ -715,42 +715,36 @@ class CodeMetadataExpr : public ExprMixin<ExprType::CodeMetadata> {
715715 struct InstructionFrequency {
716716 uint32_t frequency;
717717 };
718- enum class Type {
719- Binary,
720- CompilationHint,
721- InstructionFrequency,
722- CallTargets
723- };
724718
725- explicit CodeMetadataExpr (std::string_view name,
726- std::vector<uint8_t > data,
727- const Location& loc = Location())
719+ CodeMetadataExpr (std::string_view name,
720+ std::vector<uint8_t > data,
721+ const Location& loc = Location())
728722 : ExprMixin<ExprType::CodeMetadata>(loc), name(name), type(Type::Binary) {
729723 new (&hint.data ) std::vector<uint8_t >(std::move (data));
730724 }
731725
732- explicit CodeMetadataExpr (std::string_view name,
733- CompilationPriority compilation_priority,
734- const Location& loc = Location())
726+ CodeMetadataExpr (std::string_view name,
727+ CompilationPriority compilation_priority,
728+ const Location& loc = Location())
735729 : ExprMixin<ExprType::CodeMetadata>(loc),
736730 name (name),
737731 type (Type::CompilationHint) {
738732 new (&hint.compilation_priority ) CompilationPriority (compilation_priority);
739733 }
740734
741- explicit CodeMetadataExpr (std::string_view name,
742- InstructionFrequency instruction_frequency,
743- const Location& loc = Location())
735+ CodeMetadataExpr (std::string_view name,
736+ InstructionFrequency instruction_frequency,
737+ const Location& loc = Location())
744738 : ExprMixin<ExprType::CodeMetadata>(loc),
745739 name (name),
746740 type (Type::InstructionFrequency) {
747741 new (&hint.instruction_frequency )
748742 InstructionFrequency (instruction_frequency);
749743 }
750744
751- explicit CodeMetadataExpr (std::string_view name,
752- std::vector<CallTarget> targets,
753- const Location& loc = Location())
745+ CodeMetadataExpr (std::string_view name,
746+ std::vector<CallTarget> targets,
747+ const Location& loc = Location())
754748 : ExprMixin<ExprType::CodeMetadata>(loc),
755749 name (name),
756750 type (Type::CallTargets) {
@@ -777,17 +771,24 @@ class CodeMetadataExpr : public ExprMixin<ExprType::CodeMetadata> {
777771 std::vector<uint8_t > serialize (const Module&) const ;
778772
779773 std::string_view name;
780- Type type;
781774
782775 private:
783776 union Hint {
784777 std::vector<uint8_t > data;
785778 CompilationPriority compilation_priority;
786779 InstructionFrequency instruction_frequency{};
787780 std::vector<CallTarget> call_targets;
788- Hint () {}
789781 ~Hint () {}
790782 } hint;
783+
784+ enum class Type {
785+ Binary,
786+ CompilationHint,
787+ InstructionFrequency,
788+ CallTargets
789+ };
790+
791+ Type type;
791792};
792793
793794class ReturnCallIndirectExpr : public ExprMixin <ExprType::ReturnCallIndirect> {
0 commit comments