-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proper syntax generation for Lock/TryLock
- Loading branch information
1 parent
e4a4b5f
commit 2881df1
Showing
14 changed files
with
377 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#pragma once | ||
|
||
#include <cassert> | ||
#include <cstdint> | ||
#include <memory> | ||
|
||
#include "Base.hpp" | ||
#include "FieldNodeMixin.hpp" | ||
#include "Scope.hpp" | ||
#include "Visitor.hpp" | ||
|
||
namespace Node { | ||
|
||
class Lock final : | ||
public Base, | ||
public FieldParametersNodeMixin<0>, | ||
public FieldBodyNodeMixin<1> | ||
{ | ||
public: | ||
Lock(size_t ip, BasePtr body) : | ||
Base(2, ip, 10), | ||
FieldParametersNodeMixin(this, std::make_shared<Params>()), | ||
FieldBodyNodeMixin(this, body) | ||
{ | ||
} | ||
virtual ~Lock() = default; | ||
|
||
void visit(Visitor* visitor) override | ||
{ | ||
assert(visitor); | ||
visitor->visit(this); | ||
} | ||
|
||
void computeInstructionBounds() override | ||
{ | ||
Base::computeInstructionBounds(); | ||
} | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,9 @@ | |
|
||
#include "Declare.hpp" | ||
|
||
#include "Lock.hpp" | ||
#include "TryLock.hpp" | ||
#include "Unlock.hpp" | ||
|
||
|
||
#endif // NODES_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#pragma once | ||
|
||
#include <cassert> | ||
#include <cstdint> | ||
#include <memory> | ||
|
||
#include "Base.hpp" | ||
#include "FieldNodeMixin.hpp" | ||
#include "Scope.hpp" | ||
#include "Visitor.hpp" | ||
|
||
namespace Node { | ||
|
||
class TryLock final : | ||
public Base, | ||
public FieldParametersNodeMixin<0>, | ||
public FieldBodyNodeMixin<1> | ||
{ | ||
public: | ||
TryLock(size_t ip, const Pex::StringTable::Index& result, BasePtr body) : | ||
Base(2, ip, 10, result), | ||
FieldParametersNodeMixin(this, std::make_shared<Params>()), | ||
FieldBodyNodeMixin(this, body) | ||
{ | ||
} | ||
virtual ~TryLock() = default; | ||
|
||
void visit(Visitor* visitor) override | ||
{ | ||
assert(visitor); | ||
visitor->visit(this); | ||
} | ||
|
||
void computeInstructionBounds() override | ||
{ | ||
Base::computeInstructionBounds(); | ||
} | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#pragma once | ||
|
||
#include <cassert> | ||
#include <cstdint> | ||
#include <memory> | ||
|
||
#include "Base.hpp" | ||
#include "FieldNodeMixin.hpp" | ||
#include "Scope.hpp" | ||
#include "Visitor.hpp" | ||
|
||
namespace Node { | ||
|
||
class Unlock final : | ||
public Base, | ||
public FieldParametersNodeMixin<0> | ||
{ | ||
public: | ||
Unlock(size_t ip) : | ||
Base(1, ip, 10), | ||
FieldParametersNodeMixin(this, std::make_shared<Params>()) | ||
{ | ||
} | ||
virtual ~Unlock() = default; | ||
|
||
void visit(Visitor* visitor) override | ||
{ | ||
assert(visitor); | ||
visitor->visit(this); | ||
} | ||
|
||
void computeInstructionBounds() override | ||
{ | ||
Base::computeInstructionBounds(); | ||
} | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.