summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-12-14 19:02:47 -0800
committerAlon Zakai <alonzakai@gmail.com>2015-12-14 19:02:47 -0800
commit89e0212e5cb1824dc936a5994176de85f259df0b (patch)
treefc27aa4cad9b6d37fae78b4162a4ba6c2374abce /src/wasm.h
parent76617512d2bbffb6abf0a1b3ba13da433c194425 (diff)
downloadbinaryen-89e0212e5cb1824dc936a5994176de85f259df0b.tar.gz
binaryen-89e0212e5cb1824dc936a5994176de85f259df0b.tar.bz2
binaryen-89e0212e5cb1824dc936a5994176de85f259df0b.zip
start to emit metadata from s2wasm
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wasm.h b/src/wasm.h
index 37aa495db..afc2cf88c 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -298,6 +298,12 @@ public:
return _id == T()._id ? (T*)this : nullptr;
}
+ template<class T>
+ T* cast() {
+ assert(_id == T()._id);
+ return (T*)this;
+ }
+
inline std::ostream& print(std::ostream &o, unsigned indent); // avoid virtual here, for performance
friend std::ostream& operator<<(std::ostream &o, Expression* expression) {