summaryrefslogtreecommitdiff
path: root/src/passes/CodeFolding.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2019-11-21 16:09:24 -0800
committerGitHub <noreply@github.com>2019-11-21 16:09:24 -0800
commita0c423ef501ea7267c24c46e645296e713b2ea42 (patch)
tree95cb89491e50c67282416d8963bf9f795f3f201e /src/passes/CodeFolding.cpp
parent77b3743f58f59acdb5e40c6e4eea87a4bafc96d3 (diff)
downloadbinaryen-a0c423ef501ea7267c24c46e645296e713b2ea42.tar.gz
binaryen-a0c423ef501ea7267c24c46e645296e713b2ea42.tar.bz2
binaryen-a0c423ef501ea7267c24c46e645296e713b2ea42.zip
Add a pass to inline __original_main() into main() (#2461)
clang/llvm introduce __original_main as a workaround for the fact that main may have different signatures. A downside to that is that users get it in stack traces, which is confusing. In -O2 and above we normally inline __original_main anyhow, but as this is for debugging, non-optimized builds matter too, so add a pass for this. The implementation is trivial, just call doInling. However we must check some corner cases first. Bonus minor fixes to FindAllPointers, which unnecessarily created an object to get the class Id (which is not valid for all classes), and that it didn't take the input by reference properly, which meant we couldn't get the pointer to the function body's toplevel.
Diffstat (limited to 'src/passes/CodeFolding.cpp')
0 files changed, 0 insertions, 0 deletions