diff options
author | Daniel Wirtz <dcode@dcode.io> | 2020-09-14 11:51:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-14 11:51:59 +0200 |
commit | 18716065cc470c3bc29a4fecf3889891a9bf604b (patch) | |
tree | f106abf584fcc2ab1e14320682962326357479e8 /src/passes/Print.cpp | |
parent | 0ade3f2761b0661ab4d1290ab704c594c1d90df9 (diff) | |
download | binaryen-18716065cc470c3bc29a4fecf3889891a9bf604b.tar.gz binaryen-18716065cc470c3bc29a4fecf3889891a9bf604b.tar.bz2 binaryen-18716065cc470c3bc29a4fecf3889891a9bf604b.zip |
Implement module and local names in name section (#3115)
Adds support for the module and local subsections of the name section plus the respective C and JS APIs to populate and obtain local names.
C API:
* BinaryenFunctionGetNumLocals(func)
* BinaryenFunctionHasLocalName(func, index)
* BinaryenFunctionGetLocalName(func, index)
* BinaryenFunctionSetLocalName(func, index, name)
JS API:
* Function.getNumLocals(func)
* Function.hasLocalName(func, index)
* Function.getLocalName(func, index)
* Function.setLocalName(func, index, name)
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r-- | src/passes/Print.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index f4131db37..15ab97098 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -2398,6 +2398,10 @@ struct PrintSExpression : public OverriddenVisitor<PrintSExpression> { currModule = curr; o << '('; printMajor(o, "module"); + if (curr->name.is()) { + o << ' '; + printName(curr->name, o); + } incIndent(); std::vector<Signature> signatures; std::unordered_map<Signature, Index> indices; |