From 38ee7e9c17f97ffe546d8ebd4345750b009d41c3 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Tue, 24 Nov 2020 09:56:30 -0800 Subject: Let EnforceStackLimits have pointers to Globals (NFC) (#3397) These can be simply raw pointers, given that they are stored in modules using `unique_ptr`s. --- src/passes/StackCheck.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/passes/StackCheck.cpp b/src/passes/StackCheck.cpp index eb63aacbc..c25d70635 100644 --- a/src/passes/StackCheck.cpp +++ b/src/passes/StackCheck.cpp @@ -74,8 +74,8 @@ static void generateSetStackLimitFunctions(Module& module) { struct EnforceStackLimits : public WalkerPass> { EnforceStackLimits(const Global* stackPointer, - const std::unique_ptr& stackBase, - const std::unique_ptr& stackLimit, + const Global* stackBase, + const Global* stackLimit, Builder& builder, Name handler) : stackPointer(stackPointer), stackBase(stackBase), stackLimit(stackLimit), @@ -128,8 +128,8 @@ struct EnforceStackLimits : public WalkerPass> { private: const Global* stackPointer; - const std::unique_ptr& stackBase; - const std::unique_ptr& stackLimit; + const Global* stackBase; + const Global* stackLimit; Builder& builder; Name handler; }; @@ -161,7 +161,8 @@ struct StackCheck : public Pass { builder.makeConst(int32_t(0)), Builder::Mutable); PassRunner innerRunner(module); - EnforceStackLimits(stackPointer, stackBase, stackLimit, builder, handler) + EnforceStackLimits( + stackPointer, stackBase.get(), stackLimit.get(), builder, handler) .run(&innerRunner, module); module->addGlobal(std::move(stackBase)); module->addGlobal(std::move(stackLimit)); -- cgit v1.2.3