Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions llvm/lib/CheerpUtils/CheerpLowerAtomic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ using namespace cheerp;
PreservedAnalyses CheerpLowerAtomicPass::run(Module& M, ModuleAnalysisManager& MAM)
{
FunctionAnalysisManager& FAM = MAM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager();
FunctionPassManager FPM;
FPM.addPass(LowerAtomicPass());
LowerAtomicPass LAP;

// Loop over the functions, and only pass genericjs ones to LowerAtomicPass
for (Function& F : M)
Expand All @@ -24,7 +23,7 @@ PreservedAnalyses CheerpLowerAtomicPass::run(Module& M, ModuleAnalysisManager& M
if (!LowerAtomics && F.getSection() == "asmjs")
continue;

FPM.run(F, FAM);
LAP.run(F, FAM);
}

// Replace thread locals with actual globals
Expand Down
5 changes: 2 additions & 3 deletions llvm/lib/CheerpUtils/LowerGlobalDestructors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ void LowerGlobalDestructorsPass::filterGenericJSDestructors(Module& M)

PreservedAnalyses LowerGlobalDestructorsPass::run(Module& M, ModuleAnalysisManager& MAM)
{
ModulePassManager MPM;
MPM.addPass(LowerGlobalDtorsPass());
LowerGlobalDtorsPass LGDP;

// Collect all currently existing functions in a set.
std::unordered_set<Function*> functionsBeforePass;
Expand All @@ -76,7 +75,7 @@ PreservedAnalyses LowerGlobalDestructorsPass::run(Module& M, ModuleAnalysisManag
filterGenericJSDestructors(M);

// Run the LowerGlobalDtorsPass.
PreservedAnalyses PA = MPM.run(M, MAM);
PreservedAnalyses PA = LGDP.run(M, MAM);

// The functions that weren't in the list before are the new functions
// created by the LowerGlobalDtorsPass. Tag them asmjs.
Expand Down
Loading