Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-Leo-Smith committed Oct 31, 2024
1 parent 5a0a34e commit 8ef823b
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
1 change: 0 additions & 1 deletion include/luisa/xir/ilist.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <luisa/xir/pool.h>

namespace luisa::compute::xir {

template<typename T, typename Base>
class IntrusiveNode;

Expand Down
4 changes: 2 additions & 2 deletions include/luisa/xir/instructions/branch.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

namespace luisa::compute::xir {

class BranchInst : public DerivedBranchInstruction<DerivedInstructionTag::BRANCH> {
class BranchInst final : public DerivedBranchInstruction<DerivedInstructionTag::BRANCH> {
public:
using DerivedBranchInstruction::DerivedBranchInstruction;
};

class ConditionalBranchInst : public DerivedConditionalBranchInstruction<DerivedInstructionTag::CONDITIONAL_BRANCH> {
class ConditionalBranchInst final : public DerivedConditionalBranchInstruction<DerivedInstructionTag::CONDITIONAL_BRANCH> {
public:
using DerivedConditionalBranchInstruction::DerivedConditionalBranchInstruction;
};
Expand Down
4 changes: 2 additions & 2 deletions include/luisa/xir/instructions/outline.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ namespace luisa::compute::xir {

class BasicBlock;

class LC_XIR_API OutlineInst final : public DerivedBranchInstruction<DerivedInstructionTag::OUTLINE>,
public InstructionMergeMixin<OutlineInst> {
class OutlineInst final : public DerivedBranchInstruction<DerivedInstructionTag::OUTLINE>,
public InstructionMergeMixin<OutlineInst> {
public:
using DerivedBranchInstruction::DerivedBranchInstruction;
};
Expand Down
2 changes: 1 addition & 1 deletion include/luisa/xir/instructions/unreachable.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace luisa::compute::xir {

// Note: this instruction must be the terminator of a basic block.
class LC_XIR_API UnreachableInst final : public DerivedTerminatorInstruction<DerivedInstructionTag::UNREACHABLE> {
class UnreachableInst final : public DerivedTerminatorInstruction<DerivedInstructionTag::UNREACHABLE> {
public:
using DerivedTerminatorInstruction::DerivedTerminatorInstruction;
};
Expand Down
4 changes: 2 additions & 2 deletions include/luisa/xir/metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ enum struct DerivedMetadataTag {
COMMENT,
};

class LC_XIR_API Metadata : public IntrusiveForwardNode<Metadata> {
class Metadata : public IntrusiveForwardNode<Metadata> {
public:
using Super::Super;
[[nodiscard]] virtual DerivedMetadataTag derived_metadata_tag() const noexcept = 0;
Expand Down Expand Up @@ -49,7 +49,7 @@ template<typename Parent>
class MetadataMixin {

private:
MetadataList _metadata_list;
MetadataList _metadata_list{};

private:
[[nodiscard]] Pool *_get_pool_from_parent() noexcept {
Expand Down
2 changes: 1 addition & 1 deletion include/luisa/xir/use.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace luisa::compute::xir {
class Value;
class User;

class LC_XIR_API Use : public IntrusiveForwardNode<Use> {
class LC_XIR_API Use final : public IntrusiveForwardNode<Use> {

private:
User *_user;
Expand Down
5 changes: 4 additions & 1 deletion src/xir/basic_block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
namespace luisa::compute::xir {

BasicBlock::BasicBlock(Pool *pool) noexcept
: DerivedValue{pool, nullptr}, _instructions{pool} {}
: DerivedValue{pool, nullptr}, _instructions{pool} {
_instructions.head_sentinel()->_set_parent_block(this);
_instructions.tail_sentinel()->_set_parent_block(this);
}

}// namespace luisa::compute::xir

0 comments on commit 8ef823b

Please sign in to comment.